aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-07 20:35:08 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-07 20:35:08 +0200
commit9b87f132c8f0ffa63357096313c92eef0bc5633f (patch)
tree06bc41a9456b987b732afad9c94c2061010c30de /python
parenta4f687548e31b64a7684fdfbb64ea82f46370e2a (diff)
downloadnextpnr-9b87f132c8f0ffa63357096313c92eef0bc5633f.tar.gz
nextpnr-9b87f132c8f0ffa63357096313c92eef0bc5633f.tar.bz2
nextpnr-9b87f132c8f0ffa63357096313c92eef0bc5633f.zip
Improving dump_design.py
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'python')
-rw-r--r--python/dump_design.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/python/dump_design.py b/python/dump_design.py
index 22d4ab17..5bac140d 100644
--- a/python/dump_design.py
+++ b/python/dump_design.py
@@ -1,6 +1,22 @@
# 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))
+ print("\tPorts:")
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))
+ if port.second.net is not None:
+ print("\t\t{} {} {}".format(port.first, dir, port.second.net.name))
+
+ if len(cell.second.attrs) > 0:
+ print("\tAttrs:")
+ for attr in cell.second.attrs:
+ print("\t\t{}: {}".format(attr.first, attr.second))
+
+ if len(cell.second.params) > 0:
+ print("\tParams:")
+ for param in cell.second.params:
+ print("\t\t{}: {}".format(param.first, param.second))
+
+ if not cell.second.bel.nil():
+ print("\tBel: {}".format(chip.getBelName(cell.second.bel)))
+ print()