Skip to content

Commit

Permalink
Fix traces
Browse files Browse the repository at this point in the history
  • Loading branch information
tilk committed Sep 30, 2024
1 parent c847344 commit 7bb8f3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions transactron/testing/gtkw_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@


class _VCDWriterExt(_VCDWriter):
def __init__(self, fragment, *, vcd_file, gtkw_file, traces):
super().__init__(
fragment=fragment, vcd_file=vcd_file, gtkw_file=gtkw_file, traces=list(flatten_signals(traces))
)
def __init__(self, design, *, vcd_file, gtkw_file, traces):
super().__init__(design=design, vcd_file=vcd_file, gtkw_file=gtkw_file, traces=list(flatten_signals(traces)))
self._tree_traces = traces

def close(self, timestamp):
Expand Down Expand Up @@ -62,7 +60,7 @@ def gtkw_traces(traces):

@contextmanager
def write_vcd_ext(engine, vcd_file, gtkw_file, traces):
vcd_writer = _VCDWriterExt(engine._fragment, vcd_file=vcd_file, gtkw_file=gtkw_file, traces=traces)
vcd_writer = _VCDWriterExt(engine._design, vcd_file=vcd_file, gtkw_file=gtkw_file, traces=traces)
try:
engine._vcd_writers.append(vcd_writer)
yield Tick()
Expand Down
2 changes: 1 addition & 1 deletion transactron/testing/infrastructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def __init__(
# TODO: try to merge with Amaranth.
if isinstance(extra_signals, Callable):
extra_signals = extra_signals()
clocks = [d.clk for d in cast(Any, self)._fragment.domains.values()]
clocks = [d.clk for d in cast(Any, self)._design.fragment.domains.values()]

self.ctx = write_vcd_ext(
cast(Any, self)._engine,
Expand Down

0 comments on commit 7bb8f3d

Please sign in to comment.