chip algernon
Guest
Tue Mar 09, 2004 11:01 pm
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
fabbl
Guest
Fri Mar 12, 2004 6:18 pm
Chip,
Try posting this on comp.arch.fpga and comp.lang.vhdl also.
fabbl
"chip algernon" <whyalgernon_at_hotmail.com> wrote in message
news:87c9d883.0403091501.191df137_at_posting.google.com...
Quote:
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
Amit Gupta
Guest
Fri Mar 19, 2004 7:10 pm
Hi,
The paramater value you are using is outside the scope of a signed 32
bit integer. What you need to confirm from Verilog-LRM (and what I think
is happening here..) .. paramter values are read in a signed-32 bit
integer by the compiler and you are having an over-flow in that value read.
In your case, reading a value 0xffffffff using a signed-32bit integer
will result in an overflow and different compiler will probably behave
with unpredicatble results.
--Amit
chip algernon wrote:
Quote:
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