Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#891 Icarus not compliant with standard 200X for parameters

devel
closed-fixed
5
2012-05-18
2012-05-15
No

According with the Standard of Verilog, since Verilog 2001 and in Vorilog 2005 also the following module description is valid:

`timescale 1ns/100ps

module register #(
parameter integer MSB = 32
)
(
input rstn,
input clk,
input ce,
input [MSB-1:0] D,
output [MSB-1:0]Q, // Q is a reg since it is assigned in an always block
output [MSB-1:0] Q_
);

genvar i;
generate
for(i=0;i < MSB; i = i+1)
begin:muxer32
DFF r (.rstn(rstn), .clk(clk), .ce(ce), .D(D[i]), .Q(Q[i]), .Q_(Q_[i]));
end
endgenerate

endmodule

Although The Icarus compiler complains of the parameter, saying it is invalid. The case is: it is valid and correct, I'm synthesizing a MIPS design that contains the above description and for synplify it is ok.

Discussion

    • milestone: 896955 --> devel
     
  • I agree this is valid syntax. This also fails in current development, so I'm switching this report to development, as that is where it will be fixed first.

    As a temporary workaround, you can comment out the "integer" in the parameter declaration - providing you only ever assign integer values to MSB, the behaviour will be the same.

     
  • After a bit of a battle with yacc shift/reduce conflicts, I think I've found a way to fix this, so will take this bug.

     
    • assigned_to: nobody --> martinwhitaker
     
  • Ok,
    Great to hear that it can be fixed without major changes.

     
    • status: open --> closed-fixed
     
  • I've submitted patches on the patch tracker that fix this bug in both devel and v0.9.