While passing the dynamic variable member as port in generate for loop instantiation,
int clk[];
initial begin
N=clk.size();
end
initial begin
clk=new[4];
end
always @(*) begin
clk[0]=clk0_out;
clk[1]=clk1_out;
clk[2]=clk2_out;
clk[3]=clk3_out;
end
genvar i;
generate
for(i=0;i<N;i=i+1) begin: monitor_call
clock_mon cm1(.clock(clk[i]),.reset(reset));
end
endgenerate
following errors occurred:
- Illegal non-constant generate loop condition.
- A member of a dynamic variable (clk) is not allowed as a port actual.
While passing static array as port inside generate loop instantiation, there were no such errors. Why is there problems with dynamic array?
Can't they be used inside generate loop? If not, what is the alternative for the same as I want to instantiate the module 'n' times?