Always / Initial Blocks (Procedural Assignments)
1. initial
- each 'initial' blocks executes concurrently starting at time 0.
- executes only 'once' and does not execute again.
module system;
reg a, b, c, d; // single statement
initial a = 1'b0; // time 0 : power ON
initial begin
b = 1'b1;
#5 c = 1'b0;
#10 d = 1'b0;
end
initial #20 $finish;
endmodule
2. always
- each 'always' blocks executes concurrently starting at time 0.
- executes continuously in a looping fashion.
- Modeling a digital circuits.
module clk_gen // 1. frequency 2. duty ratio 3. infinite
#(parameter period = 50)
(
output reg clk
);
initial clk = 1'b0;
always
#(period/2) clk = ~clk; // 0 = ~0, delay #25
initial #100 $finish;
endmodule
Procedural Assignment Types.
1. Blocking
-
2. Non-Blocking
'[Harman] 반도체 설계 > Quartus' 카테고리의 다른 글
Quartus II project - Simple Uart Rx. (0) | 2023.08.16 |
---|---|
Quartus II Project - Falling Edge Detection. (0) | 2023.08.15 |
Quartus II project - notes [1] (0) | 2023.08.12 |
Quartus II project - Simple Uart Tx. (0) | 2023.08.12 |
Quartus II Project - fnd counter (2) | 2023.08.11 |