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.
 
While I was rolling out a shielded cable, a though came to my mind - what happens to the current flow in the cable if there came a short between the wire and the shield in both ends of the cable? For simplicity, lets assume a 1-wire copper wire wrapped in an aluminum shield. The wire and the shield has the same cross section area. There are insulating material between them, and in both ends there is a short between them. My first thought, the total resistance of the cable would be reduced...
Hey guys. I have a question related to electricity and alternating current. Say an alien fictional society developed electricity, and settled on a standard like 73V AC current at 46 Hz. How would appliances be designed, and what impact would the lower frequency and voltage have on transformers, wiring, TVs, computers, LEDs, motors, and heating, assuming the laws of physics and technology are the same as on Earth?
Hi all I have some confusion about piezoelectrical sensors combination. If i have three acoustic piezoelectrical sensors (with same receive sensitivity in dB ref V/1uPa) placed at specific distance, these sensors receive acoustic signal from a sound source placed at far field distance (Plane Wave) and from broadside. I receive output of these sensors through individual preamplifiers, add them through hardware like summer circuit adder or in software after digitization and in this way got an...
Back
Top