Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Simulation.add_testbench for i2c tests. #733

Merged
merged 1 commit into from
Feb 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions software/glasgow/gateware/__init__.py
Original file line number Diff line number Diff line change
@@ -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):
@@ -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

Loading