07-16-2017 08:07 PM
One customer wants to use $unsigned in "generate for "
parameter[31:0] BITDEPTH = 32'd8;
wire [31:0] i_interleaved_mtree;
reg [31:0] i_mux_pattern;
reg [31:0] node_0;
reg [31:0] node_1;
reg [31:0] node_2;
reg [31:0] node_3;
generate for( i = 0; $unsigned(i) < BITDEPTH; i = i + 1) begin : b3
assign i_interleaved_mtree[i*3+0] = i_mux_pattern ? node_1[i] :
assign i_interleaved_mtree[i*3+1] = i_mux_pattern ? node_2[i] :
assign i_interleaved_mtree[i*3+2] = i_mux_pattern ? node_3[i] :
but will get "[Synth 8-2722] system function call unsigned is not allowed here." error message.
Is there any option in Vivado will support this syntax ?
07-16-2017 08:47 PM - edited 07-16-2017 08:59 PM
In my opinion the question is not clear because the generate variable genvar (in this case 'i') is already a natural, positive number. So what would be the need of applying $unsigned typecast to a positive integer?
08-02-2017 08:46 PM
@a_chami 1800-2012 says: "The genvar is used as an integer during elaboration" so it's not a natural number (ie non-negative).