Constant expression in generated block index not recognized
The following code fails to recognize the constant expression used as index into an array of generated module instances:
function peek_bar; peek_bar = bar_inst[`START].i_bar.r; // this is ok peek_bar = bar_inst[`START + 1].i_bar.r; // this fails, should not. endfunction genvar g; generate for (g = `START; g < `END; g = g + 1) begin: bar_inst bar i_bar(.x (x[g]), .y (y[g]), .clk (clk)); end endgenerate
The error message is:
%Error: t/t_gen_index.v:49: Unsupported: Non-constant inside 's in the cell part of a dotted reference
Where line 49 corresponds to the function's use of
`START + 1 as an index to
I shall investigate further. In the meantime, please pull a test case from
#5 Updated by Julius Baxter about 1 year ago
I am also wondering if there is an update on this feature.
I'm more interested in the case of addressing members in arrays of structs. Perhaps there's a way to do this, will post to the forum and ask, but it's the same error, so maybe it's to do with the same internal mechanism.