[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  Schedule::Load
  SVN::S4
  Synopsys-modes
  SystemPerl
  Verilog-Pli
  Voneline
  Vregs
General Info
  Papers

How to prevent the "Blocking assignments (=) in sequential (flop or latch) block" warning for temporary variables

Added by R. Diez 4 months ago

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 <=).

(1-2/2)