From: whitequark Date: Fri, 21 Dec 2018 12:29:33 +0000 (+0000) Subject: back.pysim: give numeric names to unnamed subfragments in VCD. X-Git-Tag: working~161 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7ae7683fed84a434ee1c6aaa7a9cd7320f814cfb;p=nmigen.git back.pysim: give numeric names to unnamed subfragments in VCD. --- diff --git a/nmigen/back/pysim.py b/nmigen/back/pysim.py index 2d86d0a..bd90d7a 100644 --- a/nmigen/back/pysim.py +++ b/nmigen/back/pysim.py @@ -417,8 +417,11 @@ class Simulator: hierarchy = {} def add_fragment(fragment, scope=()): hierarchy[fragment] = scope - for subfragment, name in fragment.subfragments: - add_fragment(subfragment, (*scope, name)) + 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) def add_signal(signal):