I want to run several simulations (e.g for different instances or the same instance with different parameters) from one main script.
So I have a function:
def test(inst,**kwagrs): inst.config_sim(**kwagrs) inst.run_sim() inst.quit_sim()
Than I can call test with a block instance like this:
It works, but only when the last test call has Trace=True set and all others are false.
If want to trace several simulation runs the following errors haben:
When there is a run with trace=False after a run with trace=True I get
File "/usr/local/lib/python2.7/dist-packages/myhdl/_Signal.py", line 333, in _printVcdBit print("%d%s" % (self._val, self._code), file=sim._tf)
When I have more than one run with Trace=True, all but the first vcd file are corrupted.
I have not analyzed the vcd in detail (I’m not really familiar with the format), but what I noticed is that tokens are not uniqure anymore in corrupted traces (see reset and shift_right below):
$scope module tb_barrel_shift_pipelined $end $var reg 1 ! reset $end $var reg 1 " fill_i $end $var reg 1 # clock $end $var reg 1 ! shift_right $end $var reg 5 $ shift_in $end $var reg 1 % ready_o $end $var reg 32 & d_o $end $var reg 1 ' en_i $end $var reg 32 ( d_in $end $scope module ClkDriver0_0 $end
I assume that something is not reinitialized correctly with sim.quit().
I have also taken a look into the code of traceSignals and Simulation, but I could not see any easy to identify problem