forked from Github_Repos/cvw
changed fix_mem to not use hardcoded file names
This commit is contained in:
parent
bb84354a47
commit
3a520cb540
@ -1,11 +1,14 @@
|
||||
#! /usr/bin/python3
|
||||
test_dir = '../'
|
||||
gdbMemfileDir = '../linux-testvectors/intermediate-outputs/'
|
||||
fixedMemfileDir = '../linux-testvectors/'
|
||||
infiles = ['bootmemGDB.txt', 'ramGDB.txt']
|
||||
outfiles = ['bootmem.txt', 'ram.txt']
|
||||
for i in range(len(infiles)):
|
||||
with open(f'{gdbMemfileDir}{infiles[i]}', 'r') as f:
|
||||
with open(f'{fixedMemfileDir}{outfiles[i]}', 'w') as w:
|
||||
for l in f:
|
||||
w.write(f'{"".join([x[2:] for x in l.split()[:0:-1]])}\n')
|
||||
import sys,os
|
||||
|
||||
if len(sys.argv) != 3:
|
||||
sys.exit('Error fix_mem.py expects 2 args:\n fix_mem.py <input filename> <output filename>')
|
||||
inputFile = sys.argv[1]
|
||||
outputFile = sys.argv[2]
|
||||
if not os.path.exists(inputFile):
|
||||
sys.exit('Error input file '+inputFile+'not found')
|
||||
print('Translating '+os.path.basename(inputFile)+' to '+os.path.basename(outputFile))
|
||||
with open(inputFile, 'r') as f:
|
||||
with open(outputFile, 'w') as w:
|
||||
for l in f:
|
||||
w.write(f'{"".join([x[2:] for x in l.split()[:0:-1]])}\n')
|
||||
|
@ -16,7 +16,8 @@ then
|
||||
($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) &
|
||||
riscv64-unknown-elf-gdb -x gdbinit_mem
|
||||
echo "Translating Mem from GDB to Questa format"
|
||||
./fix_mem.py
|
||||
./fix_mem.py "$testVecDir/intermediate-outputs/bootmemGDB.txt" "$testVecDir/bootmem.txt"
|
||||
./fix_mem.py "$testVecDir/intermediate-outputs/ramGDB.txt" "$testVecDir/ram.txt"
|
||||
echo "Done"
|
||||
|
||||
echo "Creating debugging objdump of linux image"
|
||||
|
Loading…
Reference in New Issue
Block a user