14.2. Sequential and Parallel Blocks
​
Within procedural blocks (initial or always), Verilog provides two mechanisms to control the execution flow of multiple statements: sequential blocks using begin-end and parallel blocks using fork-join.
​
14.2.1. Sequential Blocks (begin-end)
​
Characteristics
​
-
Statements execute SEQUENTIALLY, one after another
​
-
Delays are CUMULATIVE
​
-
Each statement must complete before the next begins
​
-
Most common in synthesis and testbenches
​
-
Can be named for debugging purposes
​
Syntax
Verilog
Timing in Sequential Blocks
Verilog
Timing Diagram:
.png)
Practical Examples
Example 1: Clock Generation
Verilog
Example 2: Test Stimulus Sequence
Verilog
14.2.2. Parallel Blocks (fork-join)
Characteristics
-
Statements execute CONCURRENTLY (in parallel)
-
Delays are RELATIVE to the start of the fork block
-
All statements begin at the same time
-
Block completes when ALL statements complete
-
NOT synthesizable - testbench only
Syntax
Verilog
Timing in Parallel Blocks
Verilog
Timing Diagram:
.png)
Practical Examples
​
Example: Multiple Concurrent Stimuli
Verilog
14.2.3. Comparison: Sequential vs Parallel
.png)
Mixed Example
Verilog
