Re: [myhdl-list] Setting "sig.next" before starting the simulation
Brought to you by:
jandecaluwe
From: Nick P. <np...@in...> - 2003-10-05 20:30:36
|
On Sun, Oct 05, 2003 at 09:55:58PM +0200, Jan Decaluwe wrote: > Nick Patavalis wrote: > > The confusion can be avoided by only accessing 'next' > attributes after Simulation construction. My implicit > HDL-inspired assumption is even that this should only > happen after starting the simulation. This is easily > implemented by only accessing a signal's 'next' > attribute within generators registered with the Simulation. > My intention was for it to be possible to control the "debugging" behavior of blocks, *while* the simulation is running (f.e. when a complex system enters a certain state, then a special block that monitors this enables the "debugging" controls of other blocks). Of course in the simplest case I would like to be able to *initialize* the debugging signals before starting the simulation, without having a special block for this. What I'm looking for is a way to set initial signal values at a post-construction, but pre-simulation time. Why doesn't sim.run() or the Simulation() construction simply set "sig.val = sig.next" before starting? This would allow one to do things like: sig = Signal(bool(0)) sig.next = 1 which would be *functionally identical* to: sig = Signal(bool(0)) sig.val = 1 without having to make "val" writable. To state it differently what I would like to do, is: A function creates some signals, instantiates some blocks, and connects them to the signals. Obviously the signals have some default initial values. The function then returns the instances (the generators) and the signals (some of them) to the caller. The caller changes the *initial values* of some of the signals returned to it, and starts the simulation. From what you say this isn't possible. /npat -- Mathematics belongs to God. -- Donald E. Knuth |