diff --git a/.gitignore b/.gitignore index 5619adbf..2d1454e3 100644 --- a/.gitignore +++ b/.gitignore @@ -89,6 +89,7 @@ tests/custom/*/*/*.elf tests/custom/*/*/*.map tests/custom/*/*/*.memfile tests/custom/crt0/*.a +tests/custom/*/*.elf* sim/sd_model.log fpga/src/sdc/* fpga/src/sdc.tar.gz diff --git a/benchmarks/coremark/Makefile b/benchmarks/coremark/Makefile index bb0f20f5..b412c36e 100644 --- a/benchmarks/coremark/Makefile +++ b/benchmarks/coremark/Makefile @@ -22,7 +22,7 @@ PORT_CFLAGS = -g -mabi=$(ABI) -march=$(ARCH) -static -falign-functions=16 \ all: $(work_dir)/coremark.bare.riscv.elf.memfile run: - (cd ../../sim && (time vsim -c -do "do wally-pipelined-batch.do rv$(XLEN)gc coremark" 2>&1 | tee $(work_dir)/coremark.sim.log)) + (cd ../../sim && (time vsim -c -do "do wally-batch.do rv$(XLEN)gc coremark" 2>&1 | tee $(work_dir)/coremark.sim.log)) cd ../benchmarks/coremark/ # KMG: added post processing script to give out branch miss proportion along with other stats to the coremark test python3 coremark-postprocess.py diff --git a/benchmarks/embench/Makefile b/benchmarks/embench/Makefile index 0d619c90..538fb64f 100644 --- a/benchmarks/embench/Makefile +++ b/benchmarks/embench/Makefile @@ -34,7 +34,7 @@ sim: modelsim_build_memfile modelsim_run speed # launches modelsim to simulate tests on wally modelsim_run: - (cd ../../sim/ && vsim -c -do "do wally-pipelined-batch.do rv32gc embench") + (cd ../../sim/ && vsim -c -do "do wally-batch.do rv32gc embench") cd ../../benchmarks/embench/ # builds the objdump based on the compiled c elf files diff --git a/config/shared/wally-shared.vh b/config/shared/wally-shared.vh index 5d60fdce..507388f7 100644 --- a/config/shared/wally-shared.vh +++ b/config/shared/wally-shared.vh @@ -135,9 +135,6 @@ `define DIVBLEN ($clog2(`DIVb+1)-1) `define DIVa (`DIVb+1-`XLEN) // used for idiv on fpu -// Memory synthesis configuration -`define USE_SRAM 0 - // Disable spurious Verilator warnings /* verilator lint_off STMTDLY */ diff --git a/setup.imperas.sh b/setup.imperas.sh index 755a298b..71d5dcfd 100644 --- a/setup.imperas.sh +++ b/setup.imperas.sh @@ -36,7 +36,7 @@ pushd sim IMPERAS_TOOLS=$(pwd)/imperas.ic \ OTHERFLAGS="+TRACE2LOG_ENABLE=1 VERBOSE=1" \ TESTDIR=${WALLY}/external/ImperasDV-HMC/tests/riscof/work/riscv-arch-test/rv64i_m/F/src/fadd_b1-01.S \ - vsim -c -do "do wally-pipelined-imperas.do rv64gc" + vsim -c -do "do wally-imperas.do rv64gc" popd # notes @@ -50,7 +50,7 @@ popd IMPERAS_TOOLS=$(pwd)/imperas.ic \ OTHERFLAGS="+TRACE2LOG_ENABLE=1 VERBOSE=1" \ TESTDIR=../../tests/riscof_lee/work/riscv-arch-test/rv64i_m/F/src/fadd_b1-01.S \ -vsim -c -do "do wally-pipelined-imperas.do rv64gc" +vsim -c -do "do wally-imperas.do rv64gc" # getting library issue. diff --git a/sim/buildrootBugFinder.py b/sim/buildrootBugFinder.py index 89a838d2..af632459 100755 --- a/sim/buildrootBugFinder.py +++ b/sim/buildrootBugFinder.py @@ -22,7 +22,7 @@ def main(): break checkpoint = checkpointList[0] logFile = logDir+"checkpoint"+str(checkpoint)+".log" - runCommand="{\nvsim -c < {} -c < {} -c < {} -c < {} -c < {} -c < {} -c < {} -c < {} -c < {} -c < {} -c < {} -c < {} -c < {} -c < {} -c < {} -c < {} -c < {} -c < {} -c < {} -c < {} -c < ${OUTDIR} :: ${OUTLOG}" mkdir -p ${OUTDIR} - vsim -c -do "do wally-pipelined-imperas.do rv64gc" + vsim -c -do "do wally-imperas.do rv64gc" mv transcript ${OUTLOG} done diff --git a/sim/sim-buildroot b/sim/sim-buildroot index 938bff86..530e3338 100755 --- a/sim/sim-buildroot +++ b/sim/sim-buildroot @@ -30,4 +30,4 @@ echo "INSTR_LIMIT = ${INSTR_LIMIT}" echo "INSTR_WAVEON = ${INSTR_WAVEON}" echo "CHECKPOINT = ${CHECKPOINT}" -vsim -do "do ./wally-pipelined.do buildroot buildroot $RISCV $INSTR_LIMIT $INSTR_WAVEON $CHECKPOINT" +vsim -do "do ./wally.do buildroot buildroot $RISCV $INSTR_LIMIT $INSTR_WAVEON $CHECKPOINT" diff --git a/sim/sim-buildroot-batch b/sim/sim-buildroot-batch index a8d4038e..81a6fac1 100755 --- a/sim/sim-buildroot-batch +++ b/sim/sim-buildroot-batch @@ -32,5 +32,5 @@ echo "CHECKPOINT = ${CHECKPOINT}" # *** change config from buildroot to rv64gc vsim -c <" prompt: -# do wally-pipelined.do -# or, to run from a shell, type the following at the shell prompt: -# vsim -do wally-pipelined.do -c -# (omit the "-c" to see the GUI while running from the shell) +# run with vsim -do "do wally.do rv64ic riscvarchtest-64m" onbreak {resume} diff --git a/sim/wally-pipelined-batch.do b/sim/wally-batch.do similarity index 89% rename from sim/wally-pipelined-batch.do rename to sim/wally-batch.do index 4bd153ce..064f503b 100644 --- a/sim/wally-pipelined-batch.do +++ b/sim/wally-batch.do @@ -1,4 +1,5 @@ -# wally-pipelined-batch.do +# wally-batch.do +# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1 # # Modification by Oklahoma State University & Harvey Mudd College # Use with Testbench @@ -7,14 +8,14 @@ # # Takes 1:10 to run RV64IC tests using gui -# Usage: do wally-pipelined-batch.do -# Example: do wally-pipelined-batch.do rv32imc imperas-32i +# Usage: do wally-batch.do +# Example: do wally-batch.do rv32imc imperas-32i -# Use this wally-pipelined-batch.do file to run this example. +# Use this wally-batch.do file to run this example. # Either bring up ModelSim and type the following at the "ModelSim>" prompt: -# do wally-pipelined-batch.do +# do wally-batch.do # or, to run from a shell, type the following at the shell prompt: -# vsim -do wally-pipelined-batch.do -c +# vsim -do wally-batch.do -c # (omit the "-c" to see the GUI while running from the shell) onbreak {resume} @@ -91,9 +92,9 @@ if {$2 eq "buildroot" || $2 eq "buildroot-checkpoint"} { # power off -r /dut/core/* } -#coverage report -file wally-pipelined-coverage.txt +#coverage report -file wally-coverage.txt # These aren't doing anything helpful #coverage report -memory -#profile report -calltree -file wally-pipelined-calltree.rpt -cutoff 2 +#profile report -calltree -file wally-calltree.rpt -cutoff 2 #power report -all -bsaif power.saif quit diff --git a/sim/wally-pipelined-imperas-no-idv.do b/sim/wally-imperas-no-idv.do similarity index 73% rename from sim/wally-pipelined-imperas-no-idv.do rename to sim/wally-imperas-no-idv.do index 646c41c7..5f300250 100644 --- a/sim/wally-pipelined-imperas-no-idv.do +++ b/sim/wally-imperas-no-idv.do @@ -1,4 +1,5 @@ -# wally-pipelined.do +# wally.do +# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1 # # Modification by Oklahoma State University & Harvey Mudd College # Use with Testbench @@ -7,15 +8,6 @@ # # Takes 1:10 to run RV64IC tests using gui -# run with vsim -do "do wally-pipelined.do rv64ic riscvarchtest-64m" - -# Use this wally-pipelined.do file to run this example. -# Either bring up ModelSim and type the following at the "ModelSim>" prompt: -# do wally-pipelined.do -# or, to run from a shell, type the following at the shell prompt: -# vsim -do wally-pipelined.do -c -# (omit the "-c" to see the GUI while running from the shell) - onbreak {resume} # create library diff --git a/sim/wally-pipelined-imperas.do b/sim/wally-imperas.do similarity index 79% rename from sim/wally-pipelined-imperas.do rename to sim/wally-imperas.do index 21ed7142..d08361e8 100644 --- a/sim/wally-pipelined-imperas.do +++ b/sim/wally-imperas.do @@ -1,4 +1,5 @@ -# wally-pipelined.do +# wally.do +# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1 # # Modification by Oklahoma State University & Harvey Mudd College # Use with Testbench @@ -7,15 +8,6 @@ # # Takes 1:10 to run RV64IC tests using gui -# run with vsim -do "do wally-pipelined.do rv64ic riscvarchtest-64m" - -# Use this wally-pipelined.do file to run this example. -# Either bring up ModelSim and type the following at the "ModelSim>" prompt: -# do wally-pipelined.do -# or, to run from a shell, type the following at the shell prompt: -# vsim -do wally-pipelined.do -c -# (omit the "-c" to see the GUI while running from the shell) - onbreak {resume} # create library diff --git a/sim/wally-pipelined.do b/sim/wally.do similarity index 95% rename from sim/wally-pipelined.do rename to sim/wally.do index 9d61511b..895b10b9 100644 --- a/sim/wally-pipelined.do +++ b/sim/wally.do @@ -1,4 +1,5 @@ -# wally-pipelined.do +# wally.do +# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1 # # Modification by Oklahoma State University & Harvey Mudd College # Use with Testbench @@ -11,9 +12,9 @@ # Use this wally-pipelined.do file to run this example. # Either bring up ModelSim and type the following at the "ModelSim>" prompt: -# do wally-pipelined.do +# do wally.do # or, to run from a shell, type the following at the shell prompt: -# vsim -do wally-pipelined.do -c +# vsim -do wally.do -c # (omit the "-c" to see the GUI while running from the shell) onbreak {resume} diff --git a/src/ebu/buscachefsm.sv b/src/ebu/buscachefsm.sv index 8467f302..2f3e9922 100644 --- a/src/ebu/buscachefsm.sv +++ b/src/ebu/buscachefsm.sv @@ -116,7 +116,7 @@ module buscachefsm #( assign CaptureEn = (CurrState == DATA_PHASE & BusRW[1]) | (CurrState == CACHE_FETCH & HREADY); assign CacheAccess = CurrState == CACHE_FETCH | CurrState == CACHE_WRITEBACK; - assign BusStall = (CurrState == ADR_PHASE & (|BusRW | |CacheBusRW)) | + assign BusStall = (CurrState == ADR_PHASE & ((|BusRW) | (|CacheBusRW))) | //(CurrState == DATA_PHASE & ~BusRW[0]) | // *** replace the next line with this. Fails uart test but i think it's a test problem not a hardware problem. (CurrState == DATA_PHASE) | (CurrState == CACHE_FETCH & ~HREADY) | @@ -124,7 +124,7 @@ module buscachefsm #( assign BusCommitted = CurrState != ADR_PHASE; // AHB bus interface - assign HTRANS = (CurrState == ADR_PHASE & HREADY & (|BusRW | |CacheBusRW) & ~Flush) | + assign HTRANS = (CurrState == ADR_PHASE & HREADY & ((|BusRW) | (|CacheBusRW)) & ~Flush) | (CacheAccess & FinalBeatCount & |CacheBusRW & HREADY) ? AHB_NONSEQ : // if we have a pipelined request (CacheAccess & |BeatCount) ? (`BURST_EN ? AHB_SEQ : AHB_NONSEQ) : AHB_IDLE; diff --git a/src/fpu/unpackinput.sv b/src/fpu/unpackinput.sv index b85077d2..68f98e90 100644 --- a/src/fpu/unpackinput.sv +++ b/src/fpu/unpackinput.sv @@ -56,7 +56,6 @@ module unpackinput ( assign ExpMax = &In[`FLEN-2:`NF]; // is the exponent all 1's end else if (`FPSIZES == 2) begin // if there are 2 floating point formats supported - //***need better names for these constants // largest format | smaller format //---------------------------------- // `FLEN | `LEN1 length of floating point number @@ -104,7 +103,6 @@ module unpackinput ( end else if (`FPSIZES == 3) begin // three floating point precsions supported - //***need better names for these constants // largest format | larger format | smallest format //--------------------------------------------------- // `FLEN | `LEN1 | `LEN2 length of floating point number @@ -196,7 +194,7 @@ module unpackinput ( // Check NaN boxing always_comb case (Fmt) - 2'b11: BadNaNBox = 0; + 2'b11: BadNaNBox = 0; 2'b01: BadNaNBox = ~&In[`Q_LEN-1:`D_LEN]; 2'b00: BadNaNBox = ~&In[`Q_LEN-1:`S_LEN]; 2'b10: BadNaNBox = ~&In[`Q_LEN-1:`H_LEN]; diff --git a/synthDC/Makefile b/synthDC/Makefile index 613ca49a..97462670 100755 --- a/synthDC/Makefile +++ b/synthDC/Makefile @@ -6,8 +6,8 @@ NAME := synth # defaults export DESIGN ?= wallypipelinedcore -export FREQ ?= 3000 -export CONFIG ?= rv32e +export FREQ ?= 10000 +export CONFIG ?= rv64gc export MOD ?= orig # title to add a note in the synth's directory name TITLE = @@ -20,7 +20,7 @@ export MAXCORES ?= 1 # The output netlist is hard to interpret, but significantly better PPA export MAXOPT ?= 0 export DRIVE ?= FLOP -export USESRAM ?= 0 +export USESRAM ?= 1 time := $(shell date +%F-%H-%M) hash := $(shell git rev-parse --short HEAD) @@ -55,25 +55,35 @@ $(CONFIG): cp -r $(OLDCONFIGDIR)/shared/*.vh $(CONFIGDIR) cp -r $(OLDCONFIGDIR)/$(CONFIG)/* $(CONFIGDIR) +# adjust DTIM and IROM to reasonable values depending on config +ifneq ($(filter $(CONFIG), $(DIRS32)),) + sed -i "s/DTIM_RANGE.*/DTIM_RANGE 34\'h01FF/g" $(CONFIGDIR)/wally-config.vh + sed -i "s/IROM_RANGE.*/IROM_RANGE 34\'h01FF/g" $(CONFIGDIR)/wally-config.vh +else ifneq ($(filter $(CONFIG), $(DIRS64)),) + sed -i "s/DTIM_RANGE.*/DTIM_RANGE 56\'h01FF/g" $(CONFIGDIR)/wally-config.vh + sed -i "s/IROM_RANGE.*/IROM_RANGE 56\'h01FF/g" $(CONFIGDIR)/wally-config.vh +else + $(info $(CONFIG) does not exist in $(DIRS32) or $(DIRS64)) + @echo "Config not in list, RAM_RANGE will be unmodified" +endif + +# if USESRAM = 1, set that in the config file, otherwise reduce sizes ifeq ($(USESRAM), 1) - sed -i 's/USE_SRAM.*/USE_SRAM 1/g' $(CONFIGDIR)/wally-shared.vh + sed -i 's/USE_SRAM.*/USE_SRAM 1/g' $(CONFIGDIR)/wally-config.vh else sed -i 's/WAYSIZEINBYTES.*/WAYSIZEINBYTES 512/g' $(CONFIGDIR)/wally-config.vh sed -i 's/NUMWAYS.*/NUMWAYS 1/g' $(CONFIGDIR)/wally-config.vh sed -i 's/BPRED_SIZE.*/BPRED_SIZE 5/g' $(CONFIGDIR)/wally-config.vh - - ifneq ($(filter $(CONFIG), $(DIRS32)),) - sed -i "s/DTIM_RANGE.*/DTIM_RANGE 34\'h01FF/g" $(CONFIGDIR)/wally-config.vh - sed -i "s/IROM_RANGE.*/IROM_RANGE 34\'h01FF/g" $(CONFIGDIR)/wally-config.vh - else ifneq ($(filter $(CONFIG), $(DIRS64)),) - sed -i "s/DTIM_RANGE.*/DTIM_RANGE 56\'h01FF/g" $(CONFIGDIR)/wally-config.vh - sed -i "s/IROM_RANGE.*/IROM_RANGE 56\'h01FF/g" $(CONFIGDIR)/wally-config.vh - else - $(info $(CONFIG) does not exist in $(DIRS32) or $(DIRS64)) - @echo "Config not in list, RAM_RANGE will be unmodified" - endif +ifneq ($(filter $(CONFIG), $(DIRS32)),) + sed -i "s/BOOTROM_RANGE.*/BOOTROM_RANGE 34\'h01FF/g" $(CONFIGDIR)/wally-config.vh + sed -i "s/UNCORE_RAM_RANGE.*/UNCORE_RAM_RANGE 34\'h01FF/g" $(CONFIGDIR)/wally-config.vh +else ifneq ($(filter $(CONFIG), $(DIRS64)),) + sed -i "s/BOOTROM_RANGE.*/BOOTROM_RANGE 56\'h01FF/g" $(CONFIGDIR)/wally-config.vh + sed -i "s/UNCORE_RAM_RANGE.*/UNCORE_RAM_RANGE 56\'h01FF/g" $(CONFIGDIR)/wally-config.vh +endif endif +# adjust config if synthesizing with any modifications ifeq ($(MOD), FPUoff) # turn off FPU sed -i 's/1 *<< *3/0 << 3/' $(CONFIGDIR)/wally-config.vh diff --git a/testbench/testbench-fp.sv b/testbench/testbench-fp.sv index 8d6826b7..3359090a 100644 --- a/testbench/testbench-fp.sv +++ b/testbench/testbench-fp.sv @@ -9,22 +9,18 @@ // // Copyright (C) 2021 Harvey Mudd College & Oklahoma State University // -// MIT LICENSE -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: +// SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1 // -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. +// Licensed under the Solderpad Hardware License v 2.1 (the “License”); you may not use this file +// except in compliance with the License, or, at your option, the Apache License version 2.0. You +// may obtain a copy of the License at // -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE -// OR OTHER DEALINGS IN THE SOFTWARE. +// https://solderpad.org/licenses/SHL-2.1/ +// +// Unless required by applicable law or agreed to in writing, any work distributed under the +// License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions +// and limitations under the License. //////////////////////////////////////////////////////////////////////////////////////////////// `include "wally-config.vh" `include "tests-fp.vh" diff --git a/testbench/testbench-linux.sv b/testbench/testbench-linux.sv index da369250..1705b36f 100644 --- a/testbench/testbench-linux.sv +++ b/testbench/testbench-linux.sv @@ -10,20 +10,19 @@ // // Copyright (C) 2021 Harvey Mudd College & Oklahoma State University // -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, -// modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software -// is furnished to do so, subject to the following conditions: +// SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1 // -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +// Licensed under the Solderpad Hardware License v 2.1 (the “License”); you may not use this file +// except in compliance with the License, or, at your option, the Apache License version 2.0. You +// may obtain a copy of the License at // -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT -// OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -// When letting Wally go for it, let wally make own interrupts -/////////////////////////////////////////// +// https://solderpad.org/licenses/SHL-2.1/ +// +// Unless required by applicable law or agreed to in writing, any work distributed under the +// License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions +// and limitations under the License. +//////////////////////////////////////////////////////////////////////////////////////////////// `include "wally-config.vh" diff --git a/testbench/testbench.sv b/testbench/testbench.sv index a3fa2c09..329d4c60 100644 --- a/testbench/testbench.sv +++ b/testbench/testbench.sv @@ -11,22 +11,18 @@ // // Copyright (C) 2021 Harvey Mudd College & Oklahoma State University // -// MIT LICENSE -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: +// SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1 // -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. +// Licensed under the Solderpad Hardware License v 2.1 (the “License”); you may not use this file +// except in compliance with the License, or, at your option, the Apache License version 2.0. You +// may obtain a copy of the License at // -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE -// OR OTHER DEALINGS IN THE SOFTWARE. +// https://solderpad.org/licenses/SHL-2.1/ +// +// Unless required by applicable law or agreed to in writing, any work distributed under the +// License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions +// and limitations under the License. //////////////////////////////////////////////////////////////////////////////////////////////// `include "wally-config.vh" diff --git a/testbench/testbench_imperas.sv b/testbench/testbench_imperas.sv index 65c92eb3..ce4b16de 100644 --- a/testbench/testbench_imperas.sv +++ b/testbench/testbench_imperas.sv @@ -11,22 +11,18 @@ // // Copyright (C) 2021 Harvey Mudd College & Oklahoma State University // -// MIT LICENSE -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: +// SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1 // -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. +// Licensed under the Solderpad Hardware License v 2.1 (the “License”); you may not use this file +// except in compliance with the License, or, at your option, the Apache License version 2.0. You +// may obtain a copy of the License at // -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE -// OR OTHER DEALINGS IN THE SOFTWARE. +// https://solderpad.org/licenses/SHL-2.1/ +// +// Unless required by applicable law or agreed to in writing, any work distributed under the +// License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions +// and limitations under the License. //////////////////////////////////////////////////////////////////////////////////////////////// `include "wally-config.vh" diff --git a/testbench/tests-fp.vh b/testbench/tests-fp.vh index ff5cf2fb..1d4cfdc6 100644 --- a/testbench/tests-fp.vh +++ b/testbench/tests-fp.vh @@ -1,3 +1,29 @@ +/////////////////////////////////////////// +// tests0fo.vh +// +// Written: Katherine Parry 2022 +// Modified: +// +// Purpose: List of floating-point tests to apply +// +// A component of the Wally configurable RISC-V project. +// +// Copyright (C) 2021-3 Harvey Mudd College & Oklahoma State University +// +// SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1 +// +// Licensed under the Solderpad Hardware License v 2.1 (the “License”); you may not use this file +// except in compliance with the License, or, at your option, the Apache License version 2.0. You +// may obtain a copy of the License at +// +// https://solderpad.org/licenses/SHL-2.1/ +// +// Unless required by applicable law or agreed to in writing, any work distributed under the +// License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions +// and limitations under the License. +//////////////////////////////////////////////////////////////////////////////////////////////// + `define PATH "../../tests/fp/vectors/" `define ADD_OPCTRL 3'b110 `define MUL_OPCTRL 3'b100 diff --git a/testbench/tests.vh b/testbench/tests.vh index f119b0a4..397c66a0 100644 --- a/testbench/tests.vh +++ b/testbench/tests.vh @@ -10,18 +10,19 @@ // // Copyright (C) 2021 Harvey Mudd College & Oklahoma State University // -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, -// modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software -// is furnished to do so, subject to the following conditions: +// SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1 // -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +// Licensed under the Solderpad Hardware License v 2.1 (the “License”); you may not use this file +// except in compliance with the License, or, at your option, the Apache License version 2.0. You +// may obtain a copy of the License at // -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT -// OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -/////////////////////////////////////////// +// https://solderpad.org/licenses/SHL-2.1/ +// +// Unless required by applicable law or agreed to in writing, any work distributed under the +// License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions +// and limitations under the License. +//////////////////////////////////////////////////////////////////////////////////////////////// `define IMPERASTEST "0" `define RISCVARCHTEST "1" @@ -1883,6 +1884,7 @@ string imperas32f[] = '{ string custom[] = '{ `CUSTOM, + "debug", "simple", "cacheTest" }; diff --git a/tests/custom/debug/Makefile b/tests/custom/debug/Makefile new file mode 100644 index 00000000..9ee0b2e7 --- /dev/null +++ b/tests/custom/debug/Makefile @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1 + +TARGET = debug + +$(TARGET).elf.memfile:$(TARGET).elf $(TARGET).elf.objdump.addr + riscv64-unknown-elf-elf2hex --bit-width $(if $(findstring rv64,$*),64,32) --input $< --output $@ + +$(TARGET).elf.objdump.addr: $(TARGET).elf.objdump + extractFunctionRadix.sh $< + +$(TARGET).elf.objdump: $(TARGET).elf + riscv64-unknown-elf-objdump -D $(TARGET).elf > $(TARGET).elf.objdump + +$(TARGET).elf: $(TARGET).S Makefile + riscv64-unknown-elf-gcc -g -o $(TARGET).elf -march=rv64gc -mabi=lp64 -mcmodel=medany \ + -nostartfiles -T$(WALLY)/examples/link/link.ld $(TARGET).S + +sim: + spike --isa=rv64gc +signature=$(TARGET).signature.output +signature-granularity=8 $(TARGET).elf + diff --ignore-case $(TARGET).signature.output $(TARGET).reference_output || exit + echo "Signature matches! Success!" + +clean: + rm -f $(TARGET).elf $(TARGET).elf.* + + + diff --git a/tests/custom/debug/debug.S b/tests/custom/debug/debug.S new file mode 100644 index 00000000..431a261e --- /dev/null +++ b/tests/custom/debug/debug.S @@ -0,0 +1,57 @@ +// debug.S +// David_Harris@hmc.edu 4 February 2023 +// Small code snippets for the purpose of debugging issues +// SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1 + +.global rvtest_entry_point +rvtest_entry_point: + + # openhwgroup/cvw Issue #55 + la a6, begin_signature + la a7, rvtest_data + fadd.d ft0, ft1, ft2 + fld f4, 0(a7) + fld f9, 8(a7) +# li x1, 0x7ff0000000000001 +# sd x1, 0(a6) +# fmv.w.x f4, x1 +# li x1, 0x7ff8000000000000 + # fmv.w.x f9, x1 + fsgnjx.s f12,f9,f4 # expected f 0xffffffff7fc00000 + fsd f12, 0(a6) + +######################### +# HTIF and signature +######################### + +write_tohost: + la t1, tohost + li t0, 1 # 1 for success, 3 for failure + sd t0, 0(t1) # send success code + +self_loop: + j self_loop # wait + +.align 6 +.section .tohost +tohost: # write to HTIF + .dword 0 +fromhost: + .dword 0 + +.align 6 +.data + +rvtest_data: +.dword 0x7ff0000000000001 +.dword 0x7ff8000000000000 + +.EQU XLEN,64 +begin_signature: + .fill 2*(XLEN/32),4,0xdeadbeef # +end_signature: + +# Initialize stack with room for 512 bytes +.bss + .space 512 +topofstack: \ No newline at end of file