diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/dump_design.py | 8 | 
1 files changed, 6 insertions, 2 deletions
diff --git a/python/dump_design.py b/python/dump_design.py index 9d8ade3e..b8436288 100644 --- a/python/dump_design.py +++ b/python/dump_design.py @@ -1,2 +1,6 @@ -for cell in design.cells: -    print(cell.first) +# Run ./nextpnr-ice40 --json ice40/blinky.json --file 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))  | 
