nervecell_23
Member level 1
- Joined
- Apr 26, 2013
- Messages
- 38
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Activity points
- 1,565
Here's the snippet of the code:
DUT is an array of RAM blocks. I tried to compare the entries in the blocks with a truth table. Compile failed reporting the error: Index value in hierarchical path is not constant. Please suggest whether I can use the for loop to do what I tried to do in the code?
DUT is an array of RAM blocks. I tried to compare the entries in the blocks with a truth table. Compile failed reporting the error: Index value in hierarchical path is not constant. Please suggest whether I can use the for loop to do what I tried to do in the code?
Code:
integer i, j;
initial
begin
@(checkData);
for(i=0;i<60;i=i+1)
begin
for(j=0;j<187;j=j+1)
begin
@(negedge ge_clk);
force dut.memory_inst.arraygen[i].memory.rden = 1;
force dut.memory_inst.arraygen[i].memory.address = j;
@(negedge ge_clk);
force dut.memory_inst.arraygen[i].memory.rden = 0;
@(posedge ge_clk);
#1
if(dut.memory_inst.arraygen[i].memory.q != truethTable[i*187+j])
$display("Result does not match: i=%d, j=%d",i,j);
-> stopSim;
end
end
release dut.memory_inst.arraygen[i].memory.rden;
release dut.memory_inst.arraygen[i].memory.address;
end