gen/fhdl/verilog: Ensure top is not None to build hierarchy.
This commit is contained in:
parent
862a0dbbbf
commit
4610713797
|
@ -90,13 +90,16 @@ def _generate_timescale(time_unit="1ns", time_precision="1ps"):
|
||||||
# ------------------------------------------------------------------------------------------------ #
|
# ------------------------------------------------------------------------------------------------ #
|
||||||
|
|
||||||
def _generate_hierarchy(top):
|
def _generate_hierarchy(top):
|
||||||
hierarchy_explorer = LiteXHierarchyExplorer(top=top, depth=None, with_colors=False)
|
if top is None:
|
||||||
r = "/*\n"
|
return ""
|
||||||
for l in hierarchy_explorer.get_hierarchy().split("\n"):
|
else:
|
||||||
r += l + "\n"
|
hierarchy_explorer = LiteXHierarchyExplorer(top=top, depth=None, with_colors=False)
|
||||||
r = r[:-1]
|
r = "/*\n"
|
||||||
r += "*/\n"
|
for l in hierarchy_explorer.get_hierarchy().split("\n"):
|
||||||
return r
|
r += l + "\n"
|
||||||
|
r = r[:-1]
|
||||||
|
r += "*/\n"
|
||||||
|
return r
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------------------------ #
|
# ------------------------------------------------------------------------------------------------ #
|
||||||
# RESERVED KEYWORDS #
|
# RESERVED KEYWORDS #
|
||||||
|
|
Loading…
Reference in New Issue