aboutsummaryrefslogtreecommitdiffstats
path: root/ice40
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-06-17 14:46:10 +0200
committerClifford Wolf <clifford@clifford.at>2018-06-17 14:46:10 +0200
commita3e08422995ff6eb590666c196fbdb0ce0e28e52 (patch)
tree9eb4ec8ca304333556b05e0fc4c5f1d3d90d1fcc /ice40
parentc0a2f0b89fa1505c728d57a4529a62aa78013da4 (diff)
downloadnextpnr-a3e08422995ff6eb590666c196fbdb0ce0e28e52.tar.gz
nextpnr-a3e08422995ff6eb590666c196fbdb0ce0e28e52.tar.bz2
nextpnr-a3e08422995ff6eb590666c196fbdb0ce0e28e52.zip
Move PipInfoPOD into ChipDB binary blob
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'ice40')
-rw-r--r--ice40/chipdb.py34
1 files changed, 28 insertions, 6 deletions
diff --git a/ice40/chipdb.py b/ice40/chipdb.py
index 73787ca3..c0ac646c 100644
--- a/ice40/chipdb.py
+++ b/ice40/chipdb.py
@@ -577,7 +577,15 @@ for wire in range(num_wires):
for src in wire_uphill[wire]:
if (src, wire) not in pipcache:
pipcache[(src, wire)] = len(pipinfo)
- pipinfo.append(" {%d, %d, 1, %d, %d, %d, %d}" % (src, wire, pip_xy[(src, wire)][0], pip_xy[(src, wire)][1], pip_xy[(src, wire)][2], pip_xy[(src, wire)][3]))
+ pi = dict()
+ pi["src"] = src
+ pi["dst"] = wire
+ pi["delay"] = 1
+ pi["x"] = pip_xy[(src, wire)][0]
+ pi["y"] = pip_xy[(src, wire)][1]
+ pi["switch_mask"] = pip_xy[(src, wire)][2]
+ pi["switch_index"] = pip_xy[(src, wire)][3]
+ pipinfo.append(pi)
pips.append(pipcache[(src, wire)])
num_uphill = len(pips)
list_uphill = "wire%d_uppips" % wire
@@ -593,7 +601,15 @@ for wire in range(num_wires):
for dst in wire_downhill[wire]:
if (wire, dst) not in pipcache:
pipcache[(wire, dst)] = len(pipinfo)
- pipinfo.append(" {%d, %d, 1, %d, %d, %d, %d}" % (wire, dst, pip_xy[(wire, dst)][0], pip_xy[(wire, dst)][1], pip_xy[(wire, dst)][2], pip_xy[(wire, dst)][3]))
+ pi = dict()
+ pi["src"] = wire
+ pi["dst"] = dst
+ pi["delay"] = 1
+ pi["x"] = pip_xy[(wire, dst)][0]
+ pi["y"] = pip_xy[(wire, dst)][1]
+ pi["switch_mask"] = pip_xy[(wire, dst)][2]
+ pi["switch_index"] = pip_xy[(wire, dst)][3]
+ pipinfo.append(pi)
pips.append(pipcache[(wire, dst)])
num_downhill = len(pips)
list_downhill = "wire%d_downpips" % wire
@@ -708,16 +724,22 @@ for info in wireinfo:
bba.u16(info["x"], "x")
bba.u16(info["y"], "y")
+bba.l("pip_data_%s" % dev_name, "PipInfoPOD", export=True)
+for info in pipinfo:
+ bba.u32(info["src"], "src")
+ bba.u32(info["dst"], "dst")
+ bba.u32(info["delay"], "delay")
+ bba.u8(info["x"], "x")
+ bba.u8(info["y"], "y")
+ bba.u16(info["switch_mask"], "switch_mask")
+ bba.u32(info["switch_index"], "switch_index")
+
bba.finalize()
if compact_output:
bba.write_compact_c(sys.stdout)
else:
bba.write_verbose_c(sys.stdout)
-print("static PipInfoPOD pip_data_%s[%d] = {" % (dev_name, len(pipinfo)))
-print(" " + ",\n ".join(pipinfo))
-print("};")
-
switchinfo = []
switchid = 0
for switch in switches: