From a8e8cfb83837f815ae84af376f688a8ae2c2dfa9 Mon Sep 17 00:00:00 2001 From: bbracker Date: Tue, 1 Mar 2022 03:11:43 +0000 Subject: [PATCH] switch linux-testbench infrastructure over to new linux testvectors at /opt/riscv --- pipelined/config/buildroot/wally-config.vh | 1 - pipelined/regression/regression-wally | 8 ++--- pipelined/regression/sim-buildroot | 2 +- pipelined/regression/sim-buildroot-batch | 7 ++--- pipelined/regression/wally-pipelined-batch.do | 2 +- pipelined/regression/wally-pipelined.do | 2 +- pipelined/testbench/testbench-linux.sv | 30 ++++++++++++------- 7 files changed, 28 insertions(+), 24 deletions(-) diff --git a/pipelined/config/buildroot/wally-config.vh b/pipelined/config/buildroot/wally-config.vh index de6c910d..7644eb1a 100644 --- a/pipelined/config/buildroot/wally-config.vh +++ b/pipelined/config/buildroot/wally-config.vh @@ -30,7 +30,6 @@ `define FPGA 1 `define QEMU 1 `define LINUX_FIX_READ {'h10000005} -`define LINUX_TEST_VECTORS "../../tests/linux-testgen/linux-testvectors/" // RV32 or RV64: XLEN = 32 or 64 `define XLEN 64 diff --git a/pipelined/regression/regression-wally b/pipelined/regression/regression-wally index 17782b9d..63088afb 100755 --- a/pipelined/regression/regression-wally +++ b/pipelined/regression/regression-wally @@ -48,19 +48,19 @@ def getBuildrootTC(short): INSTR_LIMIT = 100000 # multiple of 100000 MAX_EXPECTED = 246000000 if short: - BRcmd="vsim > {} -c < {} -c < {} -c < {} -c < {} -c < {} -c <> 3); + $sformat(testvectorDir,"%s/linux-testvectors/",RISCV_DIR); + $sformat(linuxImageDir,"%s/buildroot/output/images/",RISCV_DIR); $readmemb(`TWO_BIT_PRELOAD, dut.core.ifu.bpred.bpred.Predictor.DirPredictor.PHT.mem); $readmemb(`BTB_PRELOAD, dut.core.ifu.bpred.bpred.TargetPredictor.memory.mem); - ProgramAddrMapFile = {`LINUX_TEST_VECTORS,"vmlinux.objdump.addr"}; - ProgramLabelMapFile = {`LINUX_TEST_VECTORS,"vmlinux.objdump.lab"}; + ProgramAddrMapFile = {linuxImageDir,"vmlinux.objdump.addr"}; + ProgramLabelMapFile = {linuxImageDir,"vmlinux.objdump.lab"}; + // initialize bootrom + memFile = $fopen({testvectorDir,"bootmem.bin"}, "rb"); + readResult = $fread(dut.uncore.bootrom.bootrom.RAM,memFile); + $fclose(memFile); + // initialize RAM + memFile = $fopen({testvectorDir,"ram.bin"}, "rb"); + readResult = $fread(dut.uncore.ram.ram.RAM,memFile); + $fclose(memFile); if (CHECKPOINT==0) begin // normal - $readmemh({`LINUX_TEST_VECTORS,"ram.txt"}, dut.uncore.ram.ram.RAM); - traceFileM = $fopen({`LINUX_TEST_VECTORS,"all.txt"}, "r"); - traceFileE = $fopen({`LINUX_TEST_VECTORS,"all.txt"}, "r"); + traceFileM = $fopen({testvectorDir,"all.txt"}, "r"); + traceFileE = $fopen({testvectorDir,"all.txt"}, "r"); InstrCountW = '0; end else begin // checkpoint $sformat(checkpointDir,"checkpoint%0d/",CHECKPOINT); - checkpointDir = {`LINUX_TEST_VECTORS,checkpointDir}; + checkpointDir = {testvectorDir,checkpointDir}; //$readmemh({checkpointDir,"ram.txt"}, dut.uncore.ram.ram.RAM); - ramFile = $fopen({checkpointDir,"ram.bin"}, "rb"); - readResult = $fread(dut.uncore.ram.ram.RAM,ramFile); - $fclose(ramFile); traceFileE = $fopen({checkpointDir,"all.txt"}, "r"); traceFileM = $fopen({checkpointDir,"all.txt"}, "r"); InstrCountW = CHECKPOINT;