2021-08-25 15:54:47 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# use on tera.
|
2021-07-09 21:03:47 +00:00
|
|
|
customQemu="/courses/e190ax/qemu_sim/rv64_initrd/qemu_experimental/qemu/build/qemu-system-riscv64"
|
2021-08-25 15:54:47 +00:00
|
|
|
# use on other systems
|
|
|
|
#customQemu="qemu-system-riscv64"
|
|
|
|
|
2021-07-09 21:03:47 +00:00
|
|
|
imageDir="../buildroot-image-output"
|
2021-08-25 15:54:47 +00:00
|
|
|
testVecDir="../linux-testvectors"
|
|
|
|
|
2021-07-13 20:15:51 +00:00
|
|
|
($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::1235 -S 2>/dev/null >/dev/null) &
|
2021-06-10 13:58:20 +00:00
|
|
|
riscv64-unknown-elf-gdb -x gdbinit_mem
|
2021-07-09 21:03:47 +00:00
|
|
|
echo "Translating Mem from GDB to Questa format"
|
|
|
|
./fix_mem.py
|
2021-06-10 13:58:20 +00:00
|
|
|
echo "Done"
|
2021-08-25 15:54:47 +00:00
|
|
|
|
|
|
|
echo "Creating debugging objdump of linux image"
|
|
|
|
|
|
|
|
riscv64-unknown-elf-objdump -D $imageDir/vmlinux > $testVecDir/vmlinux.objdump
|
|
|
|
extractFunctionRadix.sh $testVecDir/vmlinux.objdump
|
|
|
|
echo "Done"
|