aboutsummaryrefslogtreecommitdiffstats
path: root/icebox/icebox_chipdb.py
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2015-07-18 13:07:39 +0200
committerClifford Wolf <clifford@clifford.at>2015-07-18 13:07:39 +0200
commit13e63e6b65e044e348356731b55610d02cb308b9 (patch)
tree00274273090bec68fc31022b6daef4115290efbb /icebox/icebox_chipdb.py
parentc41701ca3a2046e9cabe303cff0aa203215d70c1 (diff)
downloadicestorm-13e63e6b65e044e348356731b55610d02cb308b9.tar.gz
icestorm-13e63e6b65e044e348356731b55610d02cb308b9.tar.bz2
icestorm-13e63e6b65e044e348356731b55610d02cb308b9.zip
Import of icestorm-snapshot-150526.zip
Diffstat (limited to 'icebox/icebox_chipdb.py')
-rwxr-xr-xicebox/icebox_chipdb.py113
1 files changed, 108 insertions, 5 deletions
diff --git a/icebox/icebox_chipdb.py b/icebox/icebox_chipdb.py
index 12ccfa8..c673f54 100755
--- a/icebox/icebox_chipdb.py
+++ b/icebox/icebox_chipdb.py
@@ -40,16 +40,44 @@ print("""#
# Quick File Format Reference:
# ----------------------------
#
-# .device DEVICE
+# .device DEVICE WIDTH HEIGHT NUM_NETS
#
# declares the device type (e.g. "1k")
#
#
# .pins PACKAGE
-# PIN_NUM TILE_X TILE_Y PIO_NUM PADIN_NUM
+# PIN_NUM TILE_X TILE_Y PIO_NUM GLB_NUM
# ...
#
-# associates a package pin with an IO tile and block
+# associates a package pin with an IO tile and block, and global network
+#
+#
+# .gbufin
+# TILE_X TILE_Y GLB_NUM
+# ...
+#
+# associates an IO tile with the global network it drives via wire_gbuf/in
+#
+#
+# .iolatch
+# TILE_X TILE_Y
+# ...
+#
+# specifies the IO tiles that drive the latch signal for the bank via wire_gbuf/in
+#
+#
+# .ieren
+# PIO_TILE_X PIO_TILE_Y PIO_NUM IEREN_TILE_X IEREN_TILE_Y IEREN_NUM
+# ...
+#
+# associates an IO block with an IeRen-block
+#
+#
+# .colbuf
+# SOURCE_TILE_X SOURCE_TILE_Y DEST_TILE_X DEST_TILE_Y
+# ...
+#
+# declares the positions of the column buffers
#
#
# .io_tile X Y
@@ -60,6 +88,24 @@ print("""#
# declares the existence of a IO/LOGIC/RAM tile with the given coordinates
#
#
+# .io_tile_bits COLUMNS ROWS
+# .logic_tile_bits COLUMNS ROWS
+# .ramb_tile_bits COLUMNS ROWS
+# .ramt_tile_bits COLUMNS ROWS
+# FUNCTION_1 CONFIG_BITS_NAMES_1
+# FUNCTION_2 CONFIG_BITS_NAMES_2
+# ...
+#
+# declares non-routing configuration bits of IO/LOGIC/RAM tiles
+#
+#
+# .extra_bits
+# FUNCTION BANK_NUM ADDR_X ADDR_Y
+# ...
+#
+# declares non-routing global configuration bits
+#
+#
# .net NET_INDEX
# X1 Y1 name1
# X2 Y2 name2
@@ -85,7 +131,9 @@ print("""#
#
""")
-print(".device 1k")
+all_group_segments = ic.group_segments(all_tiles, connect_gb=False)
+
+print(".device 1k %d %d %d" % (ic.max_x+1, ic.max_y+1, len(all_group_segments)))
print()
print(".pins tq144")
@@ -97,6 +145,26 @@ for entry in sorted(ic.pinloc_db()):
print("%d %d %d %d %d" % tuple(entry + [pio_to_padin[pio] if pio in pio_to_padin else -1]))
print()
+print(".gbufin")
+for entry in sorted(ic.gbufin_db()):
+ print(" ".join(["%d" % k for k in entry]))
+print()
+
+print(".iolatch")
+for entry in sorted(ic.iolatch_db()):
+ print(" ".join(["%d" % k for k in entry]))
+print()
+
+print(".ieren")
+for entry in sorted(ic.ieren_db()):
+ print(" ".join(["%d" % k for k in entry]))
+print()
+
+print(".colbuf")
+for entry in sorted(ic.colbuf_db()):
+ print(" ".join(["%d" % k for k in entry]))
+print()
+
for idx in sorted(ic.io_tiles):
print(".io_tile %d %d" % idx)
print()
@@ -113,7 +181,42 @@ for idx in sorted(ic.ramt_tiles):
print(".ramt_tile %d %d" % idx)
print()
-for group in sorted(ic.group_segments(all_tiles)):
+def print_tile_nonrouting_bits(tile_type, idx):
+ tx = idx[0]
+ ty = idx[1]
+
+ tile = ic.tile(tx, ty)
+
+ print(".%s_tile_bits %d %d" % (tile_type, len(tile[0]), len(tile)))
+
+ function_bits = dict()
+ for entry in ic.tile_db(tx, ty):
+ if not ic.tile_has_entry(tx, ty, entry):
+ continue
+ if entry[1] in ("routing", "buffer"):
+ continue
+
+ func = ".".join(entry[1:])
+ function_bits[func] = entry[0]
+
+ for x in sorted(function_bits):
+ print(" ".join([x] + function_bits[x]))
+ print()
+
+print_tile_nonrouting_bits("logic", ic.logic_tiles.keys()[0])
+print_tile_nonrouting_bits("io", ic.io_tiles.keys()[0])
+print_tile_nonrouting_bits("ramb", ic.ramb_tiles.keys()[0])
+print_tile_nonrouting_bits("ramt", ic.ramt_tiles.keys()[0])
+
+print(".extra_bits")
+extra_bits = dict()
+for idx in sorted(ic.extra_bits_db()):
+ extra_bits[".".join(ic.extra_bits_db()[idx])] = " ".join(["%d" % k for k in idx])
+for idx in sorted(extra_bits):
+ print("%s %s" % (idx, extra_bits[idx]))
+print()
+
+for group in sorted(all_group_segments):
netidx = len(net_to_segs)
net_to_segs.append(group)
print(".net %d" % netidx)