aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorZipCPU <dgisselq@ieee.org>2018-06-07 07:45:22 -0400
committerZipCPU <dgisselq@ieee.org>2018-06-07 07:45:22 -0400
commit1ed5c641c16bffabe96ffd2ef8499dd3ae740050 (patch)
treee7b9417cb4faf44956859289dd6b9dfb579f96d9 /python
parentd7bb30cc66f2ba39c77a979b809a6e6bdfcb5097 (diff)
parented0c44891fb510c8181c2ae9332d7a030f0aaaff (diff)
downloadnextpnr-1ed5c641c16bffabe96ffd2ef8499dd3ae740050.tar.gz
nextpnr-1ed5c641c16bffabe96ffd2ef8499dd3ae740050.tar.bz2
nextpnr-1ed5c641c16bffabe96ffd2ef8499dd3ae740050.zip
Merge branch 'master' into gqtech
Diffstat (limited to 'python')
-rw-r--r--python/dump_design.py6
-rw-r--r--python/functions.py2
2 files changed, 8 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))
diff --git a/python/functions.py b/python/functions.py
new file mode 100644
index 00000000..4f005456
--- /dev/null
+++ b/python/functions.py
@@ -0,0 +1,2 @@
+def test_function():
+ print("Hello World!")