diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/dump_design.py | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/python/dump_design.py b/python/dump_design.py index 1850d509..d95f041b 100644 --- a/python/dump_design.py +++ b/python/dump_design.py @@ -1,26 +1,25 @@ # 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 cell, cinfo in sorted(design.cells, key=lambda x: x.first): + print("Cell {} : {}".format(cell, cinfo.type)) print("\tPorts:") - for port in sorted(cell.second.ports, key=lambda x: x.first): - dir = (" <-- ", " --> ", " <-> ")[int(port.second.type)] - if port.second.net is not None: - print("\t\t{} {} {}".format(port.first, dir, port.second.net.name)) + for port, pinfo in sorted(cinfo.ports, key=lambda x: x.first): + dir = (" <-- ", " --> ", " <-> ")[int(pinfo.type)] + if pinfo.net is not None: + print("\t\t{} {} {}".format(port, dir, pinfo.net.name)) - if len(cell.second.attrs) > 0: + if len(cinfo.attrs) > 0: print("\tAttrs:") - for attr in cell.second.attrs: - print("\t\t{}: {}".format(attr.first, attr.second)) + for attr, val in cinfo.attrs: + print("\t\t{}: {}".format(attr, val)) - if len(cell.second.params) > 0: + if len(cinfo.params) > 0: print("\tParams:") - for param in cell.second.params: - val = param.second + for param, val in cinfo.params: if val.isdigit(): val = bin(int(val))[2:] val = "{}'b{}".format(len(val), val) - print("\t\t{}: {}".format(param.first, val)) + print("\t\t{}: {}".format(param, val)) - if not cell.second.bel.nil(): - print("\tBel: {}".format(chip.getBelName(cell.second.bel))) + if not cinfo.bel.nil(): + print("\tBel: {}".format(chip.getBelName(cinfo.bel))) print() |