wittman
Newbie level 2
Hi
I want to check if "N" bits bus are all logic 1 and assign to the "pass" signal. The
bus width is variable and is defined by parameter N. But I get the "nonconstant index"
error message. How can I fix this issue?
Any help would be greatly appreciated!
I want to check if "N" bits bus are all logic 1 and assign to the "pass" signal. The
bus width is variable and is defined by parameter N. But I get the "nonconstant index"
error message. How can I fix this issue?
Any help would be greatly appreciated!
Code:
parameter N;//2~64
integer i;
reg [(N*N)-1 : 0] status;
reg [N-1:0] pass;
//pass[0] is for status[N-1:0], pass[1] is for status[(2*N)-1 : N] ... ,etc
always @(status)
for(i=0;i<=N-1;i=i+1)
pass[i] = & status[N-1+(i*N) : (i*N)];