From 01ca22af49fdf982555a06ef9e924e3e5bbf67f6 Mon Sep 17 00:00:00 2001
From: bbracker <bbracker@hmc.edu>
Date: Fri, 16 Jul 2021 12:27:15 -0400
Subject: [PATCH] changed stop of linux boot from arch_cpu_idle to do_idle

---
 .../testvector-generation/gdbinit_qemulog     |  2 +-
 .../testvector-generation/logAllBuildroot.sh  |  4 +-
 .../regression/wave-dos/peripheral-waves.do   | 51 +++++++++++++++----
 3 files changed, 45 insertions(+), 12 deletions(-)

diff --git a/wally-pipelined/linux-testgen/testvector-generation/gdbinit_qemulog b/wally-pipelined/linux-testgen/testvector-generation/gdbinit_qemulog
index f4318ad1e..42137c059 100755
--- a/wally-pipelined/linux-testgen/testvector-generation/gdbinit_qemulog
+++ b/wally-pipelined/linux-testgen/testvector-generation/gdbinit_qemulog
@@ -1,7 +1,7 @@
 set pagination off
 target extended-remote :1236
 file ../buildroot-image-output/vmlinux
-b arch_cpu_idle
+b do_idle
 c
 c
 c
diff --git a/wally-pipelined/linux-testgen/testvector-generation/logAllBuildroot.sh b/wally-pipelined/linux-testgen/testvector-generation/logAllBuildroot.sh
index 52f0fe6fc..797b9f7d0 100755
--- a/wally-pipelined/linux-testgen/testvector-generation/logAllBuildroot.sh
+++ b/wally-pipelined/linux-testgen/testvector-generation/logAllBuildroot.sh
@@ -14,7 +14,7 @@ outDir="../linux-testvectors"
 # Uncomment this version for QEMU debugging of kernel
 #  - good for poking around VM if it boots up
 #  - good for running QEMU commands (press "Ctrl-A" then "c" to open QEMU command prompt)
-$customQemu -M virt -nographic -bios $imageDir/fw_jump.elf -kernel $imageDir/Image -append "root=/dev/vda ro" -initrd $imageDir/rootfs.cpio 
+#$customQemu -M virt -nographic -bios $imageDir/fw_jump.elf -kernel $imageDir/Image -append "root=/dev/vda ro" -initrd $imageDir/rootfs.cpio 
 # Uncomment this version for GDB debugging of kernel
 #  - attempts to load in symbols from "vmlinux"
 #  - good for looking at backtraces when Linux gets stuck for some reason 
@@ -41,4 +41,4 @@ $customQemu -M virt -nographic -bios $imageDir/fw_jump.elf -kernel $imageDir/Ima
 # =========== Just Do the Thing ========== 
 # Uncomment this version for the whole thing 
 # - Logs info needed by buildroot testbench
-#($customQemu -M virt -nographic -bios $imageDir/fw_jump.elf -kernel $imageDir/Image -append "root=/dev/vda ro" -initrd $imageDir/rootfs.cpio -d nochain,cpu,in_asm -serial /dev/null -singlestep -gdb tcp::1236 -S 2>&1 >/dev/null | ./parse_qemu.py | ./parse_gdb_output.py "$outDir") & riscv64-unknown-elf-gdb -x gdbinit_qemulog
+($customQemu -M virt -nographic -bios $imageDir/fw_jump.elf -kernel $imageDir/Image -append "root=/dev/vda ro" -initrd $imageDir/rootfs.cpio -d nochain,cpu,in_asm -serial /dev/null -singlestep -gdb tcp::1236 -S 2>&1 >/dev/null | ./parse_qemu.py | ./parse_gdb_output.py "$outDir") & riscv64-unknown-elf-gdb -x gdbinit_qemulog
diff --git a/wally-pipelined/regression/wave-dos/peripheral-waves.do b/wally-pipelined/regression/wave-dos/peripheral-waves.do
index a42bfbd43..59515fd02 100644
--- a/wally-pipelined/regression/wave-dos/peripheral-waves.do
+++ b/wally-pipelined/regression/wave-dos/peripheral-waves.do
@@ -42,7 +42,6 @@ add wave -hex /testbench/dut/hart/ifu/InstrM
 add wave -hex /testbench/dut/hart/ieu/c/InstrValidM
 add wave /testbench/InstrMName
 add wave /testbench/dut/uncore/dtim/memwrite
-add wave -hex /testbench/dut/hart/MemPAdrM
 add wave -hex /testbench/dut/hart/WriteDataM
 add wave -hex /testbench/dut/uncore/HADDR
 add wave -hex /testbench/dut/uncore/HWDATA
@@ -63,16 +62,50 @@ add wave -hex /testbench/dut/hart/priv/csr/TrapM
 add wave -hex /testbench/dut/hart/priv/csr/UnalignedNextEPCM
 add wave -hex /testbench/dut/hart/priv/csr/genblk1/csrm/WriteMEPCM
 add wave -hex /testbench/dut/hart/priv/csr/genblk1/csrm/MEPC_REGW
-add wave -divider
+
+add wave -divider RegFile
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[1]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[2]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[3]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[4]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[5]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[6]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[7]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[8]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[9]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[10]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[11]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[12]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[13]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[14]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[15]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[16]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[17]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[18]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[19]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[20]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[21]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[22]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[23]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[24]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[25]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[26]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[27]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[28]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[29]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[30]
+add wave -hex /testbench/dut/hart/ieu/dp/regf/rf[31]
 
 # peripherals
-#add wave -hex /testbench/dut/uncore/plic/*
-#add wave -hex /testbench/dut/uncore/plic/intPriority
-#add wave -hex /testbench/dut/uncore/plic/pendingArray
-#add wave -divider
-#add wave -hex /testbench/dut/uncore/uart/u/*
-#add wave -divider
-#add wave -hex /testbench/dut/uncore/gpio/*
+add wave -divider PLIC
+add wave -hex /testbench/dut/hart/priv/csr/TrapM
+add wave -hex /testbench/dut/uncore/genblk2/plic/*
+add wave -hex /testbench/dut/uncore/genblk2/plic/intPriority
+add wave -hex /testbench/dut/uncore/genblk2/plic/pendingArray
+add wave -divider UART
+add wave -hex /testbench/dut/uncore/genblk4/uart/u/*
+add wave -divider GPIO
+add wave -hex /testbench/dut/uncore/genblk3/gpio/*
 #add wave -divider
 #add wave -hex /testbench/dut/hart/ebu/*
 #add wave -divider