File: report_hierarchy.py

package info (click to toggle)
nextpnr 0.10-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 40,064 kB
  • sloc: cpp: 176,747; python: 18,011; ansic: 10,558; pascal: 1,367; sh: 383; makefile: 223; vhdl: 44; objc: 42; tcl: 41
file content (10 lines) | stat: -rw-r--r-- 313 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
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])