C
Chris F Clark
Guest
I just want to verify my reading of the standard(s). First, here is
the illegal module. Next, are two corrected versions that implement
the module writer's intent.
-Chris
module m( port[param: 0] ) // illegal line, param not defined yet
parameter param = 1;
input [param: 0] port;
wire [param: 0] port;
endmodule
////////////////////////////////////////////////////////////
// This is a legal 1995 style version of the code
module m( port )
parameter param = 1;
input [param: 0] port;
wire [param: 0] port;
endmodule
////////////////////////////////////////////////////////////
// This is a legal 2001 style version of the code
module m
#(parameter param = 1)
( input [param: 0] port )
endmodule
the illegal module. Next, are two corrected versions that implement
the module writer's intent.
-Chris
module m( port[param: 0] ) // illegal line, param not defined yet
parameter param = 1;
input [param: 0] port;
wire [param: 0] port;
endmodule
////////////////////////////////////////////////////////////
// This is a legal 1995 style version of the code
module m( port )
parameter param = 1;
input [param: 0] port;
wire [param: 0] port;
endmodule
////////////////////////////////////////////////////////////
// This is a legal 2001 style version of the code
module m
#(parameter param = 1)
( input [param: 0] port )
endmodule