Re: [myhdl-list] Global state and multiple instances
Brought to you by:
jandecaluwe
From: Henry G. <he...@ca...> - 2015-05-07 14:33:23
|
On 07/05/15 15:10, Henry Gomersall wrote: > The other problem is the state on a Signal object is not being handled > properly. I tried to implement the solution for this (currently > commented out in _simulator.py) in which on each context switch, the > signals are stashed (using _Signal._stash_state) to the context that is > being departed, and then the signal state is reloaded when it is > reentered (susing _Signal._recall_state). The tests begin to work and > then one gets into an infinite loop because some waiter or other is > missing. I'm not sure quite what I've missed. This is hard to bug > isolate because the tests all run in isolation or indeed, in their > respective test classes. I was wrong, all the tests actually seem to run with no error. The problem is that the overhead when the signal list becomes large is huge and really affects the simulation time. This can be dealt with with a bit of thought I'm sure. Most of the time, nothing is changed, so the Signal does not need to be stashed. I've pushed the changes with the full code. Oh, btw, it _should_ be thread safe, due to using thread local storage, but I haven't verified this. Cheers, Henry |