Professional Documents
Culture Documents
Delays in Verilog
The time taken for changes to propagate through a module may lead to race conditions in other modules.
Some designs, such as high speed microprocessors, may have very tight timing requirements that must be met.
Types of Delays.
Propagation delay : Gate level modelling delay described below as: Rise Fall Min/Typ/Max values Turn-off
through the gate, and the time taken for the output to actually change state, according to input.
Rise delay
The rise delay is associated with a gate output transition to a 1 from another value(0,x,z).
i2);
Ex:
Fall delay
The fall delay is associated with a gate output transition to 0 from another state 1
Format: operation #( Rise_Val, fall_Val ) a1( out, i1, i2); Ex:-> and #(0 , 1 ) a1(out ,i1,i2);
// Rise=0 Fall=1 Turn-Off=0
Turn-off delay
The turn-off delay is associated with a gate output transition to the high impedance value(z) from another value(0,1,x).
Rise Delay Fall Delay Turn-Off Delay 0,x,z -> 1 1,x,z -> 0 0,1,x -> z
#'num'
In Verilog delays can be introduced with #'num' as in the examples below, where # is a special character to introduce delay, and 'num' is the number of ticks simulator should delay current statement execution.
#'num'
We can provide num value of different way by variable or/and parameter
Parameter
Note: # There is no way we could synthesize delays, but of course we can add delay to particular signals by adding buffers.
Dataflow Modelling
As dataflow modelling use the concept of signals or values
The delays are associated with the Net (e.g. a Wire) along which the value is transmitted
Delays values control the time between the change in a right hand side operand and when the new value is assigned to the left hand side. a = b; means ab
Dataflow Modelling
Since values can be assigned to a net in a number of ways, there are corresponding methods of specifying the appropriate delays.
// net delays
wire #10 out; assign out = in1 & in2; // the same effect as the following, generally preferable wire out; assign #10 out = in1 & in2;
19
ZERO DELAY
Zero delay is a method to ensure that a statement is executed last,after all other statements in that simulation time are execcuted. This is to to elminate race arround conditions. However if there are multiple zero delay statements,the order between them is nondeterministic. EX:#0 x=1
SEQENTIAL BLOCKS
The keywords begin and end are used to group statements into seqential blocks. A statement is executed only after its preceeding statement completes execution.
23
PARALLEL BLOCKS
Parallel blocks, specified by keywords fork and join,provide intresting simulation features. Statements in a parallel block are executed concurrently. Ordering of statements is controlled by delay or event control assigned to each statement.
25
Thank you