Using a verilated module multiple times
Added by Christian Leber about 2 years ago
Hello, i would like to use the same verilated design multiple times in a network simulation.
Just to be sure. Will that work with just instantiating multiple objects with new?
Given that i get the rest of my simulator properly working multithreaded, can i eval() the different instances at once?
Thanks for verilator, I think it will be great to speed up my research!
Christian
Replies (2)
RE: Using a verilated module multiple times - Added by Wilson Snyder about 2 years ago
Will that work with just instantiating multiple objects with new?
Absolutely, do it all the time.
Given that i get the rest of my simulator properly working multithreaded, can i eval() the >different instances at once?
I haven't tried recently, but it should be easy enough to fix anything that breaks. The cautions are you need to -DVL_THREADED, make sure your interface code doesn't set any I/O to the submodules until the right point, and of course make sure that any shared routines are reenterant (no problem for logic, but beware $display which uses printf).
However, if you're trying to make a networked simulation, I've always made multiple processes/threads and pipeline the results between them - IE have a FIFO of X entries between the sims. This then allows each to get slightly ahead or behind the others without stalling and is thus much faster; you can even use multiple machines.
Let me know how it goes.
RE: Using a verilated module multiple times - Added by Wilson Snyder about 2 years ago
Should have added I assume you're using C++, not SystemC. I don't know of any thread safe SystemC implementation/patches.
(1-2/2)
![[logo]](/img/veripool_small.png)