mirror of
https://github.com/openhwgroup/cvw
synced 2025-01-23 13:04:28 +00:00
Building infrastructure for coverage directed tests
This commit is contained in:
parent
f6bc499f34
commit
4a1592ccf8
1
.gitignore
vendored
1
.gitignore
vendored
@ -111,3 +111,4 @@ sim/imperas.log
|
||||
sim/results-error/
|
||||
sim/test1.rep
|
||||
sim/vsim.log
|
||||
tests/coverage/*.S
|
||||
|
@ -1,19 +1,21 @@
|
||||
TARGET = badinstr
|
||||
SRCS = $(wildcard *.S)
|
||||
PROGS = $(patsubst %.S,%,$(SRCS))
|
||||
|
||||
$(TARGET).objdump: $(TARGET)
|
||||
riscv64-unknown-elf-objdump -D $(TARGET) > $(TARGET).objdump
|
||||
all: $(PROGS)
|
||||
|
||||
%: %.S WALLY-init-lib.h Makefile
|
||||
echo $@
|
||||
riscv64-unknown-elf-gcc -g -o $@.elf -march=rv64gc -mabi=lp64 -mcmodel=medany \
|
||||
-nostartfiles -T../../examples/link/link.ld $@.S
|
||||
riscv64-unknown-elf-objdump -D $@.elf > $@.objdump
|
||||
|
||||
$(TARGET): $(TARGET).S WALLY-init-lib.S Makefile
|
||||
riscv64-unknown-elf-gcc -g -o $(TARGET) -march=rv64gc -mabi=lp64 -mcmodel=medany \
|
||||
-nostartfiles -T../../examples/link/link.ld $(TARGET).S
|
||||
|
||||
sim:
|
||||
spike +signature=$(TARGET).signature.output +signature-granularity=8 $(TARGET)
|
||||
diff --ignore-case $(TARGET).signature.output $(TARGET).reference_output || exit
|
||||
sim: %.elf
|
||||
spike +signature=%.signature.output +signature-granularity=8 %.elf
|
||||
diff --ignore-case %.signature.output %.reference_output || exit
|
||||
echo "Signature matches! Success!"
|
||||
|
||||
clean:
|
||||
rm -f $(TARGET) $(TARGET).objdump $(TARGET).signature.output
|
||||
rm -f *.elf *.objdump *.signature.output
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////
|
||||
// WALLY-init-lib.S
|
||||
// WALLY-init-lib.h
|
||||
//
|
||||
// Written: David_Harris@hmc.edu 21 March 2023
|
||||
//
|
@ -24,11 +24,12 @@
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// load code to initalize stack, handle interrupts, terminate
|
||||
#include "WALLY-init-lib.S"
|
||||
#include "WALLY-init-lib.h"
|
||||
|
||||
main:
|
||||
.word 0x00000033 // legal instruction
|
||||
.word 0x80000033 // illegal instruction
|
||||
.word 0x00000033 // legal R-type instruction
|
||||
.word 0x80000033 // illegal R-type instruction
|
||||
.word 0x00007003 // illegal Load instruction
|
||||
.word 0x00000000 // illegal instruction
|
||||
|
||||
j done
|
||||
|
Loading…
Reference in New Issue
Block a user