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 From 6236a1042797be90224461adf23243e0bb16f2fe Mon Sep 17 00:00:00 2001 From: David Shah Date: Thu, 7 Jun 2018 13:08:18 +0200 Subject: Fixing file->run renaming Signed-off-by: David Shah --- python/dump_design.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python/dump_design.py') diff --git a/python/dump_design.py b/python/dump_design.py index b8436288..22d4ab17 100644 --- a/python/dump_design.py +++ b/python/dump_design.py @@ -1,4 +1,4 @@ -# Run ./nextpnr-ice40 --json ice40/blinky.json --file python/dump_design.py +# 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 port in sorted(cell.second.ports, key=lambda x: x.first): -- cgit v1.2.3