mirror of
https://github.com/openhwgroup/cvw.git
synced 2025-04-20 03:47:20 -04:00
added lpddrtest.
This commit is contained in:
parent
5b4d3f49b0
commit
7c3e93bb2c
4 changed files with 59 additions and 0 deletions
19
tests/custom/lpddrtest/Makefile
Normal file
19
tests/custom/lpddrtest/Makefile
Normal file
|
@ -0,0 +1,19 @@
|
|||
TARGETDIR := lpddr_test
|
||||
TARGET := $(TARGETDIR)/$(TARGETDIR).elf
|
||||
ROOT := ..
|
||||
LIBRARY_DIRS := ${ROOT}/crt0
|
||||
LIBRARY_FILES := crt0
|
||||
|
||||
MARCH :=-march=rv64imfdczicbom
|
||||
MABI :=-mabi=lp64d
|
||||
LINKER := ${ROOT}/linker8000-0000.x
|
||||
LINK_FLAGS :=$(MARCH) $(MABI) -nostartfiles -Wl,-Map=$(TARGET).map
|
||||
|
||||
CFLAGS =$(MARCH) $(MABI) -Wa,-alhs -Wa,-L -mcmodel=medany -mstrict-align -O2
|
||||
CC=riscv64-unknown-elf-gcc
|
||||
DA=riscv64-unknown-elf-objdump -d
|
||||
|
||||
|
||||
include $(ROOT)/makefile.inc
|
||||
|
||||
|
5
tests/custom/lpddrtest/header.h
Normal file
5
tests/custom/lpddrtest/header.h
Normal file
|
@ -0,0 +1,5 @@
|
|||
#ifndef __header
|
||||
#define __header
|
||||
|
||||
void lpddr_test();
|
||||
#endif
|
29
tests/custom/lpddrtest/lpddr_test.s
Normal file
29
tests/custom/lpddrtest/lpddr_test.s
Normal file
|
@ -0,0 +1,29 @@
|
|||
.section .text
|
||||
.globl lpddr_test
|
||||
.type lpddr_test, @function
|
||||
lpddr_test:
|
||||
li t1, 0x90000000
|
||||
addi t5, t1, 0
|
||||
li t2, 0xAABBCCDD00112233
|
||||
|
||||
li t3, 10
|
||||
li t4, 0
|
||||
loop_write:
|
||||
beq t4, t3, done_write
|
||||
sd t2, 0(t5)
|
||||
addi t5, t5, 8
|
||||
addi t4, t4, 1
|
||||
j loop_write
|
||||
done_write:
|
||||
|
||||
li t4, 0
|
||||
addi t5, t1, 0
|
||||
loop_read:
|
||||
beq t4, t3, done_read
|
||||
ld t6, 0(t5)
|
||||
addi t5, t5, 8
|
||||
addi t4, t4, 1
|
||||
j loop_read
|
||||
done_read:
|
||||
ret
|
||||
|
6
tests/custom/lpddrtest/main.c
Normal file
6
tests/custom/lpddrtest/main.c
Normal file
|
@ -0,0 +1,6 @@
|
|||
#include "header.h"
|
||||
|
||||
int main(){
|
||||
lpddr_test();
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue