From a5249da02d2a55d4b838dd8c29e159513dd71418 Mon Sep 17 00:00:00 2001 From: David Shah Date: Thu, 7 Jun 2018 12:40:31 +0200 Subject: Working on global Python design object Signed-off-by: David Shah --- python/dump_design.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 python/dump_design.py (limited to 'python/dump_design.py') diff --git a/python/dump_design.py b/python/dump_design.py new file mode 100644 index 00000000..9d8ade3e --- /dev/null +++ b/python/dump_design.py @@ -0,0 +1,2 @@ +for cell in design.cells: + print(cell.first) -- cgit v1.2.3 From b0e66d441cf584e7e48049d4f07afcc8e743309a Mon Sep 17 00:00:00 2001 From: David Shah Date: Thu, 7 Jun 2018 12:57:52 +0200 Subject: Global design object working Signed-off-by: David Shah --- python/dump_design.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'python/dump_design.py') 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)) -- cgit v1.2.3