diff options
author | ZipCPU <dgisselq@ieee.org> | 2018-06-07 15:46:21 -0400 |
---|---|---|
committer | ZipCPU <dgisselq@ieee.org> | 2018-06-07 15:46:21 -0400 |
commit | 87775d3c6f56bcaaf47e169822ae97b8370ac44f (patch) | |
tree | 6771accc538332b08aeceb25856cad45db183678 /python/dump_design.py | |
parent | 4499864024a5b658bf5772ed87e218bcdaedc262 (diff) | |
parent | e7ff22ce901102589173f7a7dc3e4ddbb030655f (diff) | |
download | nextpnr-87775d3c6f56bcaaf47e169822ae97b8370ac44f.tar.gz nextpnr-87775d3c6f56bcaaf47e169822ae97b8370ac44f.tar.bz2 nextpnr-87775d3c6f56bcaaf47e169822ae97b8370ac44f.zip |
Tried to add fixes *and* update clang-format jsonparse.cc
Diffstat (limited to 'python/dump_design.py')
-rw-r--r-- | python/dump_design.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/python/dump_design.py b/python/dump_design.py index 22d4ab17..1850d509 100644 --- a/python/dump_design.py +++ b/python/dump_design.py @@ -1,6 +1,26 @@ # 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: + val = param.second + if val.isdigit(): + val = bin(int(val))[2:] + val = "{}'b{}".format(len(val), val) + print("\t\t{}: {}".format(param.first, val)) + + if not cell.second.bel.nil(): + print("\tBel: {}".format(chip.getBelName(cell.second.bel))) + print() |