pyverilator icon indicating copy to clipboard operation
pyverilator copied to clipboard

test_pyverilator_finish_2_same_files fails

Open acw1251 opened this issue 5 years ago • 0 comments

The test test_pyverilator_finish_2_same_files (https://github.com/csail-csg/pyverilator/blob/master/pyverilator/tests/test_pyverilator.py#L633-L692) fails because sim_1 and sim_2 both load the same shared object and the verilator gotFinish uses a global variable to track if the simulator has finished. Once one finishes, both sims see gotFinish to be true.

There are three possible solutions:

  1. Produce uniquely named so files for each sim
  2. Make copies of so files whenever they are opened.
  3. Use dlmopen to open a copy of the shared object (see the dlmopen branch https://github.com/csail-csg/pyverilator/tree/dlmopen)

I got the dlmopen solution working, but its messy, and I don't know if it will work on other machines. I'll think about this problem more before making any changes.

acw1251 avatar Mar 06 '20 18:03 acw1251