mirror of
				https://github.com/openhwgroup/cvw
				synced 2025-02-11 06:05:49 +00:00 
			
		
		
		
	
						commit
						69e9c85d7a
					
				
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -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 | ||||
|  | ||||
| @ -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 | ||||
|  | ||||
| @ -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
 | ||||
|  | ||||
| @ -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 */ | ||||
|  | ||||
| @ -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. | ||||
|  | ||||
| @ -22,7 +22,7 @@ def main(): | ||||
|             break | ||||
|         checkpoint = checkpointList[0] | ||||
|         logFile = logDir+"checkpoint"+str(checkpoint)+".log" | ||||
|         runCommand="{\nvsim -c <<!\ndo wally-pipelined-batch.do buildroot buildroot /opt/riscv 0 "+str(checkpoint+1)+" "+str(checkpoint)+"\n!\n} | tee "+logFile  | ||||
|         runCommand="{\nvsim -c <<!\ndo wally-batch.do buildroot buildroot /opt/riscv 0 "+str(checkpoint+1)+" "+str(checkpoint)+"\n!\n} | tee "+logFile  | ||||
|         print(runCommand) | ||||
|         os.system(runCommand) | ||||
|         try: | ||||
|  | ||||
| @ -50,18 +50,18 @@ def getBuildrootTC(boot): | ||||
|     MAX_EXPECTED = 246000000 # *** TODO: replace this with a search for the login prompt. | ||||
|     if boot: | ||||
|         name="buildrootboot" | ||||
|         BRcmd="vsim > {} -c <<!\ndo wally-pipelined.do buildroot buildroot-no-trace $RISCV 0 1 0\n!" | ||||
|         BRcmd="vsim > {} -c <<!\ndo wally.do buildroot buildroot-no-trace $RISCV 0 1 0\n!" | ||||
|         BRgrepstr="WallyHostname login:" | ||||
|     else: | ||||
|         name="buildroot" | ||||
|         BRcmd="vsim > {} -c <<!\ndo wally-pipelined-batch.do buildroot buildroot $RISCV "+str(INSTR_LIMIT)+" 1 0\n!" | ||||
|         BRcmd="vsim > {} -c <<!\ndo wally-batch.do buildroot buildroot $RISCV "+str(INSTR_LIMIT)+" 1 0\n!" | ||||
|         BRgrepstr=str(INSTR_LIMIT)+" instructions" | ||||
|     return  TestCase(name,variant="rv64gc",cmd=BRcmd,grepstr=BRgrepstr) | ||||
| 
 | ||||
| tc = TestCase( | ||||
|       name="buildroot-checkpoint", | ||||
|       variant="rv64gc", | ||||
|       cmd="vsim > {} -c <<!\ndo wally-pipelined-batch.do buildroot buildroot-checkpoint $RISCV 400100000 400000001 400000000\n!", # *** will this work with rv64gc rather than buildroot config? | ||||
|       cmd="vsim > {} -c <<!\ndo wally-batch.do buildroot buildroot-checkpoint $RISCV 400100000 400000001 400000000\n!", # *** will this work with rv64gc rather than buildroot config? | ||||
|       grepstr="400100000 instructions") | ||||
| configs.append(tc) | ||||
| 
 | ||||
| @ -71,7 +71,7 @@ for test in tests64gc: | ||||
|   tc = TestCase( | ||||
|         name=test, | ||||
|         variant="rv64gc", | ||||
|         cmd="vsim > {} -c <<!\ndo wally-pipelined-batch.do rv64gc "+test+"\n!", | ||||
|         cmd="vsim > {} -c <<!\ndo wally-batch.do rv64gc "+test+"\n!", | ||||
|         grepstr="All tests ran without failures") | ||||
|   configs.append(tc) | ||||
| 
 | ||||
| @ -80,7 +80,7 @@ for test in tests64i: | ||||
|   tc = TestCase( | ||||
|         name=test, | ||||
|         variant="rv64i", | ||||
|         cmd="vsim > {} -c <<!\ndo wally-pipelined-batch.do rv64i "+test+"\n!", | ||||
|         cmd="vsim > {} -c <<!\ndo wally-batch.do rv64i "+test+"\n!", | ||||
|         grepstr="All tests ran without failures") | ||||
|   configs.append(tc) | ||||
| 
 | ||||
| @ -90,7 +90,7 @@ for test in tests32gc: | ||||
|   tc = TestCase( | ||||
|         name=test, | ||||
|         variant="rv32gc", | ||||
|         cmd="vsim > {} -c <<!\ndo wally-pipelined-batch.do rv32gc "+test+"\n!", | ||||
|         cmd="vsim > {} -c <<!\ndo wally-batch.do rv32gc "+test+"\n!", | ||||
|         grepstr="All tests ran without failures") | ||||
|   configs.append(tc) | ||||
| 
 | ||||
| @ -100,7 +100,7 @@ for test in tests32imc: | ||||
|   tc = TestCase( | ||||
|         name=test, | ||||
|         variant="rv32imc", | ||||
|         cmd="vsim > {} -c <<!\ndo wally-pipelined-batch.do rv32imc "+test+"\n!", | ||||
|         cmd="vsim > {} -c <<!\ndo wally-batch.do rv32imc "+test+"\n!", | ||||
|         grepstr="All tests ran without failures") | ||||
|   configs.append(tc) | ||||
| 
 | ||||
| @ -109,7 +109,7 @@ for test in tests32i: | ||||
|   tc = TestCase( | ||||
|         name=test, | ||||
|         variant="rv32i", | ||||
|         cmd="vsim > {} -c <<!\ndo wally-pipelined-batch.do rv32i "+test+"\n!", | ||||
|         cmd="vsim > {} -c <<!\ndo wally-batch.do rv32i "+test+"\n!", | ||||
|         grepstr="All tests ran without failures") | ||||
|   configs.append(tc) | ||||
| 
 | ||||
| @ -119,7 +119,7 @@ for test in tests32e: | ||||
|   tc = TestCase( | ||||
|         name=test, | ||||
|         variant="rv32e", | ||||
|         cmd="vsim > {} -c <<!\ndo wally-pipelined-batch.do rv32e "+test+"\n!", | ||||
|         cmd="vsim > {} -c <<!\ndo wally-batch.do rv32e "+test+"\n!", | ||||
|         grepstr="All tests ran without failures") | ||||
|   configs.append(tc) | ||||
| 
 | ||||
| @ -128,7 +128,7 @@ for test in ahbTests: | ||||
|   tc = TestCase( | ||||
|         name="ram_latency_" + test[0] + "_burst_en_" + test[1], | ||||
|         variant="ahb", | ||||
|         cmd="vsim > {} -c <<!\ndo wally-pipelined-batch.do rv64gc ahb "+test[0]+" "+test[1]+"\n!", | ||||
|         cmd="vsim > {} -c <<!\ndo wally-batch.do rv64gc ahb "+test[0]+" "+test[1]+"\n!", | ||||
|         grepstr="All tests ran without failures") | ||||
|   configs.append(tc) | ||||
|    | ||||
|  | ||||
| @ -17,6 +17,6 @@ for t in $ALL; do | ||||
|     echo "Running test ${TESTDIR} -> ${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 | ||||
|  | ||||
| @ -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" | ||||
|  | ||||
| @ -32,5 +32,5 @@ echo "CHECKPOINT   = ${CHECKPOINT}" | ||||
| 
 | ||||
| # *** change config from buildroot to rv64gc | ||||
| vsim -c <<! | ||||
| do wally-pipelined-batch.do buildroot buildroot-no-trace $RISCV $INSTR_LIMIT $INSTR_WAVEON $CHECKPOINT | ||||
| do wally-batch.do buildroot buildroot-no-trace $RISCV $INSTR_LIMIT $INSTR_WAVEON $CHECKPOINT | ||||
| ! | ||||
|  | ||||
| @ -29,4 +29,4 @@ | ||||
| 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" | ||||
|  | ||||
| @ -1,2 +1,2 @@ | ||||
| vsim -do "do wally-pipelined.do rv64gc arch64d" | ||||
| vsim -do "do wally.do rv64gc arch64d" | ||||
| 
 | ||||
|  | ||||
| @ -1 +1 @@ | ||||
| vsim -c -do "do wally-pipelined-batch.do rv32gc wally32priv" | ||||
| vsim -c -do "do wally-batch.do rv32gc wally32priv" | ||||
|  | ||||
| @ -1,4 +1,4 @@ | ||||
| # wally-pipelined.do  | ||||
| # testfloat.do  | ||||
| # | ||||
| # Modification by Oklahoma State University & Harvey Mudd College | ||||
| # Use with Testbench  | ||||
| @ -7,14 +7,7 @@ | ||||
| # | ||||
| # 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) | ||||
| # run with vsim -do "do wally.do rv64ic riscvarchtest-64m" | ||||
| 
 | ||||
| onbreak {resume} | ||||
| 
 | ||||
|  | ||||
| @ -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 <config> <testcases> | ||||
| # Example: do wally-pipelined-batch.do rv32imc imperas-32i | ||||
| # Usage: do wally-batch.do <config> <testcases> | ||||
| # 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 | ||||
| @ -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 | ||||
| @ -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 | ||||
| @ -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} | ||||
| @ -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; | ||||
| 
 | ||||
|  | ||||
| @ -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]; | ||||
|  | ||||
| @ -69,7 +69,7 @@ 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 | ||||
|  | ||||
| @ -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" | ||||
|  | ||||
| @ -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" | ||||
| 
 | ||||
|  | ||||
| @ -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" | ||||
|  | ||||
| @ -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" | ||||
|  | ||||
| @ -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 | ||||
|  | ||||
| @ -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" | ||||
|  }; | ||||
|  | ||||
							
								
								
									
										27
									
								
								tests/custom/debug/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								tests/custom/debug/Makefile
									
									
									
									
									
										Normal file
									
								
							| @ -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.* | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
							
								
								
									
										57
									
								
								tests/custom/debug/debug.S
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										57
									
								
								tests/custom/debug/debug.S
									
									
									
									
									
										Normal file
									
								
							| @ -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: | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user