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,8 +417,11 @@ class Simulator:
hierarchy = {} hierarchy = {}
def add_fragment(fragment, scope=()): def add_fragment(fragment, scope=()):
hierarchy[fragment] = scope hierarchy[fragment] = scope
for subfragment, name in fragment.subfragments: for index, (subfragment, name) in enumerate(fragment.subfragments):
add_fragment(subfragment, (*scope, name)) if name is None:
add_fragment(subfragment, (*scope, "#{}".format(index)))
else:
add_fragment(subfragment, (*scope, name))
add_fragment(root_fragment) add_fragment(root_fragment)
def add_signal(signal): def add_signal(signal):