diff --git a/validation/clean-disass.sh b/validation/clean-disass.sh new file mode 100755 index 0000000..7a8b696 --- /dev/null +++ b/validation/clean-disass.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +sync + +dut="$1" +ref="$2" + +sed -i 's/\(lui.*,0x\)fff\(.....$\)/\1\2/' $dut +sed -i 's/\(lui.*,0x\)fff\(.....$\)/\1\2/' $dut +sed -i 's/add.*zero,zero,0 # 0/nop/' $dut +sed -i 's/add\(.*\),zero,\(-*[0-9]*\) # .*/li\1,\2/' $dut +sed -i 's/jal\(.*\)zero,\([0-9]*\)/j\1\2/' $dut +sed -i 's/jr\(.*\),0x0$/jr\1/' $dut +sed -i 's/add\(.*\),0 #.*$/mv\1/' $dut +sed -i 's/csrrs\(.*\),zero$/csrr\1/' $dut +sed -i 's/csrrw\tzero,\(.*\)$/csrw\t\1/' $dut +sed -i 's/xor\(.*\),-1 /not\1 /' $dut +sed -i '/Opcode for ins/d' $dut + +sed -i 's/ <.*$//' $ref +sed -i '/^80......$/d' $ref +sed -i '/jbuch/d' $ref +sed -i '/Disassem/d' $ref +sed -i '/littleriscv/d' $ref +sed -i '/^$/d' $ref +sed -i '/^[0-9a-f]*$/d' $ref + +sed -i '/nop/d' $ref $dut +sed -i 's/ #.*$//' $ref $dut + diff --git a/validation/runtest.sh b/validation/runtest.sh new file mode 100755 index 0000000..b530dc5 --- /dev/null +++ b/validation/runtest.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -e -o pipefail + +DIR=`dirname $(readlink -f $0)` + +tst=$1 +work=$DIR/riscof_work + +cargo build +../target/debug/archtest $work/$tst/dut/my.elf $work/$tst/dut/DUT-rriscv.signature 2>$work/$tst/dut/DUT.disass || true +./clean-disass.sh $work/$tst/dut/DUT.disass $work/$tst/ref/ref.disass + +echo meld $work/$tst/dut/DUT.disass $work/$tst/ref/ref.disass +echo meld $work/$tst/dut/DUT-rriscv.signature $work/$tst/ref/Reference-sail_c_simulator.signature