examples updated

This commit is contained in:
mariusmonton 2018-09-20 12:24:07 +02:00
parent 11fae01cba
commit 9961f080c9
6 changed files with 11 additions and 27 deletions

1
.gitignore vendored
View File

@ -37,3 +37,4 @@ Log.txt
helper.ods helper.ods
*.swp *.swp
RISCV_TLM RISCV_TLM
dump

View File

@ -1,4 +1,4 @@
TARGET = trace TARGET = forloop
TARGET_ARCH=riscv32 TARGET_ARCH=riscv32

View File

@ -4,7 +4,6 @@ TARGET_ARCH=riscv32
CC = riscv32-unknown-linux-gnu-gcc CC = riscv32-unknown-linux-gnu-gcc
# compiling flags here # compiling flags here
#CFLAGS = -Wall -I. -O0 -nostartfiles -march=rv32i -mabi=ilp32
CFLAGS = -Wall -I. -O0 -nostdlib -march=rv32i -mabi=ilp32 CFLAGS = -Wall -I. -O0 -nostdlib -march=rv32i -mabi=ilp32
LINKER = riscv32-unknown-linux-gnu-gcc LINKER = riscv32-unknown-linux-gnu-gcc

View File

@ -1,12 +1,10 @@
#define TRACE (*(unsigned char *)0x40000000) #define TRACE (*(unsigned char *)0x40000000)
void main(void) { void main(void) {
char msg[] = "Hello world\n"; char msg[] = "abcdefg\n";
int i; int i;
for (i=0; msg[i] != '\0'; i++) { for (i=0; i<5; i++) {
TRACE = msg[i]; TRACE = msg[i];
} }
} }

View File

@ -1,6 +1,8 @@
li t1, 150 li t1, 0xCAFE
li t2, 300 li t2, 300
li t3, -250 li t3, 0xBEEF
sw t1, -4(t2) sb t1, -6(t2)
li t1, 500 sb t3, -13(t2)
#lw t1, -4(t2) li t1, 23
lbu t1, -6(t2)
lbu t3, -13(t2)

View File

@ -1,16 +0,0 @@
.equ TRACE_BASE, 0x40000000
.section .text
.globl _start
_start:
la a0, msg
1: li a2, TRACE_BASE
# addi a0, a0, 1
# j 1b
#.section .rodata
msg:
.string "Hello World\n"