aboutsummaryrefslogtreecommitdiffstats
path: root/icebox/icebox_vlog.py
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2017-11-11 11:26:43 +0000
committerDavid Shah <davey1576@gmail.com>2017-11-17 15:08:25 +0000
commit94aa596cb144cc47dc054377e1510fbb4effbfd8 (patch)
treedf46b100f0cef6a6913f7f741cbf44bf1e0511bc /icebox/icebox_vlog.py
parent96b527bfeffb703baaa4119e48aae83ba0aa37cf (diff)
downloadicestorm-94aa596cb144cc47dc054377e1510fbb4effbfd8.tar.gz
icestorm-94aa596cb144cc47dc054377e1510fbb4effbfd8.tar.bz2
icestorm-94aa596cb144cc47dc054377e1510fbb4effbfd8.zip
Trace DSP routing
Diffstat (limited to 'icebox/icebox_vlog.py')
-rwxr-xr-xicebox/icebox_vlog.py29
1 files changed, 28 insertions, 1 deletions
diff --git a/icebox/icebox_vlog.py b/icebox/icebox_vlog.py
index 1b19d10..8f6bf7c 100755
--- a/icebox/icebox_vlog.py
+++ b/icebox/icebox_vlog.py
@@ -136,6 +136,7 @@ text_wires = list()
text_ports = list()
luts_queue = set()
+special_5k_queue = set()
text_func = list()
failed_drivers_check = list()
@@ -315,7 +316,11 @@ for segs in sorted(ic.group_segments(extra_connections=extra_connections, extra_
match = re.match("lutff_(\d+)/", s[2])
if match:
- luts_queue.add((s[0], s[1], int(match.group(1))))
+ #IpCon and DSP tiles look like logic tiles, but aren't.
+ if ic.device == "5k" and (s[0] == 0 or s[0] == ic.max_x):
+ special_5k_queue.add((s[0], s[1]))
+ else:
+ luts_queue.add((s[0], s[1], int(match.group(1))))
nets[n] = segs
@@ -752,6 +757,28 @@ for tile in ic.ramb_tiles:
text_func.append(");")
text_func.append("")
+for i in range(4):
+ for tile in ic.dsp_tiles[i]:
+ if tile in special_5k_queue:
+ #TODO: print config
+ x = tile[0]
+ y = tile[1]
+ net_clk = seg_to_net((x, y, "lutff_global/clk"), "1'b0")
+ net_sr = seg_to_net((x, y, "lutff_global/s_r"), "1'b0")
+ #TEMP: for tracing only
+ text_func.append("/* DSP%d %2d %2d */ assign dsp%d_%d_%d_clk = %s;" % (i, x, y, i, x, y, net_clk))
+ text_func.append("/* DSP%d %2d %2d */ assign dsp%d_%d_%d_sr = %s;" % (i, x, y, i, x, y, net_sr))
+ for j in range(7):
+ net_in0 = seg_to_net((x, y, "lutff_%d/in_0" % j), "1'b0")
+ net_in1 = seg_to_net((x, y, "lutff_%d/in_1" % j), "1'b0")
+ net_in2 = seg_to_net((x, y, "lutff_%d/in_2" % j), "1'b0")
+ net_in3 = seg_to_net((x, y, "lutff_%d/in_3" % j), "1'b0")
+ #TODO: cin, cout
+ text_func.append("/* DSP%d %2d %2d %d*/ assign dsp%d_%d_%d_in_%d_0 = %s;" % (i, x, y, j, i, x, y, j, net_in0))
+ text_func.append("/* DSP%d %2d %2d %d*/ assign dsp%d_%d_%d_in_%d_1 = %s;" % (i, x, y, j, i, x, y, j, net_in1))
+ text_func.append("/* DSP%d %2d %2d %d*/ assign dsp%d_%d_%d_in_%d_2 = %s;" % (i, x, y, j, i, x, y, j, net_in2))
+ text_func.append("/* DSP%d %2d %2d %d*/ assign dsp%d_%d_%d_in_%d_3 = %s;" % (i, x, y, j, i, x, y, j, net_in3))
+
wire_to_reg = set()
lut_assigns = list()
const_assigns = list()