L
Lee
Guest
I'm fairly new to verilog having worked in VHDL for many years. I have
a question regarding the usage of a multi dimensional array in the list
of signals after the always @.
If I define a memory structure:
parameter Width = 8;
reg [2:0] mem [Width-1:0];
Then attempt to use that in some code:
always @ (mem) begin
for (i=0, i<Width, i=i+1) begin
sig1 <= | mem;
end
end
If I full specify all the elements of the mem signal in the always line
it compiles fine. However that defeats the purpose of using the
parameter. If I use it like it is written above it errors out.
always @ (mem[0] or mem[1] or mem[2] ....
Any suggestions? Thanks.
Lee.
a question regarding the usage of a multi dimensional array in the list
of signals after the always @.
If I define a memory structure:
parameter Width = 8;
reg [2:0] mem [Width-1:0];
Then attempt to use that in some code:
always @ (mem) begin
for (i=0, i<Width, i=i+1) begin
sig1 <= | mem;
end
end
If I full specify all the elements of the mem signal in the always line
it compiles fine. However that defeats the purpose of using the
parameter. If I use it like it is written above it errors out.
always @ (mem[0] or mem[1] or mem[2] ....
Any suggestions? Thanks.
Lee.