why does iverilog generate a syntax error for alwaysff?

The syntax is correct for SystemVerilog, but it is not supported for all iverilog versions. From the Release Notes of Icarus Verilog 11

The following SystemVerilog language features are now supported:

the always_comb, always_ff, and always_latch constructs

If you are not using this version, you should upgrade.

Your code compiles on other simulators on edaplayground.

Alternately, you don’t need to use always_ff. You can still use always:

  always @(posedge clk) begin
    out <= 1'b1;
  end

I changed your assignment to nonblocking (<=), which is recommended for sequential logic.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top