aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-12-27 11:19:45 +0000
committerGitHub <noreply@github.com>2019-12-27 11:19:45 +0000
commit4e0ca50db137eb9d10098582be607c98601f8375 (patch)
tree7dd586694d7c3bca458502f3e6d677da1a6954b3 /python
parentb6e2159cecdf79d0d94d0e6a9dda8cef6389cac1 (diff)
parent5774b13984bb151909b90ee2c668bdfb08387a2b (diff)
downloadnextpnr-4e0ca50db137eb9d10098582be607c98601f8375.tar.gz
nextpnr-4e0ca50db137eb9d10098582be607c98601f8375.tar.bz2
nextpnr-4e0ca50db137eb9d10098582be607c98601f8375.zip
Merge pull request #353 from YosysHQ/generic-frontend
New hierarchy-capable generic frontend framework and json11 based JSON frontend
Diffstat (limited to 'python')
-rw-r--r--python/report_hierarchy.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/python/report_hierarchy.py b/python/report_hierarchy.py
new file mode 100644
index 00000000..6d409a9b
--- /dev/null
+++ b/python/report_hierarchy.py
@@ -0,0 +1,10 @@
+def visit(indent, data):
+ istr = " " * indent
+ print("{}{}: {}".format(istr, data.name, data.type))
+ for lname, gname in data.leaf_cells:
+ print("{} {} -> {}".format(istr, lname, gname))
+ for lname, gname in data.hier_cells:
+ visit(indent + 4, ctx.hierarchy[gname])
+
+visit(0, ctx.hierarchy[ctx.top_module])
+