Revert deleted test folder

This commit is contained in:
Florian Zaruba 2017-05-29 15:53:10 +02:00
parent aa50f69434
commit 809f7f05b5
3 changed files with 46 additions and 0 deletions

1
test/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.v

21
test/Makefile Normal file
View file

@ -0,0 +1,21 @@
CC = riscv64-unknown-elf-gcc
OBJDUMP = riscv64-unknown-elf-objdump
ODFLAGS =
OBJCOPY = riscv64-unknown-elf-objcopy
OCFLAGS =
ASFLAGS = -c
CFLAGS =
LDFLAGS =
TESTS = add_test
.S.o:
$(CC) $(ASFLAGS) -o $@ $<
# .c.o:
# $(CC) $(CFLAGS) -o $@ -c $<
# .v: .S.o
$(TESTS): $(TESTS).o
$(OBJCOPY) -O verilog -I elf64-little $< $@.v

24
test/add_test.S Executable file
View file

@ -0,0 +1,24 @@
.text
nop
addi x1, x0, 1
addi x2, x0, 1
add x3, x1, x2
add x3, x1, x2
add x4, x2, x3
add x5, x3, x4
add x6, x4, x5
add x7, x5, x6
add x8, x6, x7
csrw mstatus, x7
add x9, x7, x8
csrr x1, mstatus
nop
L0: jal x0, L1
nop
nop
nop
nop
L1: jal x0, L0
nop
nop
addi x1, x0, 55