R
Ron Smith
Guest
The verilog spec does not define any limits on the value for the
replication operator in concatenation.
So is the following well behaved?
{0{1'b1}};
The real intent of this is to support the following:
parameter WIDE=5; // instantiation parameter between 1 and 16
wire [WIDE-1:0] mywire;
wire [15:0] otherwire;
wire [31:0] mybus;
assign mybus={otherwire,{16-WIDE{1'b0}},mywire};
If you make mywire its maximum width, it does not need any zero padding,
so this should degenerate to a zero width bus, i.e. nothing.
I wrote a test case, and it *seems* to work, but its a long way between
working verilog and working silicon... So I want to see if anybody has
done this successfully through the entire tool chain.
replication operator in concatenation.
So is the following well behaved?
{0{1'b1}};
The real intent of this is to support the following:
parameter WIDE=5; // instantiation parameter between 1 and 16
wire [WIDE-1:0] mywire;
wire [15:0] otherwire;
wire [31:0] mybus;
assign mybus={otherwire,{16-WIDE{1'b0}},mywire};
If you make mywire its maximum width, it does not need any zero padding,
so this should degenerate to a zero width bus, i.e. nothing.
I wrote a test case, and it *seems* to work, but its a long way between
working verilog and working silicon... So I want to see if anybody has
done this successfully through the entire tool chain.