How to prevent the "Blocking assignments (=) in sequential (flop or latch) block" warning for temporary variables
Hi all:
Sometimes it is handy to use a temporary variable like this:
int counter = 0;
always @(posedge clk)
begin
int tmp = counter + 1; // Or something more complicated.
$display( "New value: %d", tmp ); // Use tmp once.
counter <= tmp; // Use tmp once again.
end;
However, Verilator issues this warning for the temporary variable:
%Warning-BLKSEQ: /home/blah/blah.v:123: Blocking assignments (=) in sequential (flop or latch) block; suggest delayed assignments (<=).
Is there a way to prevent this warning without resorting to Verilator-specific pragmas in the source code?
Many thanks, R. Diez
Replies (2)
RE: How to prevent the "Blocking assignments (=) in sequential (flop or latch) block" warning for temporary variables - Added by Wilson Snyder 4 months ago
Do you always declare a local variable for this? It seems safe to suppress in that case; otherwise I'm not sure how not to suppress real mistakes (= instead of <=).
RE: How to prevent the "Blocking assignments (=) in sequential (flop or latch) block" warning for temporary variables - Added by Wilson Snyder 4 months ago
Fixed in git towards 3.832.
(1-2/2)
![[logo]](/img/veripool_small.png)