stanford
Full Member level 2
RTL Always block styles
I've seen RTL implementations where
1. Only sequential always block is used, always@(posedge clk), with assign statements for combinational logic
2. Comb and sequential always block is used, always@(*) and always@(posedge clk) to separate the comb and seq logic
I have two questions:
a) Seeing that the same logic can be coded in two different ways, why is 2. more preferred than the other? Seems like 1. option is easier to code and read.
b) Why does FSM using 1) style work? (I thought we aren't supposed to use combinational and sequential logic in the same always block.)
Thanks!
I've seen RTL implementations where
1. Only sequential always block is used, always@(posedge clk), with assign statements for combinational logic
2. Comb and sequential always block is used, always@(*) and always@(posedge clk) to separate the comb and seq logic
I have two questions:
a) Seeing that the same logic can be coded in two different ways, why is 2. more preferred than the other? Seems like 1. option is easier to code and read.
b) Why does FSM using 1) style work? (I thought we aren't supposed to use combinational and sequential logic in the same always block.)
Thanks!
Last edited: