fixed Makefile errors
This commit is contained in:
parent
52953bc8de
commit
64030a7cc3
|
@ -2,14 +2,14 @@ TARGET = trace
|
|||
|
||||
TARGET_ARCH=riscv32
|
||||
|
||||
CC = riscv32-unknown-linux-gnu-gcc
|
||||
CC = riscv32-unknown-elf-gcc
|
||||
# compiling flags here
|
||||
#CFLAGS = -Wall -I. -O0 -nostartfiles -march=rv32i -mabi=ilp32
|
||||
CFLAGS = -Wall -I. -O0 -nostdlib -march=rv32i -mabi=ilp32 --entry main
|
||||
#CFLAGS = -Wall -I. -O0 -nodefaultlibs -march=rv32i -mabi=ilp32
|
||||
|
||||
|
||||
LINKER = riscv32-unknown-linux-gnu-gcc
|
||||
LINKER = riscv32-unknown-elf-gcc
|
||||
# linking flags here
|
||||
LFLAGS = -I. --entry main
|
||||
LIBS = $(EXTRA_LIBS)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
#define TRACE (*(unsigned char *)0x40000000)
|
||||
|
||||
void main(void) {
|
||||
int main(void) {
|
||||
TRACE = 'H';
|
||||
TRACE = 'e';
|
||||
|
||||
|
|
|
@ -2,14 +2,14 @@ TARGET = trace2
|
|||
|
||||
TARGET_ARCH=riscv32
|
||||
|
||||
CC = riscv32-unknown-linux-gnu-gcc
|
||||
CC = riscv32-unknown-elf-gcc
|
||||
# compiling flags here
|
||||
#CFLAGS = -Wall -I. -O0 -nostartfiles -march=rv32i -mabi=ilp32
|
||||
CFLAGS = -Wall -I. -O0 -nostdlib -march=rv32i -mabi=ilp32 --entry main
|
||||
#CFLAGS = -Wall -I. -O0 -nodefaultlibs -march=rv32i -mabi=ilp32
|
||||
|
||||
|
||||
LINKER = riscv32-unknown-linux-gnu-gcc
|
||||
LINKER = riscv32-unknown-elf-gcc
|
||||
# linking flags here
|
||||
LFLAGS = -I. --entry main
|
||||
LIBS = $(EXTRA_LIBS)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
#define TRACE (*(unsigned char *)0x40000000)
|
||||
|
||||
void main(void) {
|
||||
int main(void) {
|
||||
int i;
|
||||
for(i=0;i<10;i++) {
|
||||
TRACE = 'a' + i;
|
||||
|
|
|
@ -2,14 +2,14 @@ TARGET = trace3
|
|||
|
||||
TARGET_ARCH=riscv32
|
||||
|
||||
CC = riscv32-unknown-linux-gnu-gcc
|
||||
CC = riscv32-unknown-elf-gcc
|
||||
# compiling flags here
|
||||
#CFLAGS = -Wall -I. -O0 -nostartfiles -march=rv32i -mabi=ilp32
|
||||
CFLAGS = -Wall -I. -O0 -nostdlib -march=rv32i -mabi=ilp32 --entry main
|
||||
#CFLAGS = -Wall -I. -O0 -nodefaultlibs -march=rv32i -mabi=ilp32
|
||||
|
||||
|
||||
LINKER = riscv32-unknown-linux-gnu-gcc
|
||||
LINKER = riscv32-unknown-elf-gcc
|
||||
# linking flags here
|
||||
LFLAGS = -I. --entry main
|
||||
LIBS = $(EXTRA_LIBS)
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
#define TRACE (*(unsigned char *)0x40000000)
|
||||
|
||||
void main(void) {
|
||||
int main(void) {
|
||||
char msg[] = "abcdefg\n";
|
||||
int i;
|
||||
|
||||
for (i=0; i<5; i++) {
|
||||
TRACE = msg[i];
|
||||
}
|
||||
|
||||
asm volatile ("rdcycle t0");
|
||||
asm volatile ("rdtime t4");
|
||||
asm volatile ("ecall");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue