From 56ff32f8573a3d9cd7c877fda61776441392c4ac Mon Sep 17 00:00:00 2001 From: Noah Boorstin Date: Tue, 2 Feb 2021 21:39:20 +0000 Subject: [PATCH 1/4] change undefined syntax in extend.sv don't need verilator execption anymore --- wally-pipelined/src/ieu/extend.sv | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/wally-pipelined/src/ieu/extend.sv b/wally-pipelined/src/ieu/extend.sv index ec144a3a..e4fc7ac9 100644 --- a/wally-pipelined/src/ieu/extend.sv +++ b/wally-pipelined/src/ieu/extend.sv @@ -42,8 +42,6 @@ module extend ( 3'b011: ExtImmD = {{(`XLEN-20){InstrD[31]}}, InstrD[19:12], InstrD[20], InstrD[30:21], 1'b0}; // U-type (lui, auipc) 3'b100: ExtImmD = {{(`XLEN-31){InstrD[31]}}, InstrD[30:12], 12'b0}; - /* verilator lint_off WIDTH */ - default: ExtImmD = 'bx; // undefined - /* verilator lint_on WIDTH */ + default: ExtImmD = {32{1'bx}}; // undefined endcase endmodule From 00d9e13d68d3eb8a26fa46b6bb2173d5704b05f2 Mon Sep 17 00:00:00 2001 From: Noah Boorstin Date: Tue, 2 Feb 2021 21:47:15 +0000 Subject: [PATCH 2/4] same thing but do that right this time --- wally-pipelined/src/ieu/extend.sv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wally-pipelined/src/ieu/extend.sv b/wally-pipelined/src/ieu/extend.sv index e4fc7ac9..243dced3 100644 --- a/wally-pipelined/src/ieu/extend.sv +++ b/wally-pipelined/src/ieu/extend.sv @@ -42,6 +42,6 @@ module extend ( 3'b011: ExtImmD = {{(`XLEN-20){InstrD[31]}}, InstrD[19:12], InstrD[20], InstrD[30:21], 1'b0}; // U-type (lui, auipc) 3'b100: ExtImmD = {{(`XLEN-31){InstrD[31]}}, InstrD[30:12], 12'b0}; - default: ExtImmD = {32{1'bx}}; // undefined + default: ExtImmD = {(`XLEN-1){1'bx}}; // undefined endcase endmodule From b370be4a8a207bf54d59acc80c9e2e44b6521757 Mon Sep 17 00:00:00 2001 From: Noah Boorstin Date: Tue, 2 Feb 2021 22:05:35 +0000 Subject: [PATCH 3/4] Add busybear testbench to nightly regression checking If you don't like how I did this please feel free to undo it --- .../regression/regression-wally.py | 38 +++++++++++++------ 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/wally-pipelined/regression/regression-wally.py b/wally-pipelined/regression/regression-wally.py index f97202d4..4d794e40 100755 --- a/wally-pipelined/regression/regression-wally.py +++ b/wally-pipelined/regression/regression-wally.py @@ -9,7 +9,7 @@ ################################## # edit this line to add more configurations -confignames = ["rv32ic", "rv64ic"] +confignames = ["rv32ic", "rv64ic", "busybear"] import multiprocessing, os @@ -18,18 +18,34 @@ fail = 0 def test_config(config, print_res=True): """Run the given config, and return 0 if it suceeds and 1 if it fails""" logname = "wally_"+config+".log" - cmd = "vsim -c >" + logname +" <" + logname + os.system(cmd) + + # check for success. grep returns 0 if found, 1 if not found + cmd = "grep -e 'no more .* to read' " + logname + "> /dev/null" + grepval = os.system(cmd) + if (grepval): + if print_res:print(logname+": failures detected") + return 1 + else: + if print_res:print(logname+": Success") + return 0 + - # check for success. grep returns 0 if found, 1 if not found - cmd = "grep 'All tests ran without failures' " + logname + "> /dev/null" - grepval = os.system(cmd) - if (grepval): - if print_res:print(logname+": failures detected") - return 1 else: - if print_res:print(logname+": Success") - return 0 + cmd = "vsim -c >" + logname +" < /dev/null" + grepval = os.system(cmd) + if (grepval): + if print_res:print(logname+": failures detected") + return 1 + else: + if print_res:print(logname+": Success") + return 0 pool = multiprocessing.Pool(min(len(confignames), 12)) fail = sum(pool.map(test_config, confignames)) From 10f023b44da2813245d60092759f124406433079 Mon Sep 17 00:00:00 2001 From: Jarred Allen Date: Tue, 2 Feb 2021 17:20:45 -0500 Subject: [PATCH 4/4] Refactor regression test --- .../regression/regression-wally.py | 34 ++++++++----------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/wally-pipelined/regression/regression-wally.py b/wally-pipelined/regression/regression-wally.py index 4d794e40..531d0e8c 100755 --- a/wally-pipelined/regression/regression-wally.py +++ b/wally-pipelined/regression/regression-wally.py @@ -15,37 +15,31 @@ import multiprocessing, os fail = 0 +def search_log_for_text(text, logfile): + """Search through the given log file for text, returning True if it is found or False if it is not""" + grepcmd = "grep -e '%s' '%s' > /dev/null" % (text, logfile) + return os.system(grepcmd) == 0 + def test_config(config, print_res=True): """Run the given config, and return 0 if it suceeds and 1 if it fails""" logname = "wally_"+config+".log" if config == "busybear": cmd = "echo 'quit' | vsim -do wally-busybear.do -c >" + logname os.system(cmd) - # check for success. grep returns 0 if found, 1 if not found - cmd = "grep -e 'no more .* to read' " + logname + "> /dev/null" - grepval = os.system(cmd) - if (grepval): - if print_res:print(logname+": failures detected") - return 1 - else: - if print_res:print(logname+": Success") - return 0 - - + passed = search_log_for_text("no more .* to read", logname) else: cmd = "vsim -c >" + logname +" < /dev/null" - grepval = os.system(cmd) - if (grepval): - if print_res:print(logname+": failures detected") - return 1 - else: - if print_res:print(logname+": Success") - return 0 + passed = search_log_for_text("All tests ran without failures", logname) + if passed: + if print_res:print(logname+": Success") + return 0 + else: + if print_res:print(logname+": failures detected") + return 1 + pool = multiprocessing.Pool(min(len(confignames), 12)) fail = sum(pool.map(test_config, confignames))