back.pysim: give numeric names to unnamed subfragments in VCD.

This commit is contained in:
whitequark 2018-12-21 12:29:33 +00:00
parent af7db882c0
commit 7ae7683fed

View file

@ -417,7 +417,10 @@ class Simulator:
hierarchy = {}
def add_fragment(fragment, scope=()):
hierarchy[fragment] = scope
for subfragment, name in fragment.subfragments:
for index, (subfragment, name) in enumerate(fragment.subfragments):
if name is None:
add_fragment(subfragment, (*scope, "#{}".format(index)))
else:
add_fragment(subfragment, (*scope, name))
add_fragment(root_fragment)