sim.pysim: use "bench" as a top level root for testbench signals.
Fixes #561.
This commit is contained in:
parent
810c19dde4
commit
538c14116c
|
@ -19,7 +19,7 @@ class _NameExtractor:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.names = SignalDict()
|
self.names = SignalDict()
|
||||||
|
|
||||||
def __call__(self, fragment, *, hierarchy=("top",)):
|
def __call__(self, fragment, *, hierarchy=("bench", "top",)):
|
||||||
def add_signal_name(signal):
|
def add_signal_name(signal):
|
||||||
hierarchical_signal_name = (*hierarchy, signal.name)
|
hierarchical_signal_name = (*hierarchy, signal.name)
|
||||||
if signal not in self.names:
|
if signal not in self.names:
|
||||||
|
@ -74,7 +74,7 @@ class _VCDWriter:
|
||||||
trace_names = SignalDict()
|
trace_names = SignalDict()
|
||||||
for trace in traces:
|
for trace in traces:
|
||||||
if trace not in signal_names:
|
if trace not in signal_names:
|
||||||
trace_names[trace] = {("top", trace.name)}
|
trace_names[trace] = {('bench', trace.name)}
|
||||||
self.traces.append(trace)
|
self.traces.append(trace)
|
||||||
|
|
||||||
if self.vcd_writer is None:
|
if self.vcd_writer is None:
|
||||||
|
|
|
@ -74,6 +74,7 @@ Toolchain changes
|
||||||
* Added: :meth:`build.BuildPlan.execute_remote_ssh`.
|
* Added: :meth:`build.BuildPlan.execute_remote_ssh`.
|
||||||
* Deprecated: :class:`test.utils.FHDLTestCase`, with no replacement.
|
* Deprecated: :class:`test.utils.FHDLTestCase`, with no replacement.
|
||||||
* Deprecated: :func:`back.rtlil.convert()` and :func:`back.verilog.convert()` without an explicit `ports=` argument.
|
* Deprecated: :func:`back.rtlil.convert()` and :func:`back.verilog.convert()` without an explicit `ports=` argument.
|
||||||
|
* Changed: VCD output now uses a top-level "bench" module that contains testbench only signals.
|
||||||
|
|
||||||
|
|
||||||
Platform integration changes
|
Platform integration changes
|
||||||
|
|
|
@ -849,7 +849,7 @@ class SimulatorRegressionTestCase(FHDLTestCase):
|
||||||
pass
|
pass
|
||||||
sim = Simulator(dut)
|
sim = Simulator(dut)
|
||||||
with self.assertRaisesRegex(NameError,
|
with self.assertRaisesRegex(NameError,
|
||||||
r"^Signal 'top\.name with space_state' contains a whitespace character$"):
|
r"^Signal 'bench\.top\.name with space_state' contains a whitespace character$"):
|
||||||
with open(os.path.devnull, "w") as f:
|
with open(os.path.devnull, "w") as f:
|
||||||
with sim.write_vcd(f):
|
with sim.write_vcd(f):
|
||||||
sim.run()
|
sim.run()
|
||||||
|
|
Loading…
Reference in a new issue