Re: [myhdl-list] debugging Cosimulation with Icarus Verilog
Brought to you by:
jandecaluwe
|
From: Jan D. <ja...@ja...> - 2008-08-07 10:49:34
|
Günter Dannoritzer wrote: > Hi Jan, > > I took some time to look into the error I am getting when doing > cosimulation with Icarus Verilog. The first test that fails in the > myhdl/test/conversion/toVerilog folder is test1 in the > test_always_comb.py file. > > The design is the following: > > def design1(a, b, p): > def logic(): > p.next = a | b > return always_comb(logic) > > > What causes the exception, which stops the simulation is that p returns > the value 'x'. I traced the problem down and it has to do with the > change_callback() function in the myhdl.c file. It fires too early, > already at time step 0. Comparing that with Cver, the change_callback() > function only fires at time step 2. > > Now, the change_callback() function is registered in the > to_myhdl_calltf() function. To avoid having the change_callback() > function trigger already in time step 0, wouldn't it make sense to > register it in the first readonly_callback() function. That way it would > make sure that it does not fire in time step 0? Guenter: I won't have time in the coming weeks to look at this in much detail. However, some quick comments: Based on previous experience, I'm quite reluctant to make big changes. Given that cver works with the method as implemented, I'm inclined to think that in principle Icarus should behave the same it Icarus vpi is done properly. I do see a difference that may be significant between the two files: // icarus stops on the following line but shouldn't // cb_data_s.value = &value_s; cb_data_s.value = NULL; while setting up the callback you mention. Apparently I had an unexpected problem with Icarus here that I didn't have with cver. This may explain the issue, I'm not sure. As a first attempt, I would try if the original line still breaks things with recent Icarus releases. If it does, I would contact the Icarus developer to check whether this qualifies as a bug. Jan -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Kaboutermansstraat 97, B-3000 Leuven, Belgium |