问题
would an always
block with no sensitivity list infer a combinational logic, just the same as always_comb
or always @(*)
? Eg code:
always begin
if (sig_a)begin
@(posedge sig_b); // wait for a sig_b posedge event
@(negedge sig_b); // then wait for a sig_b negedge event
event_true=1;
end
if (event_true)begin
@((sig_c==1)&&(sig_a==0)); //wait for sig_a to deassert and sig_c assert event to be true
yes =1;
end
else yes =0;
end
回答1:
Synthesis tools require a specific template coding style to synthesize your code. Most only allow a single explicit event control ar the beginning of an always
block. Some of the higher-level synthesis tools that do allow multiple event controls only allow multiple occurrences of the same clock edge.
Simulation tools don't have these restrictions and will try to execute whatever legal syntax you can compile. BTW, your @((sig_c==1)&&(sig_a==0))
means wait for the expression to change value, not wait for it to become true. The wait(expr)
construct means wait for the expression to become true.
来源:https://stackoverflow.com/questions/53362188/verilog-always-block-with-no-sensitivity-list