aboutsummaryrefslogtreecommitdiffstats
path: root/python/dump_design.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/dump_design.py')
-rw-r--r--python/dump_design.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/dump_design.py b/python/dump_design.py
new file mode 100644
index 00000000..22d4ab17
--- /dev/null
+++ b/python/dump_design.py
@@ -0,0 +1,6 @@
+# Run ./nextpnr-ice40 --json ice40/blinky.json --run python/dump_design.py
+for cell in sorted(design.cells, key=lambda x: x.first):
+ print("Cell {} : {}".format(cell.first, cell.second.type))
+ for port in sorted(cell.second.ports, key=lambda x: x.first):
+ dir = (" <-- ", " --> ", " <-> ")[int(port.second.type)]
+ print(" {} {} {}".format(port.first, dir, port.second.net.name))