Skip to content

Commit

Permalink
Use Simulation.add_testbench for i2c tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedcharles committed Jan 19, 2025
1 parent 5e719a4 commit 4269972
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 84 deletions.
7 changes: 5 additions & 2 deletions software/glasgow/gateware/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class GatewareBuildError(Exception):
pass


def simulation_test(case=None, **kwargs):
def simulation_test(case=None, testbench=False, **kwargs):
def configure_wrapper(case):
@functools.wraps(case)
def wrapper(self):
Expand All @@ -25,7 +25,10 @@ def setup_wrapper():
sim = Simulator(self.tb)
with sim.write_vcd("test.vcd"):
sim.add_clock(1e-8)
sim.add_sync_process(setup_wrapper)
if testbench:
sim.add_testbench(setup_wrapper)
else:
sim.add_sync_process(setup_wrapper)
sim.run()
return wrapper

Expand Down
Loading

0 comments on commit 4269972

Please sign in to comment.