From 9c09ad55ad2361209572e0ed443f11b859c0c375 Mon Sep 17 00:00:00 2001 From: "James E. Stine" Date: Tue, 30 Mar 2021 14:21:02 -0500 Subject: [PATCH] Initial push of rv64imc and appropriate testbench --- wally-pipelined/regression/run_sim.sh | 3 + .../regression/sim-wally-batch-muldiv | 3 + .../wally-pipelined-batch-muldiv.do | 43 +++++++++++ wally-pipelined/regression/wave-osu.do | 75 +++++++++++++++++++ 4 files changed, 124 insertions(+) create mode 100755 wally-pipelined/regression/run_sim.sh create mode 100755 wally-pipelined/regression/sim-wally-batch-muldiv create mode 100644 wally-pipelined/regression/wally-pipelined-batch-muldiv.do create mode 100755 wally-pipelined/regression/wave-osu.do diff --git a/wally-pipelined/regression/run_sim.sh b/wally-pipelined/regression/run_sim.sh new file mode 100755 index 00000000..6e52eb40 --- /dev/null +++ b/wally-pipelined/regression/run_sim.sh @@ -0,0 +1,3 @@ +#!/bin/sh +vsim -do $1 + diff --git a/wally-pipelined/regression/sim-wally-batch-muldiv b/wally-pipelined/regression/sim-wally-batch-muldiv new file mode 100755 index 00000000..c9db7ed1 --- /dev/null +++ b/wally-pipelined/regression/sim-wally-batch-muldiv @@ -0,0 +1,3 @@ +vsim -c <" prompt: +# do wally-pipelined-batch.do +# or, to run from a shell, type the following at the shell prompt: +# vsim -do wally-pipelined-batch.do -c +# (omit the "-c" to see the GUI while running from the shell) + +onbreak {resume} + +# create library +if [file exists work_$2] { + vdel -lib work_$2 -all +} +vlib work_$2 + +# compile source files +# suppress spurious warnngs about +# "Extra checking for conflicts with always_comb done at vopt time" +# because vsim will run vopt + +# default to config/rv64ic, but allow this to be overridden at the command line. For example: +# do wally-pipelined-batch.do ../config/rv32ic rv32ic +switch $argc { + 0 {vlog +incdir+../config/rv64imc ../testbench/testbench-imperas.sv ../src/*/*.sv -suppress 2583} + 1 {vlog +incdir+$1 ../testbench/testbench-imperas.sv ../src/*/*.sv -suppress 2583} + 2 {vlog -work work_$2 +incdir+$1 ../testbench/testbench-imperas.sv ../src/*/*.sv -suppress 2583} +} +# start and run simulation +# remove +acc flag for faster sim during regressions if there is no need to access internal signals +vopt work_$2.testbench -work work_$2 -o workopt_$2 +vsim -lib work_$2 workopt_$2 + +run -all +quit diff --git a/wally-pipelined/regression/wave-osu.do b/wally-pipelined/regression/wave-osu.do new file mode 100755 index 00000000..218bc739 --- /dev/null +++ b/wally-pipelined/regression/wave-osu.do @@ -0,0 +1,75 @@ +# wally-pipelined.do +# +# Modification by Oklahoma State University & Harvey Mudd College +# Use with Testbench +# James Stine, 2008; David Harris 2021 +# Go Cowboys!!!!!! +# +# Takes 1:10 to run RV64IC tests using gui + +# 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 +if [file exists work] { + vdel -all +} +vlib work + +# compile source files +# suppress spurious warnngs about +# "Extra checking for conflicts with always_comb done at vopt time" +# because vsim will run vopt + +# default to config/rv64ic, but allow this to be overridden at the command line. For example: +# do wally-pipelined.do ../config/rv32ic +switch $argc { + 0 {vlog +incdir+../config/rv64ic ../testbench/testbench-imperas.sv ../src/*/*.sv -suppress 2583} + 1 {vlog +incdir+$1 ../testbench/testbench-imperas.sv ../src/*/*.sv -suppress 2583} +} +# start and run simulation +# remove +acc flag for faster sim during regressions if there is no need to access internal signals +vopt +acc work.testbench -o workopt +vsim workopt + +view wave + +-- display input and output signals as hexidecimal values +# Diplays All Signals recursively +-- display input and output signals as hexidecimal values +# Diplays All Signals recursively +add wave /testbench/clk +add wave /testbench/reset +add wave -noupdate -divider -height 32 "Datapath" +add wave -hex /testbench/dut/hart/ieu/dp/* +add wave -noupdate -divider -height 32 "RF" +add wave -hex /testbench/dut/hart/ieu/dp/regf/* +add wave -hex /testbench/dut/hart/ieu/dp/regf/rf +add wave -noupdate -divider -height 32 "Control" +add wave -hex /testbench/dut/hart/ieu/c/* +add wave -noupdate -divider -height 32 "Multiply/Divide" +add wave -hex /testbench/dut/hart/mdu/* + +-- Set Wave Output Items +TreeUpdate [SetDefaultTree] +WaveRestoreZoom {0 ps} {100 ps} +configure wave -namecolwidth 250 +configure wave -valuecolwidth 120 +configure wave -justifyvalue left +configure wave -signalnamewidth 0 +configure wave -snapdistance 10 +configure wave -datasetprefix 0 +configure wave -rowmargin 4 +configure wave -childrowmargin 2 +set DefaultRadix hexadecimal + +-- Run the Simulation +#run 1000 +run -all +#quit