diff --git a/wally-pipelined/linux-testgen/testvector-generation/GenerateCheckpoint.sh b/wally-pipelined/linux-testgen/testvector-generation/GenerateCheckpoint.sh index e9bf5167d..bd54523e1 100755 --- a/wally-pipelined/linux-testgen/testvector-generation/GenerateCheckpoint.sh +++ b/wally-pipelined/linux-testgen/testvector-generation/GenerateCheckpoint.sh @@ -10,7 +10,7 @@ customQemu="/courses/e190ax/qemu_sim/rv64_initrd/qemu_experimental/qemu/build/qe # use on other systems #customQemu="qemu-system-riscv64" -instrs=8500000 +instrs=50000000 imageDir="../buildroot-image-output" outDir="../linux-testvectors/checkpoint$instrs" @@ -24,9 +24,11 @@ if [[ $REPLY =~ ^[Yy]$ ]] then mkdir -p $outDir mkdir -p $intermedDir + # Simulate QEMU, parse QEMU trace, run GDB script which logs a bunch of data at the checkpoint ($customQemu -M virt -nographic -bios $imageDir/fw_jump.elf -kernel $imageDir/Image -append "root=/dev/vda ro" -initrd $imageDir/rootfs.cpio -rtc clock=vm -icount shift=1 -d nochain,cpu,in_asm -serial /dev/null -singlestep -gdb tcp::1240 -S 2>&1 1>&2 | ./parse_qemu.py | ./parseNew.py | ./remove_dup.awk > $intermedDir/rawTrace.txt) & riscv64-unknown-elf-gdb -x ./checkpoint.gdb -ex "createCheckpoint $instrs \"$intermedDir\"" - ./fix_mem.py "$intermedDir/ramGDB.txt" "$outDir/ram.txt" + # Post-Process GDB outputs ./parseState.py "$outDir" + ./fix_mem.py "$intermedDir/ramGDB.txt" "$outDir/ram.txt" else echo "You can change the number of instructions by editing the \"instrs\" variable in this script." echo "Have a nice day!" diff --git a/wally-pipelined/linux-testgen/testvector-generation/checkpoint.gdb b/wally-pipelined/linux-testgen/testvector-generation/checkpoint.gdb index 8ffd8e982..1b2c64f16 100755 --- a/wally-pipelined/linux-testgen/testvector-generation/checkpoint.gdb +++ b/wally-pipelined/linux-testgen/testvector-generation/checkpoint.gdb @@ -7,6 +7,9 @@ define createCheckpoint # QEMU must also use TCP port 1240 target extended-remote :1240 + + # QEMU Config + maintenance packet Qqemu.PhyMemMode:1 # Argument Parsing set $statePath=$arg1 @@ -29,14 +32,14 @@ define createCheckpoint # Log all registers to a file printf "GDB storing state to %s\n", $statePath - set logging file $statePath + eval "set logging file %s", $statePath set logging on info all-registers set logging off # Log main memory to a file printf "GDB storing RAM to %s\n", $ramPath - set logging file ../linux-testvectors/intermediate-outputs/ramGDB.txt + eval "set logging file %s", $ramPath set logging on x/134217728xb 0x80000000 set logging off diff --git a/wally-pipelined/linux-testgen/testvector-generation/parseState.py b/wally-pipelined/linux-testgen/testvector-generation/parseState.py index 0a0c8c8b5..cd49ccdf8 100755 --- a/wally-pipelined/linux-testgen/testvector-generation/parseState.py +++ b/wally-pipelined/linux-testgen/testvector-generation/parseState.py @@ -1,5 +1,5 @@ #! /usr/bin/python3 -import sys +import sys, os ################ # Helper Funcs # @@ -29,8 +29,8 @@ print("Begin parsing state.") # Parse Args if len(sys.argv) != 2: sys.exit('Error parseState.py expects 1 arg:\n parseState.py ') -outDir = sys.argv[1] -stateGDBpath = outDir+'/intermediate-outputs/stateGDB1K.txt' +outDir = sys.argv[1]+'/' +stateGDBpath = outDir+'intermediate-outputs/stateGDB.txt' if not os.path.exists(stateGDBpath): sys.exit('Error input file '+stateGDBpath+'not found')