From 81ab60ffe31130d49a0003188c4ffffb4ed3193a Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Fri, 13 Dec 2024 15:41:49 -0800 Subject: [PATCH] Delete unsupported scripts --- scripts/build-midas.sh | 63 ----------------- scripts/build-spike.sh | 29 -------- scripts/build-vcs.sh | 36 ---------- scripts/build-verilator.sh | 36 ---------- scripts/run-midas.sh | 136 ------------------------------------- scripts/run-spike.sh | 78 --------------------- scripts/run-vcs.sh | 92 ------------------------- scripts/run-verilator.sh | 92 ------------------------- scripts/setup-paths.sh | 53 --------------- 9 files changed, 615 deletions(-) delete mode 100755 scripts/build-midas.sh delete mode 100755 scripts/build-spike.sh delete mode 100755 scripts/build-vcs.sh delete mode 100755 scripts/build-verilator.sh delete mode 100755 scripts/run-midas.sh delete mode 100755 scripts/run-spike.sh delete mode 100755 scripts/run-vcs.sh delete mode 100755 scripts/run-verilator.sh delete mode 100755 scripts/setup-paths.sh diff --git a/scripts/build-midas.sh b/scripts/build-midas.sh deleted file mode 100755 index 7e9da811..00000000 --- a/scripts/build-midas.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -help () { - echo "Build a cycle-accurate MIDAS simulator which uses a realistic DRAM model." - echo 'The cycle-accurate simulator will match `customConfig` in' - echo '`configs/GemminiCustomConfigs.scala`.' - echo - echo "Usage: $0 [-h|--help] [--debug] [--vcs] DRAM_CONTROLLER_MODEL" - echo - echo "Options:" - echo " DRAM_CONTROLLER_MODEL Either DDR3FCFS or DDR3FRFCFS or DDR3FRFCFSLLC4MB." - echo ' FCFS is "first come, first serve."' - echo ' FRFCFS is "first ready, first come, first serve.' - echo - echo " debug Builds a MIDAS simulator which generates waveforms." - echo " Without this option, the simulator will not generate" - echo " any waveforms." - echo - echo " vcs Builds a MIDAS simulator which runs on VCS. By" - echo " default, this script will instead build a MIDAS" - echo " simulator which runs on Verilator." - echo "Examples:" - echo " $0 DDR3FRFCFS" - echo " $0 --debug DDR3FRFCFSLLC4MB" - exit -} - -if [ $# -le 0 ]; then - help -fi - -show_help=0 -debug="" -simulator="verilator" -dram_model="" - -while [ $# -gt 0 ] ; do - case $1 in - -h | --help) show_help=1 ;; - --debug) debug="-debug" ;; - --vcs) simulator="vcs" ;; - *) dram_model=$1 - esac - - shift -done - -if [ $show_help -eq 1 ]; then - help -fi - -if [ dram_model == "" ]; then - echo DRAM model must be provided. -fi - -export SYSLIBS=" $SYSLIBS -l:libdwarf.so -l:libelf.so -lz -lgmp " - -cd ../../sims/firesim/ -source sourceme-f1-manager.sh --skip-ssh-setup &> build.log - -cd sim/ -make ${simulator}${debug} TARGET_CONFIG=${dram_model}_WithDefaultFireSimBridges_WithFireSimConfigTweaks_chipyard.CustomGemminiSoCConfig - diff --git a/scripts/build-spike.sh b/scripts/build-spike.sh deleted file mode 100755 index 1df963ab..00000000 --- a/scripts/build-spike.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -help () { - echo "Build a functional simulator for RISCV Gemmini programs, matching" - echo '`customConfig` in `configs/GemminiCustomConfigs.scala`.' - echo - echo "Usage: $0 [-h|--help]" - echo - echo "Note: On Spike, cycle counts, SoC counter values, and performance" - echo " statistics are all meaningless. Use Spike only to check if your" - echo " programs are functionally correct. For meaningful metrics, you" - echo " must run your programs on VCS, Verilator, or Firesim instead." - exit -} - -if [ $# -gt 0 ]; then - help -fi - -export GEMMINI_ONLY_GENERATE_GEMMINI_H=1 - -cd ../../sims/verilator/ -echo Generating new gemmini_params.h file... -make verilog CONFIG=CustomGemminiSoCConfig &> build.log - -cd - -cp software/gemmini-rocc-tests/include/gemmini_params.h software/libgemmini/gemmini_params.h -make -C software/libgemmini clean -make -C software/libgemmini install diff --git a/scripts/build-vcs.sh b/scripts/build-vcs.sh deleted file mode 100755 index 23f159b0..00000000 --- a/scripts/build-vcs.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -help () { - echo "Build a cycle-accurate VCS simulator for RISCV Gemmini programs," - echo 'matching `customConfig` in `configs/GemminiCustomConfigs.scala`.' - echo - echo "Usage: $0 [-h|--help] [--debug] [-j [N]]" - echo - echo "Options:" - echo " debug Builds a VCS simulator which generates waveforms. Without this" - echo " option, the simulator will not generate any waveforms." - echo " j [N] Allow N jobs at once. Default is 1." - exit -} - -show_help=0 -debug="" -j="1" - -while [ $# -gt 0 ] ; do - case $1 in - -h | --help) show_help=1 ;; - --debug) debug="debug" ;; - -j) j=$2; shift - esac - - shift -done - -if [ $show_help -eq 1 ]; then - help -fi - -cd ../../sims/vcs/ -make -j$j ${debug} CONFIG=CustomGemminiSoCConfig - diff --git a/scripts/build-verilator.sh b/scripts/build-verilator.sh deleted file mode 100755 index 477c0910..00000000 --- a/scripts/build-verilator.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -help () { - echo "Build a cycle-accurate Verilator simulator for RISCV Gemmini programs," - echo 'matching `customConfig` in `configs/GemminiCustomConfigs.scala`.' - echo - echo "Usage: $0 [-h|--help] [--debug] [-j [N]]" - echo - echo "Options:" - echo " debug Builds a Verilator simulator which generates waveforms. Without" - echo " this option, the simulator will not generate any waveforms." - echo " j [N] Allow N jobs at once. Default is 1." - exit -} - -show_help=0 -debug="" -j="1" - -while [ $# -gt 0 ] ; do - case $1 in - -h | --help) show_help=1 ;; - --debug) debug="debug" ;; - -j) j=$2; shift - esac - - shift -done - -if [ $show_help -eq 1 ]; then - help -fi - -cd ../../sims/verilator/ -make -j$j ${debug} CONFIG=CustomGemminiSoCConfig - diff --git a/scripts/run-midas.sh b/scripts/run-midas.sh deleted file mode 100755 index 8de7a0fc..00000000 --- a/scripts/run-midas.sh +++ /dev/null @@ -1,136 +0,0 @@ -#!/bin/bash - -ROOT="$PWD/" - -WAVEFORM_VCD="waveforms/midas-waveform.vcd" -WAVEFORM_VPD="waveforms/midas-waveform.vpd" - -help () { - echo "Run a RISCV Gemmini program on Verilator, a cycle-accurate simulator," - echo "using MIDAS to simulate a realistic DRAM model." - echo - echo "Usage: $0 [-h|--help] [--pk] [--debug] [--vcs] DRAM_CONTROLLER_MODEL BINARY" - echo - echo "Options:" - echo " DRAM_CONTROLLER_MODEL Either DDR3FCFS or DDR3FRFCFS or DDR3FRFCFSLLC4MB." - echo ' FCFS is "first come, first serve."' - echo ' FRFCFS is "first ready, first come, first serve.' - echo - echo " pk Run binaries on the proxy kernel, which enables" - echo " virtual memory and a few syscalls. If this option is" - echo " not set, binaries will be run in baremetal mode." - echo - echo " debug Use the debug version of the MIDAS simulator, which" - echo " will output a waveform to \`$WAVEFORM_VCD\` or" - echo " \`$WAVEFORM_VPD\`." - echo - echo " vcs Runs the MIDAS simulator on VCS. By default, this" - echo " script will instead run on Verilator." - echo - echo 'Note: Run this command after running `scripts/build-midas.sh` or' - echo ' `scripts/build-midas.sh --debug`.' - exit -} - -if [ $# -le 0 ]; then - help -fi - -show_help=0 -pk=0 -debug=0 -vcs=0 -dram_model="" -binary="" -non_flag_arg="" - -while [ $# -gt 0 ] ; do - case $1 in - --pk) pk=1 ;; - --debug) debug=1 ;; - --vcs) vcs=1 ;; - -h | --help) show_help=1 ;; - *) non_flag_arg=$1 - esac - - if [ "$non_flag_arg" != "" ] && [ "$dram_model" == "" ]; then - dram_model="$non_flag_arg" - elif [ "$non_flag_arg" != "" ]; then - binary="$non_flag_arg"; - fi - - non_flag_arg="" - shift -done - -if [ $show_help -eq 1 ]; then - help -fi - -if [ $pk -eq 1 ]; then - default_suffix="-pk" - PK="pk -p" -else - default_suffix="-baremetal" - PK="" -fi - -if [ $vcs -eq 1 ]; then - simulator="FireSim" - WAVEFORM="${ROOT}${WAVEFORM_VPD}" -else - simulator="VFireSim" - WAVEFORM="${ROOT}${WAVEFORM_VCD}" -fi - -if [ $debug -eq 1 ]; then - DEBUG="-debug" - waveform_flag="+waveform=$WAVEFORM" -else - DEBUG="" - waveform_flag="" -fi - -path="" -suffix="" - -for dir in bareMetalC mlps imagenet transformers ; do - if [ -f "software/gemmini-rocc-tests/build/${dir}/${binary}$default_suffix" ]; then - path="${ROOT}/software/gemmini-rocc-tests/build/${dir}/" - suffix=$default_suffix - fi -done - -full_binary_path="${path}${binary}${suffix}" - -if [ ! -f "${full_binary_path}" ]; then - echo "Binary not found: $full_binary_path" - exit 1 -fi - -cd ../../sims/firesim/ -source sourceme-f1-manager.sh &> build.log - -cd sim/ - -cd generated-src/f1/FireSim-${dram_model}_WithDefaultFireSimBridges_WithFireSimConfigTweaks_chipyard.CustomGemminiSoCConfig-BaseF1Config - -if [ ! -f ./${simulator}${DEBUG} ]; then - echo "Simulator not found: ./${simulator}${DEBUG}" - echo 'Did you run `./scripts/build-midas.sh`?' -fi - -sim_args="+vcs+initreg+0 +vcs+initmem+0 +fesvr-step-size=128 +mm_relaxFunctionalModel_0=0 +mm_openPagePolicy_0=1 +mm_backendLatency_0=2 +mm_dramTimings_tAL_0=0 +mm_dramTimings_tCAS_0=14 +mm_dramTimings_tCMD_0=1 +mm_dramTimings_tCWD_0=10 +mm_dramTimings_tCCD_0=4 +mm_dramTimings_tFAW_0=25 +mm_dramTimings_tRAS_0=33 +mm_dramTimings_tREFI_0=7800 +mm_dramTimings_tRC_0=47 +mm_dramTimings_tRCD_0=14 +mm_dramTimings_tRFC_0=160 +mm_dramTimings_tRRD_0=8 +mm_dramTimings_tRP_0=14 +mm_dramTimings_tRTP_0=8 +mm_dramTimings_tRTRS_0=2 +mm_dramTimings_tWR_0=15 +mm_dramTimings_tWTR_0=8 +mm_rowAddr_offset_0=18 +mm_rowAddr_mask_0=65535 +mm_rankAddr_offset_0=16 +mm_rankAddr_mask_0=3 +mm_bankAddr_offset_0=13 +mm_bankAddr_mask_0=7 +shmemportname0=0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +macaddr0=00:00:00:00:00:02 +niclog0=niclog0 +linklatency0=6405 +netbw0=100 +netburst0=8 +nic-loopback0 +tracefile=TRACEFILE +blkdev-in-mem0=128 +blkdev-log0=blkdev-log0 +autocounter-readrate=1000 +autocounter-filename=AUTOCOUNTERFILE +max-cycles=100000000 +dramsim +dramsim_ini_dir=/home/eecs/hngenc/chip/generators/testchipip/src/main/resources/dramsim2_ini" - -if [ $dram_model == "DDR3FRFCFS" ] || [ $dram_model == "DDR3FRFCFSLLC4MB" ]; then - sim_args="$sim_args +mm_schedulerWindowSize_0=8 +mm_transactionQueueDepth_0=8" -fi - -if [ $dram_model == "DDR3FRFCFSLLC4MB" ]; then - sim_args="$sim_args +mm_llc_wayBits_0=3 +mm_llc_setBits_0=12 +mm_llc_blockBits_0=7 +mm_llc_activeMSHRs_0=8" -fi - -./${simulator}${DEBUG} ${PK} ${full_binary_path} ${waveform_flag} \ - $sim_args \ - 2>/dev/null - diff --git a/scripts/run-spike.sh b/scripts/run-spike.sh deleted file mode 100755 index 1638b76c..00000000 --- a/scripts/run-spike.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash - -help () { - echo "Run a RISCV Gemmini program on Spike, our functional ISA simulator" - echo - echo "Usage: $0 [-h|--help] [--pk] BINARY" - echo - echo "Options:" - echo " pk Run binaries on the proxy kernel, which enables virtual memory" - echo " and a few syscalls. If this option is not set, binaries will be" - echo " run in baremetal mode." - echo " BINARY The RISCV binary that you want to run. This can either be the" - echo ' name of a program in `software/gemmini-rocc-tests`, or it can' - echo " be the full path to a binary you compiled." - echo - echo "Examples:" - echo " $0 resnet50" - echo " $0 --pk mvin_mvout" - echo " $0 path/to/binary-baremetal" - echo - echo 'Note: Run this command after running `scripts/build-spike.sh`.' - echo - echo "Note: On Spike, cycle counts, SoC counter values, and performance" - echo " statistics are all meaningless. Use Spike only to check if your" - echo " programs are functionally correct. For meaningful metrics, you" - echo " must run your programs on VCS, Verilator, or Firesim instead." - exit -} - -if [ $# -le 0 ]; then - help -fi - -pk=0 -show_help=0 -binary="" - -while [ $# -gt 0 ] ; do - case $1 in - --pk) pk=1 ;; - -h | --help) show_help=1 ;; - *) binary=$1 - esac - - shift -done - -if [ $show_help -eq 1 ]; then - help -fi - -if [ $pk -eq 1 ]; then - default_suffix="-pk" - PK="pk -p" -else - default_suffix="-baremetal" - PK="" -fi - -path="" -suffix="" - -for dir in bareMetalC mlps imagenet transformers ; do - if [ -f "software/gemmini-rocc-tests/build/${dir}/${binary}$default_suffix" ]; then - path="software/gemmini-rocc-tests/build/${dir}/" - suffix=$default_suffix - fi -done - -full_binary_path="${path}${binary}${suffix}" - -if [ ! -f "${full_binary_path}" ]; then - echo "Binary not found: $full_binary_path" - exit 1 -fi - -spike --extension=gemmini $PK "${full_binary_path}" - diff --git a/scripts/run-vcs.sh b/scripts/run-vcs.sh deleted file mode 100755 index 40ce9bda..00000000 --- a/scripts/run-vcs.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash - -ROOT="$PWD/" - -WAVEFORM="waveforms/waveform.vpd" - -help () { - echo "Run a RISCV Gemmini program on VCS, a cycle-accurate simulator" - echo - echo "Usage: $0 [--pk] [--debug] BINARY" - echo - echo "Options:" - echo " pk Run binaries on the proxy kernel, which enables virtual memory" - echo " and a few syscalls. If this option is not set, binaries will be" - echo " run in baremetal mode." - echo - echo " debug Use the debug version of the VCS simulator, which will output" - echo " a waveform to \`$WAVEFORM\`." - echo - echo " BINARY The RISCV binary that you want to run. This can either be the" - echo ' name of a program in `software/gemmini-rocc-tests`, or it can' - echo " be the full path to a binary you compiled." - echo - echo "Examples:" - echo " $0 template" - echo " $0 --debug template" - echo " $0 --pk mvin_mvout" - echo " $0 path/to/binary-baremetal" - echo - echo 'Note: Run this command after running `scripts/build-vcs.sh` or' - echo ' `scripts/build-vcs.sh --debug`.' - exit -} - -if [ $# -le 0 ]; then - help -fi - -pk=0 -debug=0 -show_help=0 -binary="" - -while [ $# -gt 0 ] ; do - case $1 in - --pk) pk=1 ;; - --debug) debug=1 ;; - -h | --help) show_help=1 ;; - *) binary=$1 - esac - - shift -done - -if [ $show_help -eq 1 ]; then - help -fi - -if [ $pk -eq 1 ]; then - default_suffix="-pk" - PK="pk -p" -else - default_suffix="-baremetal" - PK="" -fi - -if [ $debug -eq 1 ]; then - DEBUG="-debug +permissive +ntb_random_seed_automatic +vcdplusfile=${ROOT}${WAVEFORM} +permissive-off" -else - DEBUG="" -fi - -path="" -suffix="" - -for dir in bareMetalC mlps imagenet transformers ; do - if [ -f "software/gemmini-rocc-tests/build/${dir}/${binary}$default_suffix" ]; then - path="${ROOT}/software/gemmini-rocc-tests/build/${dir}/" - suffix=$default_suffix - fi -done - -full_binary_path="${path}${binary}${suffix}" - -if [ ! -f "${full_binary_path}" ]; then - echo "Binary not found: $full_binary_path" - exit 1 -fi - -cd ../../sims/vcs/ -./simv-chipyard-CustomGemminiSoCConfig${DEBUG} $PK $full_binary_path - diff --git a/scripts/run-verilator.sh b/scripts/run-verilator.sh deleted file mode 100755 index b4f21458..00000000 --- a/scripts/run-verilator.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash - -ROOT="$PWD/" - -WAVEFORM="waveforms/waveform.vcd" - -help () { - echo "Run a RISCV Gemmini program on Verilator, a cycle-accurate simulator" - echo - echo "Usage: $0 [--pk] [--debug] BINARY" - echo - echo "Options:" - echo " pk Run binaries on the proxy kernel, which enables virtual memory" - echo " and a few syscalls. If this option is not set, binaries will be" - echo " run in baremetal mode." - echo - echo " debug Use the debug version of the Verilator simulator, which will" - echo " output a waveform to \`$WAVEFORM\`." - echo - echo " BINARY The RISCV binary that you want to run. This can either be the" - echo ' name of a program in `software/gemmini-rocc-tests`, or it can' - echo " be the full path to a binary you compiled." - echo - echo "Examples:" - echo " $0 template" - echo " $0 --debug template" - echo " $0 --pk mvin_mvout" - echo " $0 path/to/binary-baremetal" - echo - echo 'Note: Run this command after running `scripts/build-verilator.sh` or' - echo ' `scripts/build-verilator.sh --debug`.' - exit -} - -if [ $# -le 0 ]; then - help -fi - -pk=0 -debug=0 -show_help=0 -binary="" - -while [ $# -gt 0 ] ; do - case $1 in - --pk) pk=1 ;; - --debug) debug=1 ;; - -h | --help) show_help=1 ;; - *) binary=$1 - esac - - shift -done - -if [ $show_help -eq 1 ]; then - help -fi - -if [ $pk -eq 1 ]; then - default_suffix="-pk" - PK="pk -p" -else - default_suffix="-baremetal" - PK="" -fi - -if [ $debug -eq 1 ]; then - DEBUG="-debug -v ${ROOT}${WAVEFORM}" -else - DEBUG="" -fi - -path="" -suffix="" - -for dir in bareMetalC mlps imagenet transformers ; do - if [ -f "software/gemmini-rocc-tests/build/${dir}/${binary}$default_suffix" ]; then - path="${ROOT}/software/gemmini-rocc-tests/build/${dir}/" - suffix=$default_suffix - fi -done - -full_binary_path="${path}${binary}${suffix}" - -if [ ! -f "${full_binary_path}" ]; then - echo "Binary not found: $full_binary_path" - exit 1 -fi - -cd ../../sims/verilator/ -./simulator-chipyard-CustomGemminiSoCConfig${DEBUG} $PK ${full_binary_path} - diff --git a/scripts/setup-paths.sh b/scripts/setup-paths.sh deleted file mode 100755 index beb967e5..00000000 --- a/scripts/setup-paths.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash - -help () { - echo "Setup all the directories and symlinks that you need to use the scripts" - echo 'in `scripts/`.' - echo - echo "Usage: $0 [-h|--help]" - echo - exit -} - -if [ $# -gt 0 ]; then - help -fi - -if [ ! -d configs ]; then - mkdir configs/ -fi - -if [ ! -d generated-src ]; then - mkdir generated-src/ -fi - -if [ ! -d waveforms ]; then - mkdir waveforms/ -fi - -if [ ! -f configs/GemminiDefaultConfigs.scala ]; then - ln -s $PWD/src/main/scala/gemmini/Configs.scala configs/GemminiDefaultConfigs.scala -fi - -if [ ! -f configs/GemminiCustomConfigs.scala ]; then - ln -s $PWD/src/main/scala/gemmini/CustomConfigs.scala configs/GemminiCustomConfigs.scala -fi - -if [ ! -f configs/CPUConfigs.scala ]; then - sed '1,1d; $d' $PWD/src/main/scala/gemmini/CustomCPUConfigs.scala > ../chipyard/src/main/scala/config/GemminiCPUConfigs.scala - ln -s $PWD/../chipyard/src/main/scala/config/GemminiCPUConfigs.scala configs/CPUConfigs.scala -fi - -if [ ! -f configs/SoCConfigs.scala ]; then - sed '1,1d; $d' $PWD/src/main/scala/gemmini/CustomSoCConfigs.scala > ../chipyard/src/main/scala/config/GemminiSoCConfigs.scala - ln -s $PWD/../chipyard/src/main/scala/config/GemminiSoCConfigs.scala configs/SoCConfigs.scala -fi - -if [ ! -f generated-src/verilator ] && [ ! -d generated-src/verilator ]; then - ln -s $PWD/../../sims/verilator/generated-src/ generated-src/verilator 2>/dev/null -fi - -if [ ! -f generated-src/vcs ] && [ ! -d generated-src/vcs ]; then - ln -s $PWD/../../sims/vcs/generated-src/ generated-src/vcs 2>/dev/null -fi -