[libre-riscv-dev] Tests in soc/fu
Yehowshua
yimmanuel3 at gatech.edu
Sat Jun 20 16:56:43 BST 2020
Michael and I were discussing about unit tests.
I recently realized its possible to maintain simulator
state while popping on more unit tests.
You can do the following as many times as you want:
```python3
sim.add_sync_process(process1)
sim.run()
sim.add_sync_process(process2)
sim.run()
sim.add_sync_process(process3)
sim.run()
```
This comes in handy when running many very
short tests on an rtl unit. You no longer have
to rebuild the simulator for each test.
Currently, we have some hacky code that
tries to accomplish preserving states between units.
I have released part of my thesis with an example
of how to structure a unit test in this manner:
https://github.com/BracketMaster/MAERIV6/blob/master/tests/test_heuristic/test_multleave.py#L98
Pretty low priority, but at some point, it may be worth
revising older unit tests.
Certainly, new unit tests from now on would
benefit from this structure.
And Luke, my apologies for all this code, some on GIthub
some in SOC. I’ll try to be more intentional on this.
Still transitioning to making LibreSOC my main commitment.
Yehowshua
More information about the libre-riscv-dev
mailing list