Event driven Verilog simulations

  • Thread starter Thread starter lostinxlation
  • Start date Start date
  • Tags Tags
    Simulations
AI Thread Summary
In event-driven Verilog simulations, the behavior of signals like wires and regs is crucial for understanding state maintenance. The wire `inv_s1` does not retain a value between events; it reflects the current state of its driving source, which in this case is the inverted input `in`. When `in` changes, `inv_s1` updates accordingly, but once the event settles, it has no stored state until the next event occurs. At the specified simulation time of #25, `inv_s1` would reflect the value of `in` at that moment, which would be 1, as it changes from 0 to 1 and back to 0 during the simulation. Thus, `inv_s1` does not maintain a persistent state like a reg does.
lostinxlation
Messages
38
Reaction score
0
I know Veriog simulators are event-driven and what matters is the moment that event happens.

Suppose we have a code like,

module inv (in, out);
input in;
output out;

wire inv_s1;
reg out;
assign inv_s1 = ~in;
assign out = ~inv_s1;

endmodule

My question is does inv_s1 maintains any state between the events ?
Let's say in=0 initially, and it gets changed to in=1. It propagates through inv_s1 and changes the state of 'out'. 'out' is declared as reg so that it maintains some state all the time, but what happens to inv_s1 which is declared as wire once the event settles ?
Does it still maintain the value 0, or it has no value or state assigned till the next event happens ?

More specifically, what value am I supposed to see on inv_s1 if I poke inv_s1 at #25 in the following simulation ?

initial begin
#10 in = 0;
#10 in = 1;
#10 in = 0;
#10 $finish;
end
 
Engineering news on Phys.org
Verilog is a time-based simulation. Therefore, it must recognize state.
 
Thread 'Weird near-field phenomenon I get in my EM simulation'
I recently made a basic simulation of wire antennas and I am not sure if the near field in my simulation is modeled correctly. One of the things that worry me is the fact that sometimes I see in my simulation "movements" in the near field that seems to be faster than the speed of wave propagation I defined (the speed of light in the simulation). Specifically I see "nodes" of low amplitude in the E field that are quickly "emitted" from the antenna and then slow down as they approach the far...
Hello dear reader, a brief introduction: Some 4 years ago someone started developing health related issues, apparently due to exposure to RF & ELF related frequencies and/or fields (Magnetic). This is currently becoming known as EHS. (Electromagnetic hypersensitivity is a claimed sensitivity to electromagnetic fields, to which adverse symptoms are attributed.) She experiences a deep burning sensation throughout her entire body, leaving her in pain and exhausted after a pulse has occurred...
Back
Top