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

nmigen.sim._pyrtl: Add support for Assert/Assume #465

wants to merge 3 commits into
base: main
Choose a base branch


Copy link

@jeanthom jeanthom commented Aug 4, 2020

Fixes #427


  • Ensure that I'm generating gen_test the right way
  • Improve the exception message?
  • Add unit tests
  • Fix VCD
  • Use a different exception

Copy link
Contributor Author

jeanthom commented Aug 4, 2020

Should we have a separate exception type for simulation asserts?

@jeanthom jeanthom changed the title nmigen.sim._pyrtl: Add support for Assert nmigen.sim._pyrtl: Add support for Assert/Assume Aug 4, 2020
Copy link

This looks generally reasonable, let's discuss the UI aspects on the next meeting.

Copy link
Contributor Author

jeanthom commented Aug 5, 2020

Another issue I noticed:

/usr/lib64/python3.8/unittest/ ResourceWarning: unclosed file <_io.TextIOWrapper name='test_soc_continuous_memtest.vcd' mode='wt' encoding='UTF-8'>
ResourceWarning: Enable tracemalloc to get the object allocation traceback

FAIL: test_continuous_memtest (test_soc.SocTestCase)
Traceback (most recent call last):
  File "/home/jeanthomas/Documents/gram/gram/test/", line 223, in test_continuous_memtest
    runSimulation(soc, process, "test_soc_continuous_memtest.vcd")
  File "/home/jeanthomas/Documents/gram/gram/test/", line 25, in runSimulation
  File "/home/jeanthomas/Documents/nmigen/nmigen/sim/", line 382, in run
    while self.advance():
  File "/home/jeanthomas/Documents/nmigen/nmigen/sim/", line 371, in advance
  File "/home/jeanthomas/Documents/nmigen/nmigen/sim/", line 347, in _real_step
  File "<string>", line 987, in run
AssertionError: Assertion failed at /home/jeanthomas/Documents/gram/gram/phy/

The VCD file isn't closed properly. Not sure how we could fix this though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

Add support for Assert in simulation
2 participants