Altera_Forum
Honored Contributor
12 years agoBasic Verilog questions: sequential execution within a procedural block
Code1:always @ (*) begin
<delay1> out1 =/<= a && b; end always @ (*) begin <delay2> out2 =/<= c || d; end always @(*) begin <delay3> final_out =/<= out1 || out2; end Code 2:always @ (*) begin <delay1> out1 =/<= a && b; <delay2> out2 =/<= c || d; <delay3> final_out =/<= out1 || out2; end Observations: 1. When delay = 0; code 2 behaves the same way as code 1. 2. When you put a delay value, Code 2 != Code 1, this is because within a process between begin and end, all statements are sequential. That means final_out does not get evaluated after <delay3> but instead it takes <delay1> + <delay2> + <delay3>. This does not happen in real hardware. My question: 1. I have never come across any verilog material that mentions this point why is that? 2. What is the right structure ?