From 8baa2a350d06c126094fa8d1423fa32e6de3c09c Mon Sep 17 00:00:00 2001 From: Jarred Allen Date: Thu, 22 Apr 2021 13:29:55 -0400 Subject: [PATCH 1/2] Add buildroot to regression test --- .../regression/regression-wally.py | 71 ++++++++++++------- 1 file changed, 45 insertions(+), 26 deletions(-) diff --git a/wally-pipelined/regression/regression-wally.py b/wally-pipelined/regression/regression-wally.py index 83fa703eb..1ddf00a45 100755 --- a/wally-pipelined/regression/regression-wally.py +++ b/wally-pipelined/regression/regression-wally.py @@ -8,8 +8,35 @@ # ################################## -# edit this line to add more configurations -confignames = ["rv32ic", "rv64ic", "busybear"] +from collections import namedtuple +# name: the name of this test configuration/script +# cmd: the command to run to test (should include the logfile as {}) +# grepstr: the string to grep through the log file for, success iff grep finds that string +Config = namedtuple("Config", ['name', 'cmd', 'grepstr']) + +# edit this list to add more configurations +configs = [ + Config( + name="busybear", + cmd="vsim -do wally-busybear-batch.do -c > {}", + grepstr="# loaded 800000 instructions" + ), + Config( + name="buildroot", + cmd="vsim -do wally-buildroot-batch.do -c > {}", + grepstr="# loaded 100000 instructions" + ), + Config( + name="rv32ic", + cmd="vsim > {} -c < {} -c <" + logname - os.system(cmd) - # check for success. grep returns 0 if found, 1 if not found - passed = search_log_for_text("# loaded 800000 instructions", logname) - else: - # Any other configuration loads that name from the config folder and runs vsim - cmd = "vsim -c >" + logname +" < Date: Thu, 22 Apr 2021 15:35:20 -0400 Subject: [PATCH 2/2] Fix misa synthesis bug (for real now) --- wally-pipelined/src/privileged/csrm.sv | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wally-pipelined/src/privileged/csrm.sv b/wally-pipelined/src/privileged/csrm.sv index 1b693e03a..01dd0540a 100644 --- a/wally-pipelined/src/privileged/csrm.sv +++ b/wally-pipelined/src/privileged/csrm.sv @@ -107,8 +107,10 @@ module csrm #(parameter logic WritePMPCFG0M, WritePMPCFG2M; logic WritePMPADDRM [0:15]; + localparam MISA_26 = (`MISA) & 32'h03ffffff; + // MISA is hardwired. Spec says it could be written to disable features, but this is not supported by Wally - assign MISA_REGW = {(`XLEN == 32 ? 2'b01 : 2'b10), {(`XLEN-28){1'b0}}, {`MISA}[25:0]}; + assign MISA_REGW = {(`XLEN == 32 ? 2'b01 : 2'b10), {(`XLEN-28){1'b0}}, MISA_26[25:0]}; // Write machine Mode CSRs assign WriteMSTATUSM = CSRMWriteM && (CSRAdrM == MSTATUS);