Automated objdumping of test programs
This commit is contained in:
parent
b863315030
commit
afe643170f
4
test_programs/.gitignore
vendored
Normal file
4
test_programs/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
# Ignoring dump files
|
||||
*.dump
|
||||
*.o
|
||||
./target
|
@ -4,11 +4,10 @@ include $(TOPDIR)/Makefile.config
|
||||
#
|
||||
# Main targets
|
||||
#
|
||||
objdumps:
|
||||
$(MAKE) -C riscv_instructions
|
||||
|
||||
programs:
|
||||
$(MAKE) -C programs
|
||||
dumps:
|
||||
$(MAKE) dumps -C riscv_instructions/
|
||||
mkdir -p ${TOPDIR}/target
|
||||
find . -name '*.dump' -exec mv {} ${TOPDIR}/target \;
|
||||
|
||||
clean:
|
||||
rm -rf $(TOPDIR)/target
|
@ -11,8 +11,9 @@ RISCV_PREFIX=/opt/riscv/bin/
|
||||
RISCV_AS = $(RISCV_PREFIX)riscv64-unknown-elf-gcc -x assembler-with-cpp -march=rv64imfd
|
||||
RISCV_GCC = $(RISCV_PREFIX)riscv64-unknown-elf-gcc
|
||||
RISCV_LD = $(RISCV_PREFIX)riscv64-unknown-elf-ld
|
||||
RISCV_OBJDUMP = $(RISCV_PREFIX)riscv64-unknown-elf-objdump
|
||||
RISCV_OBJCOPY = $(RISCV_PREFIX)riscv64-unknown-elf-objcopy
|
||||
DUMP_FORMAT = ihex
|
||||
RISCV_ASFLAGS = $(RISCV_CPPFLAGS)
|
||||
RISCV_CPPFLAGS = #nil
|
||||
RISCV_CFLAGS = -Wall $(RISCV_CPPFLAGS) -march=rv64imfd
|
||||
RISCV_LDFLAGS = #nil
|
||||
RISCV_LDFLAGS = #nil
|
12
test_programs/Makefile.dumps
Normal file
12
test_programs/Makefile.dumps
Normal file
@ -0,0 +1,12 @@
|
||||
include $(TOPDIR)/Makefile.config
|
||||
|
||||
%.o: %.c
|
||||
$(RISCV_GCC) $(RISCV_CFLAGS) -c $<
|
||||
|
||||
|
||||
%.dump: %.o
|
||||
$(RISCV_OBJCOPY) -j .text -O $(DUMP_FORMAT) $< $@
|
||||
|
||||
clean:
|
||||
rm -rf *.o 2> /dev/null
|
||||
rm -rf *.dump 2> /dev/null
|
@ -1,24 +0,0 @@
|
||||
include $(TOPDIR)/Makefile.config
|
||||
|
||||
COVERAGE = $(TOPDIR)/riscv_instructions
|
||||
|
||||
AS = $(RISCV_AS) -c
|
||||
GCC = $(RISCV_GCC)
|
||||
LD = $(RISCV_LD)
|
||||
|
||||
INCPATH += -I$(TOPDIR) -I$(COVERAGE)
|
||||
ASFLAGS = $(RISCV_ASFLAGS) $(INCPATH)
|
||||
CFLAGS = $(RISCV_CFLAGS) $(INCPATH)
|
||||
|
||||
# Rules
|
||||
%.a:
|
||||
$(AR) rcv $@ $^
|
||||
|
||||
%.o: %.c
|
||||
$(GCC) $(CFLAGS) -c $<
|
||||
|
||||
%.o: %.s
|
||||
$(AS) $(ASFLAGS) -c $<
|
||||
|
||||
$(PROGRAMS):
|
||||
$(LD) $+ -o $@
|
@ -1,2 +1,4 @@
|
||||
TOPDIR = ../
|
||||
include $(TOPDIR)/Makefile.objdumps
|
||||
dumps:
|
||||
make dumps -C boolean_logic/
|
||||
make dumps -C jump_instructions/
|
||||
make dumps -C simple_arithmetics/
|
4
test_programs/riscv_instructions/boolean_logic/Makefile
Normal file
4
test_programs/riscv_instructions/boolean_logic/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
TOPDIR = ../..
|
||||
include $(TOPDIR)/Makefile.dumps
|
||||
|
||||
dumps: comparisons.dump if.dump switch.dump
|
@ -0,0 +1,4 @@
|
||||
TOPDIR = ../..
|
||||
include $(TOPDIR)/Makefile.dumps
|
||||
|
||||
dumps: jump.dump ret.dump
|
@ -1,15 +0,0 @@
|
||||
fe010113
|
||||
00813c23
|
||||
02010413
|
||||
fe042623
|
||||
00100793
|
||||
fef42423
|
||||
fec42783
|
||||
00078713
|
||||
fe842783
|
||||
00f707bb
|
||||
fef42623
|
||||
00000013
|
||||
01813403
|
||||
02010113
|
||||
00008067
|
Binary file not shown.
@ -0,0 +1,4 @@
|
||||
TOPDIR = ../..
|
||||
include $(TOPDIR)/Makefile.dumps
|
||||
|
||||
dumps: unsigned_addition.dump unsigned_division.dump unsigned_multiplication.dump unsigned_substraction.dump
|
Loading…
Reference in New Issue
Block a user