Skip to content

Commit 7ff2e44

Browse files
committed
back.rtlil: put hierarchy in module name instead of an attribute.
The attribute sees essentially no use and the information is much better served by putting it in the module name. In addition this means that the entire tree can be renamed simply by renaming the top module. Tools like GTKWave show the names of the instances, not the modules, so they are not affected by the longer names.
1 parent 797cffd commit 7ff2e44

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

amaranth/back/rtlil.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -820,11 +820,10 @@ def _convert_fragment(builder, fragment, name_map, hierarchy):
820820
else:
821821
return "\\{}".format(fragment.type), port_map
822822

823-
module_name = hierarchy[-1] or "anonymous"
823+
module_name = ".".join(name or "anonymous" for name in hierarchy)
824824
module_attrs = OrderedDict()
825825
if len(hierarchy) == 1:
826826
module_attrs["top"] = 1
827-
module_attrs["amaranth.hierarchy"] = ".".join(name or "anonymous" for name in hierarchy)
828827

829828
with builder.module(module_name, attrs=module_attrs) as module:
830829
compiler_state = _ValueCompilerState(module)

0 commit comments

Comments
 (0)