mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
No longer forcing CSRReadValM because that can feedback to corrupt some CSRs
This commit is contained in:
parent
0646bf2b90
commit
28fed18421
@ -33,6 +33,7 @@ add wave -noupdate -radix hexadecimal /testbench/dut/hart/ieu/dp/ALUResultE
|
|||||||
add wave -noupdate -divider M
|
add wave -noupdate -divider M
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/ifu/PCM
|
add wave -noupdate -radix hexadecimal /testbench/dut/hart/ifu/PCM
|
||||||
add wave -noupdate /testbench/InstrMName
|
add wave -noupdate /testbench/InstrMName
|
||||||
|
add wave -noupdate /testbench/textM
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/ifu/InstrM
|
add wave -noupdate -radix hexadecimal /testbench/dut/hart/ifu/InstrM
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/ieu/c/InstrValidM
|
add wave -noupdate -radix hexadecimal /testbench/dut/hart/ieu/c/InstrValidM
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/lsu/dcache/MemPAdrM
|
add wave -noupdate -radix hexadecimal /testbench/dut/hart/lsu/dcache/MemPAdrM
|
||||||
@ -114,77 +115,76 @@ add wave -noupdate -group EBU /testbench/dut/hart/ebu/NextBusState
|
|||||||
add wave -noupdate -divider W
|
add wave -noupdate -divider W
|
||||||
add wave -noupdate -radix hexadecimal /testbench/PCW
|
add wave -noupdate -radix hexadecimal /testbench/PCW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/ieu/c/InstrValidW
|
add wave -noupdate -radix hexadecimal /testbench/dut/hart/ieu/c/InstrValidW
|
||||||
|
add wave -noupdate /testbench/textM
|
||||||
add wave -noupdate /testbench/dut/hart/ieu/dp/ReadDataW
|
add wave -noupdate /testbench/dut/hart/ieu/dp/ReadDataW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/ieu/dp/ResultW
|
add wave -noupdate -radix hexadecimal /testbench/dut/hart/ieu/dp/ResultW
|
||||||
add wave -noupdate -divider RegFile
|
add wave -noupdate -group RF /testbench/dut/hart/ieu/dp/RegWriteW
|
||||||
add wave -noupdate /testbench/dut/hart/ieu/dp/RegWriteW
|
add wave -noupdate -group RF -radix unsigned /testbench/dut/hart/ieu/dp/RdW
|
||||||
add wave -noupdate -radix unsigned /testbench/dut/hart/ieu/dp/RdW
|
add wave -noupdate -group RF /testbench/dut/hart/ieu/dp/regf/wd3
|
||||||
add wave -noupdate /testbench/dut/hart/ieu/dp/regf/wd3
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[2]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[2]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[3]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[3]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[4]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[4]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[5]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[5]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[6]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[6]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[7]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[7]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[8]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[8]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[9]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[9]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[10]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[10]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[11]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[11]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[12]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[12]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[13]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[13]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[14]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[14]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[15]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[15]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[16]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[16]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[17]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[17]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[18]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[18]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[19]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[19]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[20]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[20]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[21]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[21]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[22]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[22]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[23]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[23]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[24]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[24]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[25]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[25]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[26]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[26]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[27]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[27]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[28]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[28]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[29]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[29]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[30]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[30]}
|
add wave -noupdate -group RF -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[31]}
|
||||||
add wave -noupdate -radix hexadecimal {/testbench/dut/hart/ieu/dp/regf/rf[31]}
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/MSTATUS_REGW
|
||||||
add wave -noupdate -divider CSRs
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/MCOUNTINHIBIT_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/MSTATUS_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/MCOUNTEREN_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/MCOUNTINHIBIT_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csri/MIDELEG_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/MCOUNTEREN_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csri/MIP_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csri/MIDELEG_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csri/MIE_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csri/MIP_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/MEPC_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csri/MIE_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/MTVEC_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/MEPC_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/MCOUNTEREN_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/MTVEC_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/MCOUNTINHIBIT_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/MCOUNTEREN_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/MEDELEG_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/MCOUNTINHIBIT_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/MIDELEG_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/MEDELEG_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/MSCRATCH_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/MIDELEG_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/MCAUSE_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/MSCRATCH_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/MTVAL_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/MCAUSE_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/SSTATUS_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/MTVAL_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/SCOUNTEREN_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/SSTATUS_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csri/SIP_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/SCOUNTEREN_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csri/SIE_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csri/SIP_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrs/SEPC_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csri/SIE_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrs/STVEC_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrs/SEPC_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrs/SCOUNTEREN_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrs/STVEC_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrs/SEDELEG_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrs/SCOUNTEREN_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrs/SIDELEG_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrs/SEDELEG_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrs/SATP_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrs/SIDELEG_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/USTATUS_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrs/SATP_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrn/UEPC_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/USTATUS_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrn/UTVEC_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrn/UEPC_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrn/UIP_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrn/UTVEC_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrn/UIE_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrn/UIP_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/PMPCFG_ARRAY_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrn/UIE_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/PMPADDR_ARRAY_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/PMPCFG_ARRAY_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/MISA_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/PMPADDR_ARRAY_REGW
|
add wave -noupdate -group CSR -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csru/FRM_REGW
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csrm/MISA_REGW
|
|
||||||
add wave -noupdate -radix hexadecimal /testbench/dut/hart/priv/csr/genblk1/csru/FRM_REGW
|
|
||||||
add wave -noupdate -divider <NULL>
|
add wave -noupdate -divider <NULL>
|
||||||
add wave -hex -r /testbench/*
|
add wave -hex -r /testbench/*
|
||||||
TreeUpdate [SetDefaultTree]
|
TreeUpdate [SetDefaultTree]
|
||||||
|
@ -265,13 +265,13 @@ module testbench();
|
|||||||
end
|
end
|
||||||
// override on special conditions
|
// override on special conditions
|
||||||
if (ExpectedMemAdrM == 'h10000005) begin
|
if (ExpectedMemAdrM == 'h10000005) begin
|
||||||
//$display("%tns, %d instrs: Overwriting read data from CLINT.", $time, InstrCountW);
|
//$display("%tns, %d instrs: Overwriting read data from CLINT.", $time, InstrCountW);
|
||||||
force dut.hart.ieu.dp.ReadDataM = ExpectedMemReadDataM;
|
force dut.hart.ieu.dp.ReadDataM = ExpectedMemReadDataM;
|
||||||
end
|
end
|
||||||
if(textM.substr(0,5) == "rdtime") begin
|
if(textM.substr(0,5) == "rdtime") begin
|
||||||
$display("%tns, %d instrs: Overwrite read value of CSR on read of MTIME in memory stage.", $time, InstrCountW);
|
$display("%tns, %d instrs: Overwrite MTIME_CLINT on read of MTIME in memory stage.", $time, InstrCountW);
|
||||||
force dut.hart.priv.csr.CSRReadValM = ExpectedRegValueM;
|
force dut.uncore.clint.clint.MTIME = ExpectedRegValueM;
|
||||||
//dut.hart.ieu.dp.regf.wd3
|
//dut.hart.ieu.dp.regf.wd3
|
||||||
end
|
end
|
||||||
|
|
||||||
end // if (checkInstrM)
|
end // if (checkInstrM)
|
||||||
@ -291,74 +291,73 @@ module testbench();
|
|||||||
ExpectedMemWriteDataW <= '0;
|
ExpectedMemWriteDataW <= '0;
|
||||||
ExpectedMemReadDataW <= '0;
|
ExpectedMemReadDataW <= '0;
|
||||||
NumCSRW <= '0;
|
NumCSRW <= '0;
|
||||||
end
|
end else if(~dut.hart.StallW) begin
|
||||||
else if(~dut.hart.StallW) begin
|
|
||||||
if(dut.hart.FlushW) begin
|
if(dut.hart.FlushW) begin
|
||||||
ExpectedPCW <= '0;
|
ExpectedPCW <= '0;
|
||||||
ExpectedInstrW <= '0;
|
ExpectedInstrW <= '0;
|
||||||
textW <= "";
|
textW <= "";
|
||||||
RegWriteW <= "";
|
RegWriteW <= "";
|
||||||
ExpectedRegAdrW <= '0;
|
ExpectedRegAdrW <= '0;
|
||||||
ExpectedRegValueW <= '0;
|
ExpectedRegValueW <= '0;
|
||||||
ExpectedMemAdrW <= '0;
|
ExpectedMemAdrW <= '0;
|
||||||
MemOpW <= "";
|
MemOpW <= "";
|
||||||
ExpectedMemWriteDataW <= '0;
|
ExpectedMemWriteDataW <= '0;
|
||||||
ExpectedMemReadDataW <= '0;
|
ExpectedMemReadDataW <= '0;
|
||||||
NumCSRW <= '0;
|
NumCSRW <= '0;
|
||||||
end else begin
|
end else begin
|
||||||
ExpectedPCW <= ExpectedPCM;
|
ExpectedPCW <= ExpectedPCM;
|
||||||
ExpectedInstrW <= ExpectedInstrM;
|
ExpectedInstrW <= ExpectedInstrM;
|
||||||
textW <= textM;
|
textW <= textM;
|
||||||
RegWriteW <= RegWriteM;
|
RegWriteW <= RegWriteM;
|
||||||
ExpectedRegAdrW <= ExpectedRegAdrM;
|
ExpectedRegAdrW <= ExpectedRegAdrM;
|
||||||
ExpectedRegValueW <= ExpectedRegValueM;
|
ExpectedRegValueW <= ExpectedRegValueM;
|
||||||
ExpectedMemAdrW <= ExpectedMemAdrM;
|
ExpectedMemAdrW <= ExpectedMemAdrM;
|
||||||
MemOpW <= MemOpM;
|
MemOpW <= MemOpM;
|
||||||
ExpectedMemWriteDataW <= ExpectedMemWriteDataM;
|
ExpectedMemWriteDataW <= ExpectedMemWriteDataM;
|
||||||
ExpectedMemReadDataW <= ExpectedMemReadDataM;
|
ExpectedMemReadDataW <= ExpectedMemReadDataM;
|
||||||
NumCSRW <= NumCSRM;
|
NumCSRW <= NumCSRM;
|
||||||
for(NumCSRWIndex = 0; NumCSRWIndex < NumCSRM; NumCSRWIndex++) begin
|
for(NumCSRWIndex = 0; NumCSRWIndex < NumCSRM; NumCSRWIndex++) begin
|
||||||
ExpectedCSRArrayW[NumCSRWIndex] = ExpectedCSRArrayM[NumCSRWIndex];
|
ExpectedCSRArrayW[NumCSRWIndex] = ExpectedCSRArrayM[NumCSRWIndex];
|
||||||
ExpectedCSRArrayValueW[NumCSRWIndex] = ExpectedCSRArrayValueM[NumCSRWIndex];
|
ExpectedCSRArrayValueW[NumCSRWIndex] = ExpectedCSRArrayValueM[NumCSRWIndex];
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
// override on special conditions
|
// override on special conditions
|
||||||
#1;
|
#1;
|
||||||
|
|
||||||
|
|
||||||
if(~dut.hart.StallW) begin
|
if(~dut.hart.StallW) begin
|
||||||
if(textM.substr(0,5) == "rdtime") begin
|
if(textW.substr(0,5) == "rdtime") begin
|
||||||
$display("%tns, %d instrs: Releasing force of CSRReadValM.", $time, InstrCountW);
|
$display("%tns, %d instrs: Releasing force of MTIME_CLINT.", $time, InstrCountW);
|
||||||
release dut.hart.priv.csr.CSRReadValM;
|
release dut.uncore.clint.clint.MTIME;
|
||||||
//release dut.hart.ieu.dp.regf.wd3;
|
//release dut.hart.ieu.dp.regf.wd3;
|
||||||
end
|
end
|
||||||
|
|
||||||
if (ExpectedMemAdrM == 'h10000005) begin
|
|
||||||
//$display("%tns, %d instrs: releasing force of ReadDataM.", $time, InstrCountW);
|
|
||||||
release dut.hart.ieu.dp.ReadDataM;
|
|
||||||
end
|
|
||||||
|
|
||||||
// force interrupts to 0
|
|
||||||
for(NumCSRMIndex = 0; NumCSRMIndex < NumCSRM; NumCSRMIndex++) begin
|
|
||||||
if(ExpectedCSRArrayM[NumCSRMIndex].substr(1, 5) == "cause" && (ExpectedCSRArrayValueM[NumCSRMIndex][`XLEN-1] == 1'b1)) begin
|
|
||||||
//what type?
|
|
||||||
ExpectedIntType = ExpectedCSRArrayValueM[NumCSRM] & 64'h0000_000C;
|
|
||||||
$display("%tns, %d instrs: CSR = %s. Forcing interrupt of cause = %x back to 0", $time, InstrCountW, ExpectedCSRArrayM[NumCSRM], ExpectedCSRArrayValueM[NumCSRM]);
|
|
||||||
|
|
||||||
if(ExpectedIntType == 0) begin
|
if (ExpectedMemAdrM == 'h10000005) begin
|
||||||
force dut.hart.priv.SwIntM = 1'b0;
|
//$display("%tns, %d instrs: releasing force of ReadDataM.", $time, InstrCountW);
|
||||||
$display("Force SwIntM");
|
release dut.hart.ieu.dp.ReadDataM;
|
||||||
end
|
end
|
||||||
else if(ExpectedIntType == 4) begin
|
|
||||||
force dut.hart.priv.TimerIntM = 1'b0;
|
// force interrupts to 0
|
||||||
$display("Force TimeIntM");
|
for(NumCSRMIndex = 0; NumCSRMIndex < NumCSRM; NumCSRMIndex++) begin
|
||||||
end
|
if(ExpectedCSRArrayM[NumCSRMIndex].substr(1, 5) == "cause" && (ExpectedCSRArrayValueM[NumCSRMIndex][`XLEN-1] == 1'b1)) begin
|
||||||
else if(ExpectedIntType == 8) begin
|
//what type?
|
||||||
force dut.hart.priv.ExtIntM = 1'b0;
|
ExpectedIntType = ExpectedCSRArrayValueM[NumCSRM] & 64'h0000_000C;
|
||||||
$display("Force ExtIntM");
|
$display("%tns, %d instrs: CSR = %s. Forcing interrupt of cause = %x back to 0", $time, InstrCountW, ExpectedCSRArrayM[NumCSRM], ExpectedCSRArrayValueM[NumCSRM]);
|
||||||
|
|
||||||
|
if(ExpectedIntType == 0) begin
|
||||||
|
force dut.hart.priv.SwIntM = 1'b0;
|
||||||
|
$display("Force SwIntM");
|
||||||
end
|
end
|
||||||
end
|
else if(ExpectedIntType == 4) begin
|
||||||
end
|
force dut.hart.priv.TimerIntM = 1'b0;
|
||||||
|
$display("Force TimeIntM");
|
||||||
|
end
|
||||||
|
else if(ExpectedIntType == 8) begin
|
||||||
|
force dut.hart.priv.ExtIntM = 1'b0;
|
||||||
|
$display("Force ExtIntM");
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user