C
chip algernon
Guest
Can someone tell me why some synthesis tool (synopsys, simplicity) can
not correctly pass the parameter in case <A>, <B> and <C> to
sub_module?
synopsys can only pass parameter in case <B>, but failed in <A> and
<C>
simplicity failed on <C>.
thanks in advance!
Chip
// ---------------------- example starts here -------------------//
module my_sub_module (in, clk, rstbar, out);
parameter SIZER = 1;
parameter INIT = {32{1'b0}};
input clk, rstbar;
input [SIZER-1:0] in;
output [SIZER-1:0] out;
reg [SIZER-1:0] out;
always @(posedge clk or negedge rstbar)
if (~rstbar)
out <= INIT[SIZER-1:0];
else
out <= in;
endmodule
// ---------------------------------------------------------------------
module top (clk, rstbar, in1, out1, out2, out3);
input clk, rstbar;
input [3:0] in1;
output [3:0] out1, out2, out3;
parameter PASS_PARAM = 32'hFFFF_FFFF;
//<A>
my_sub_module #(4, PASS_PARAM) my_sub_module_0
(.in(in1), .clk(clk), .rstbar(rstbar), .out(out1));
//<B>
my_sub_module #(4, 4294967295) my_sub_module_1
(.in(in1), .clk(clk), .rstbar(rstbar), .out(out2));
//<C>
my_sub_module #(4, PASS_PARAM[3:0]) my_sub_module_2
(.in(in1), .clk(clk), .rstbar(rstbar), .out(out3));
endmodule // top
not correctly pass the parameter in case <A>, <B> and <C> to
sub_module?
synopsys can only pass parameter in case <B>, but failed in <A> and
<C>
simplicity failed on <C>.
thanks in advance!
Chip
// ---------------------- example starts here -------------------//
module my_sub_module (in, clk, rstbar, out);
parameter SIZER = 1;
parameter INIT = {32{1'b0}};
input clk, rstbar;
input [SIZER-1:0] in;
output [SIZER-1:0] out;
reg [SIZER-1:0] out;
always @(posedge clk or negedge rstbar)
if (~rstbar)
out <= INIT[SIZER-1:0];
else
out <= in;
endmodule
// ---------------------------------------------------------------------
module top (clk, rstbar, in1, out1, out2, out3);
input clk, rstbar;
input [3:0] in1;
output [3:0] out1, out2, out3;
parameter PASS_PARAM = 32'hFFFF_FFFF;
//<A>
my_sub_module #(4, PASS_PARAM) my_sub_module_0
(.in(in1), .clk(clk), .rstbar(rstbar), .out(out1));
//<B>
my_sub_module #(4, 4294967295) my_sub_module_1
(.in(in1), .clk(clk), .rstbar(rstbar), .out(out2));
//<C>
my_sub_module #(4, PASS_PARAM[3:0]) my_sub_module_2
(.in(in1), .clk(clk), .rstbar(rstbar), .out(out3));
endmodule // top