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-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=305ee78eaf72e2bd6e2d58054b7a84bc7e4c2397;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):