From b1000870244dbb1a73198e23a859825865938b4c Mon Sep 17 00:00:00 2001 From: David Shah Date: Fri, 29 Nov 2019 16:25:11 +0000 Subject: python: Add bindings for hierarchy structures Signed-off-by: David Shah --- python/report_hierarchy.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 python/report_hierarchy.py (limited to 'python') 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]) + -- cgit v1.2.3