From 3c0b0987d21f0c8a9282a6d2b3a6ca70b65e6dd3 Mon Sep 17 00:00:00 2001 From: bbracker Date: Sat, 23 Oct 2021 13:17:30 -0700 Subject: [PATCH] add option for regression to do a partial execution of buildroot --- .../regression/regression-wally.py | 33 ++++++++++++------- .../regression/sim-buildroot-batch | 3 +- .../regression/wally-buildroot-batch.do | 2 +- wally-pipelined/testbench/testbench-linux.sv | 14 +++++--- 4 files changed, 33 insertions(+), 19 deletions(-) diff --git a/wally-pipelined/regression/regression-wally.py b/wally-pipelined/regression/regression-wally.py index a997c2a7..bd703a01 100755 --- a/wally-pipelined/regression/regression-wally.py +++ b/wally-pipelined/regression/regression-wally.py @@ -10,6 +10,7 @@ # output. # ################################## +import sys from collections import namedtuple TestCase = namedtuple("TestCase", ['name', 'cmd', 'grepstr']) @@ -23,22 +24,22 @@ TestCase = namedtuple("TestCase", ['name', 'cmd', 'grepstr']) # edit this list to add more test cases configs = [ - #TestCase( - # name="busybear", - # cmd="vsim -do wally-busybear-batch.do -c > {}", - # grepstr="loaded 100000 instructions" - #), - TestCase( - name="buildroot", - cmd="vsim -do wally-buildroot-batch.do -c > {}", - grepstr="6300000 instructions" - ), TestCase( name="lints", cmd="./lint-wally &> {}", grepstr="All lints run with no errors or warnings" - ), + ) ] +def getBuildrootTC(short): + INSTR_LIMIT = 100000 # multiple of 100000 + MAX_EXPECTED = 6.3e6 + if short: + BRcmd="vsim > {} -c < {} -c < 10000) ? INSTR_LIMIT-10000 : 1; // # of instructions at which to turn on waves in graphical sim + string ProgramAddrMapFile, ProgramLabelMapFile; /////////////////////////////////////////////////////////////////////////////// @@ -343,10 +345,12 @@ module testbench(); // always check PC, instruction bits if (checkInstrW) begin InstrCountW += 1; - // turn on waves at certain point - if (InstrCountW == waveOnICount) $stop; // print progress message if (InstrCountW % 'd100000 == 0) $display("Reached %d instructions", InstrCountW); + // turn on waves + if (InstrCountW == INSTR_WAVEON) $stop; + // end sim + if ((InstrCountW == INSTR_LIMIT) && (INSTR_LIMIT!=0)) $stop; fault = 0; if (`DEBUG_TRACE >= 1) begin `checkEQ("PCW",PCW,ExpectedPCW) @@ -423,8 +427,8 @@ module testbench(); initial begin $readmemh({`LINUX_TEST_VECTORS,"bootmem.txt"}, dut.uncore.bootdtim.bootdtim.RAM, 'h1000 >> 3); $readmemh({`LINUX_TEST_VECTORS,"ram.txt"}, dut.uncore.dtim.RAM); - $readmemb(`TWO_BIT_PRELOAD, dut.hart.ifu.bpred.bpred.Predictor.DirPredictor.PHT.memory); - $readmemb(`BTB_PRELOAD, dut.hart.ifu.bpred.bpred.TargetPredictor.memory.memory); + $readmemb(`TWO_BIT_PRELOAD, dut.hart.ifu.bpred.bpred.Predictor.DirPredictor.PHT.mem); + $readmemb(`BTB_PRELOAD, dut.hart.ifu.bpred.bpred.TargetPredictor.memory.mem); ProgramAddrMapFile = {`LINUX_TEST_VECTORS,"vmlinux.objdump.addr"}; ProgramLabelMapFile = {`LINUX_TEST_VECTORS,"vmlinux.objdump.lab"}; end