forked from Github_Repos/cvw
fix multiple-context PLIC checkpoint generation
This commit is contained in:
parent
d33de3ef6b
commit
6f6663cd67
@ -101,7 +101,7 @@ with open(outDir+'checkpoint-PLIC_INT_PRIORITY', 'w') as outFile:
|
|||||||
outFile.write(stripZeroes(word[2:])+'\n')
|
outFile.write(stripZeroes(word[2:])+'\n')
|
||||||
with open(outDir+'checkpoint-PLIC_INT_ENABLE', 'w') as outFile:
|
with open(outDir+'checkpoint-PLIC_INT_ENABLE', 'w') as outFile:
|
||||||
for word in plicIntEnableArray:
|
for word in plicIntEnableArray:
|
||||||
outFile.write(word+'\n')
|
outFile.write(stripZeroes(word)+'\n')
|
||||||
with open(outDir+'checkpoint-PLIC_THRESHOLD', 'w') as outFile:
|
with open(outDir+'checkpoint-PLIC_THRESHOLD', 'w') as outFile:
|
||||||
for word in plicIntPriorityThresholdArray:
|
for word in plicIntPriorityThresholdArray:
|
||||||
outFile.write(stripZeroes(word[2:])+'\n')
|
outFile.write(stripZeroes(word[2:])+'\n')
|
||||||
|
@ -266,6 +266,19 @@ module testbench;
|
|||||||
end \
|
end \
|
||||||
end
|
end
|
||||||
|
|
||||||
|
`define INIT_CHECKPOINT_PACKED_ARRAY(SIGNAL,DIM,ARRAY_MAX,ARRAY_MIN) \
|
||||||
|
`MAKE_CHECKPOINT_INIT_SIGNAL(SIGNAL,DIM,ARRAY_MAX,ARRAY_MIN) \
|
||||||
|
for (i=ARRAY_MIN; i<ARRAY_MAX+1; i=i+1) begin \
|
||||||
|
initial begin \
|
||||||
|
if (CHECKPOINT!=0) begin \
|
||||||
|
force `SIGNAL[i] = init``SIGNAL[i]; \
|
||||||
|
while (reset!==1) #1; \
|
||||||
|
while (reset!==0) #1; \
|
||||||
|
#1; \
|
||||||
|
release `SIGNAL[i]; \
|
||||||
|
end \
|
||||||
|
end \
|
||||||
|
end
|
||||||
// For the annoying case where the pathname to the array elements includes
|
// For the annoying case where the pathname to the array elements includes
|
||||||
// a "genblk<i>" in the signal name
|
// a "genblk<i>" in the signal name
|
||||||
`define INIT_CHECKPOINT_GENBLK_ARRAY(SIGNAL_BASE,SIGNAL,DIM,ARRAY_MAX,ARRAY_MIN) \
|
`define INIT_CHECKPOINT_GENBLK_ARRAY(SIGNAL_BASE,SIGNAL,DIM,ARRAY_MAX,ARRAY_MIN) \
|
||||||
@ -296,6 +309,7 @@ module testbench;
|
|||||||
end \
|
end \
|
||||||
end
|
end
|
||||||
|
|
||||||
|
genvar i;
|
||||||
`INIT_CHECKPOINT_SIMPLE_ARRAY(RF, [`XLEN-1:0],31,1);
|
`INIT_CHECKPOINT_SIMPLE_ARRAY(RF, [`XLEN-1:0],31,1);
|
||||||
`INIT_CHECKPOINT_SIMPLE_ARRAY(HPMCOUNTER, [`XLEN-1:0],`COUNTERS-1,0);
|
`INIT_CHECKPOINT_SIMPLE_ARRAY(HPMCOUNTER, [`XLEN-1:0],`COUNTERS-1,0);
|
||||||
`INIT_CHECKPOINT_VAL(PC, [`XLEN-1:0]);
|
`INIT_CHECKPOINT_VAL(PC, [`XLEN-1:0]);
|
||||||
@ -333,9 +347,9 @@ module testbench;
|
|||||||
//`INIT_CHECKPOINT_VAL(UART_LSR, [7:0]);
|
//`INIT_CHECKPOINT_VAL(UART_LSR, [7:0]);
|
||||||
//`INIT_CHECKPOINT_VAL(UART_MSR, [7:0]);
|
//`INIT_CHECKPOINT_VAL(UART_MSR, [7:0]);
|
||||||
`INIT_CHECKPOINT_VAL(UART_SCR, [7:0]);
|
`INIT_CHECKPOINT_VAL(UART_SCR, [7:0]);
|
||||||
`INIT_CHECKPOINT_SIMPLE_ARRAY(PLIC_INT_PRIORITY, [2:0],`PLIC_NUM_SRC,1);
|
`INIT_CHECKPOINT_PACKED_ARRAY(PLIC_INT_PRIORITY, [2:0],`PLIC_NUM_SRC,1);
|
||||||
`INIT_CHECKPOINT_SIMPLE_ARRAY(PLIC_INT_ENABLE, [`PLIC_NUM_SRC:1],1,0);
|
`INIT_CHECKPOINT_PACKED_ARRAY(PLIC_INT_ENABLE, [`PLIC_NUM_SRC:1],1,0);
|
||||||
`INIT_CHECKPOINT_SIMPLE_ARRAY(PLIC_THRESHOLD, [2:0],1,0);
|
`INIT_CHECKPOINT_PACKED_ARRAY(PLIC_THRESHOLD, [2:0],1,0);
|
||||||
|
|
||||||
integer memFile;
|
integer memFile;
|
||||||
integer readResult;
|
integer readResult;
|
||||||
|
Loading…
Reference in New Issue
Block a user