A
Allan Herriman
Guest
Hi,
I'm trying to do something like this:
wire [3:0] foo;
generate
genvar i;
for (i=0; i<16; i=i+1) begin : label
bar u1 (
.baz({foo,i}) // here
)
end
endgenerate
and at 'here' I would like to use the value of the genvar i, but with
a defined width (4 in this case) instead of 32 bits, such that the
concatenation {foo,i} is 8 bits wide.
Does anyone know how I can do this? I tried a bunch of things, but
none of them worked, either because they are illegal in Verilog, or
because the tools didn't support them.
BTW, changing the module 'bar' isn't an option.
Oh, any solution must work in the current version of XST.
Thanks,
Allan
I'm trying to do something like this:
wire [3:0] foo;
generate
genvar i;
for (i=0; i<16; i=i+1) begin : label
bar u1 (
.baz({foo,i}) // here
)
end
endgenerate
and at 'here' I would like to use the value of the genvar i, but with
a defined width (4 in this case) instead of 32 bits, such that the
concatenation {foo,i} is 8 bits wide.
Does anyone know how I can do this? I tried a bunch of things, but
none of them worked, either because they are illegal in Verilog, or
because the tools didn't support them.
BTW, changing the module 'bar' isn't an option.
Oh, any solution must work in the current version of XST.
Thanks,
Allan