Clarifying Verilog constructs: parallel/sequential blocks and blocking/non-blocking assignments
3:52:00 PM
1. Sequential block with blocking assignments
The statements in a sequential block are processed in the order they are specified. A statement is executed only after its preceding statement completes execution. If delay or event control is specified, it is relative to the simulation time when the previous statement in the block completed execution.
2. Sequential block with non-blocking assignments
If no regular delays are specified then the right-hand expressions of all non-blocking statements are evaluated then the assignments are performed according to intra-assignment delays. If regular delay controls are specified then the execution order of non-blocking assignments is defined by regular delay controls.
3. Parallel block with blocking assignments
In case of parallel blocks all the statements start to execute at time 0. However the
sequence of statements is still being taken into account. That is the variables used in each succeeding statement take the values assigned to them in preceding statements.
4. Parallel block with non-blocking assignments
In this case all the statements start to execute at time 0 and the right-hand expressions of all statements are evaluated immediately provided that there are no regular delays. It means that the variables used in each succeeding statement does not take the values assigned to them in preceding statements.
So summarizing all these cases one can say that by blocking/non-blocking statements it is controlled whether the values of variables assigned to them in preceding statements are used in succeeding statements or not. And by the Sequential/Parallel blocks it is controlled whether the simulation time is relative to the time when previous statement completed it's execution or to the time when the
block was entered.
thanks to : http://www.edaboard.com/thread103924.html
The statements in a sequential block are processed in the order they are specified. A statement is executed only after its preceding statement completes execution. If delay or event control is specified, it is relative to the simulation time when the previous statement in the block completed execution.
2. Sequential block with non-blocking assignments
If no regular delays are specified then the right-hand expressions of all non-blocking statements are evaluated then the assignments are performed according to intra-assignment delays. If regular delay controls are specified then the execution order of non-blocking assignments is defined by regular delay controls.
3. Parallel block with blocking assignments
In case of parallel blocks all the statements start to execute at time 0. However the
sequence of statements is still being taken into account. That is the variables used in each succeeding statement take the values assigned to them in preceding statements.
4. Parallel block with non-blocking assignments
In this case all the statements start to execute at time 0 and the right-hand expressions of all statements are evaluated immediately provided that there are no regular delays. It means that the variables used in each succeeding statement does not take the values assigned to them in preceding statements.
So summarizing all these cases one can say that by blocking/non-blocking statements it is controlled whether the values of variables assigned to them in preceding statements are used in succeeding statements or not. And by the Sequential/Parallel blocks it is controlled whether the simulation time is relative to the time when previous statement completed it's execution or to the time when the
block was entered.
thanks to : http://www.edaboard.com/thread103924.html
0 comments