old folders removed

This commit is contained in:
mariusmonton 2018-10-06 22:20:02 +02:00
parent d405857f25
commit 557e3c1ba4
23 changed files with 0 additions and 622 deletions

View File

@ -1,52 +0,0 @@
TARGET = forloop
TARGET_ARCH=riscv32
CC = riscv32-unknown-linux-gnu-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
# linking flags here
LFLAGS = -I. --entry main
LIBS = $(EXTRA_LIBS)
# change these to proper directories where each file should be
SRCDIR = ./
OBJDIR = .
BINDIR = ./
INCDIR = -I.
LIBDIR = -L.
SOURCES := $(wildcard $(SRCDIR)/*.c)
INCLUDES := $(wildcard $(INCDIR)/*.h)
OBJECTS := $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
rm = rm -f
$(BINDIR)/$(TARGET): $(OBJECTS)
# $(LINKER) $(OBJECTS) $(LFLAGS) $(LIBS) $(LIBDIR) -o $@
riscv32-unknown-linux-gnu-objdump -d $< > dump
objcopy -Oihex $< $(TARGET).hex
# @echo "Linking complete!"
$(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.c
@echo "Compiling "$<" ..."
# $(CC) $(CFLAGS) $(INCDIR) -c $< -o $@
$(CC) $(CFLAGS) $(INCDIR) $< -o $@
@echo "Done!"
.PHONY: clean
clean:
@$(rm) $(OBJECTS)
@echo "Cleanup complete!"
.PHONY: remove
remove: clean
@$(rm) $(BINDIR)/$(TARGET)
@echo "Executable removed!"

View File

@ -1,25 +0,0 @@
forloop.o: file format elf32-littleriscv
Disassembly of section .text:
00010074 <main>:
10074: fe010113 addi sp,sp,-32
10078: 00812e23 sw s0,28(sp)
1007c: 02010413 addi s0,sp,32
10080: fe042623 sw zero,-20(s0)
10084: 01c0006f j 100a0 <main+0x2c>
10088: fec42783 lw a5,-20(s0)
1008c: 00578793 addi a5,a5,5
10090: fef42423 sw a5,-24(s0)
10094: fec42783 lw a5,-20(s0)
10098: 00178793 addi a5,a5,1
1009c: fef42623 sw a5,-20(s0)
100a0: fec42703 lw a4,-20(s0)
100a4: 00900793 li a5,9
100a8: fee7d0e3 ble a4,a5,10088 <main+0x14>
100ac: 00000013 nop
100b0: 01c12403 lw s0,28(sp)
100b4: 02010113 addi sp,sp,32
100b8: 00008067 ret

View File

@ -1,8 +0,0 @@
void main(void) {
volatile int i;
volatile int a;
for(i=0;i<10;i++) {
a=i+5;
}
}

View File

@ -1,52 +0,0 @@
TARGET = func1
TARGET_ARCH=riscv32
CC = riscv32-unknown-linux-gnu-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
# linking flags here
LFLAGS = -I. --entry main
LIBS = $(EXTRA_LIBS)
# change these to proper directories where each file should be
SRCDIR = ./
OBJDIR = .
BINDIR = ./
INCDIR = -I.
LIBDIR = -L.
SOURCES := $(wildcard $(SRCDIR)/*.c)
INCLUDES := $(wildcard $(INCDIR)/*.h)
OBJECTS := $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
rm = rm -f
$(BINDIR)/$(TARGET): $(OBJECTS)
# $(LINKER) $(OBJECTS) $(LFLAGS) $(LIBS) $(LIBDIR) -o $@
riscv32-unknown-linux-gnu-objdump -d $< > dump
objcopy -Oihex $< $(TARGET).hex
# @echo "Linking complete!"
$(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.c
@echo "Compiling "$<" ..."
# $(CC) $(CFLAGS) $(INCDIR) -c $< -o $@
$(CC) $(CFLAGS) $(INCDIR) $< -o $@
@echo "Done!"
.PHONY: clean
clean:
@$(rm) $(OBJECTS)
@echo "Cleanup complete!"
.PHONY: remove
remove: clean
@$(rm) $(BINDIR)/$(TARGET)
@echo "Executable removed!"

View File

@ -1,25 +0,0 @@
#define TRACE (*(unsigned char *)0x40000000)
int func1(int a, int* b) {
return a + (*b);
}
void main(void) {
int x1, x2, x3;
x1 = 6;
x2 = 7;
x3 = func1(x1, &x2);
if (x3 == 13) {
TRACE = 'O';
TRACE = 'K';
TRACE = '\n';
} else {
TRACE = 'E';
TRACE = 'R';
TRACE = '\n';
}
}

View File

@ -1,52 +0,0 @@
TARGET = func2
TARGET_ARCH=riscv32
CC = riscv32-unknown-linux-gnu-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
# linking flags here
LFLAGS = -I. --entry main
LIBS = $(EXTRA_LIBS)
# change these to proper directories where each file should be
SRCDIR = ./
OBJDIR = .
BINDIR = ./
INCDIR = -I.
LIBDIR = -L.
SOURCES := $(wildcard $(SRCDIR)/*.c)
INCLUDES := $(wildcard $(INCDIR)/*.h)
OBJECTS := $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
rm = rm -f
$(BINDIR)/$(TARGET): $(OBJECTS)
# $(LINKER) $(OBJECTS) $(LFLAGS) $(LIBS) $(LIBDIR) -o $@
riscv32-unknown-linux-gnu-objdump -d $< > dump
objcopy -Oihex $< $(TARGET).hex
# @echo "Linking complete!"
$(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.c
@echo "Compiling "$<" ..."
# $(CC) $(CFLAGS) $(INCDIR) -c $< -o $@
$(CC) $(CFLAGS) $(INCDIR) $< -o $@
@echo "Done!"
.PHONY: clean
clean:
@$(rm) $(OBJECTS)
@echo "Cleanup complete!"
.PHONY: remove
remove: clean
@$(rm) $(BINDIR)/$(TARGET)
@echo "Executable removed!"

View File

@ -1,29 +0,0 @@
#define TRACE (*(unsigned char *)0x40000000)
void print(char *msg) {
int i = 0;
while(msg[i] != '\0') {
TRACE = msg[i];
i++;
}
}
int func1(int a, int* b) {
return a + (*b);
}
void main(void) {
int x1, x2, x3;
x1 = 6;
x2 = 7;
x3 = func1(x1, &x2);
if (x3 == 13) {
print("OK\n");
} else {
print("ERROR\n");
}
}

View File

@ -1,52 +0,0 @@
TARGET = stdlibs
TARGET_ARCH=riscv32
CC = riscv32-unknown-linux-gnu-gcc
# compiling flags here
#CFLAGS = -Wall -I. -O0 -march=rv32 -mabi=ilp32
#CFLAGS = -Wall -I. -O0 -nostdlib -march=rv32i -mabi=ilp32 --entry main -lc
CFLAGS = -Wall -I. -O0 -nostdlib -march=rv32i -mabi=ilp32 --entry main
LINKER = riscv32-unknown-linux-gnu-gcc
# linking flags here
LFLAGS = -I.
LIBS = $(EXTRA_LIBS)
# change these to proper directories where each file should be
SRCDIR = ./
OBJDIR = .
BINDIR = ./
INCDIR = -I.
LIBDIR = -L.
SOURCES := $(wildcard $(SRCDIR)/*.c)
INCLUDES := $(wildcard $(INCDIR)/*.h)
OBJECTS := $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
rm = rm -f
$(BINDIR)/$(TARGET): $(OBJECTS)
# $(LINKER) $(OBJECTS) $(LFLAGS) $(LIBS) $(LIBDIR) -o $@
riscv32-unknown-linux-gnu-objdump -d $< > dump
objcopy -Oihex $< $(TARGET).hex
# @echo "Linking complete!"
$(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.c
@echo "Compiling "$<" ..."
# $(CC) $(CFLAGS) $(INCDIR) -c $< -o $@
$(CC) $(CFLAGS) $(INCDIR) $< -o $@
@echo "Done!"
.PHONY: clean
clean:
@$(rm) $(OBJECTS)
@echo "Cleanup complete!"
.PHONY: remove
remove: clean
@$(rm) $(BINDIR)/$(TARGET)
@echo "Executable removed!"

View File

@ -1,17 +0,0 @@
#include <stdio.h>
#define TRACE (*(unsigned char *)0x40000000)
void print(char *msg) {
int i = 0;
while(msg[i] != '\0') {
TRACE = msg[i];
i++;
}
}
void main(void) {
char msg[50];
print("hello");
sprintf(msg, "%i", 5);
}

View File

@ -1,52 +0,0 @@
TARGET = trace
TARGET_ARCH=riscv32
CC = riscv32-unknown-linux-gnu-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
# linking flags here
LFLAGS = -I. --entry main
LIBS = $(EXTRA_LIBS)
# change these to proper directories where each file should be
SRCDIR = ./
OBJDIR = .
BINDIR = ./
INCDIR = -I.
LIBDIR = -L.
SOURCES := $(wildcard $(SRCDIR)/*.c)
INCLUDES := $(wildcard $(INCDIR)/*.h)
OBJECTS := $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
rm = rm -f
$(BINDIR)/$(TARGET): $(OBJECTS)
# $(LINKER) $(OBJECTS) $(LFLAGS) $(LIBS) $(LIBDIR) -o $@
riscv32-unknown-linux-gnu-objdump -d $< > dump
objcopy -Oihex $< $(TARGET).hex
# @echo "Linking complete!"
$(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.c
@echo "Compiling "$<" ..."
# $(CC) $(CFLAGS) $(INCDIR) -c $< -o $@
$(CC) $(CFLAGS) $(INCDIR) $< -o $@
@echo "Done!"
.PHONY: clean
clean:
@$(rm) $(OBJECTS)
@echo "Cleanup complete!"
.PHONY: remove
remove: clean
@$(rm) $(BINDIR)/$(TARGET)
@echo "Executable removed!"

View File

@ -1,20 +0,0 @@
trace.o: file format elf32-littleriscv
Disassembly of section .text:
00010074 <main>:
10074: ff010113 addi sp,sp,-16
10078: 00812623 sw s0,12(sp)
1007c: 01010413 addi s0,sp,16
10080: 400007b7 lui a5,0x40000
10084: 04800713 li a4,72
10088: 00e78023 sb a4,0(a5) # 40000000 <__global_pointer$+0x3ffee758>
1008c: 400007b7 lui a5,0x40000
10090: 06500713 li a4,101
10094: 00e78023 sb a4,0(a5) # 40000000 <__global_pointer$+0x3ffee758>
10098: 00000013 nop
1009c: 00c12403 lw s0,12(sp)
100a0: 01010113 addi sp,sp,16
100a4: 00008067 ret

View File

@ -1,7 +0,0 @@
#define TRACE (*(unsigned char *)0x40000000)
void main(void) {
TRACE = 'H';
TRACE = 'e';
}

View File

@ -1,52 +0,0 @@
TARGET = trace2
TARGET_ARCH=riscv32
CC = riscv32-unknown-linux-gnu-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
# linking flags here
LFLAGS = -I. --entry main
LIBS = $(EXTRA_LIBS)
# change these to proper directories where each file should be
SRCDIR = ./
OBJDIR = .
BINDIR = ./
INCDIR = -I.
LIBDIR = -L.
SOURCES := $(wildcard $(SRCDIR)/*.c)
INCLUDES := $(wildcard $(INCDIR)/*.h)
OBJECTS := $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
rm = rm -f
$(BINDIR)/$(TARGET): $(OBJECTS)
# $(LINKER) $(OBJECTS) $(LFLAGS) $(LIBS) $(LIBDIR) -o $@
riscv32-unknown-linux-gnu-objdump -d $< > dump
objcopy -Oihex $< $(TARGET).hex
# @echo "Linking complete!"
$(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.c
@echo "Compiling "$<" ..."
# $(CC) $(CFLAGS) $(INCDIR) -c $< -o $@
$(CC) $(CFLAGS) $(INCDIR) $< -o $@
@echo "Done!"
.PHONY: clean
clean:
@$(rm) $(OBJECTS)
@echo "Cleanup complete!"
.PHONY: remove
remove: clean
@$(rm) $(BINDIR)/$(TARGET)
@echo "Executable removed!"

View File

@ -1,28 +0,0 @@
trace2.o: file format elf32-littleriscv
Disassembly of section .text:
00010074 <main>:
10074: fe010113 addi sp,sp,-32
10078: 00812e23 sw s0,28(sp)
1007c: 02010413 addi s0,sp,32
10080: fe042623 sw zero,-20(s0)
10084: 0280006f j 100ac <main+0x38>
10088: fec42783 lw a5,-20(s0)
1008c: 0ff7f713 andi a4,a5,255
10090: 400007b7 lui a5,0x40000
10094: 06170713 addi a4,a4,97
10098: 0ff77713 andi a4,a4,255
1009c: 00e78023 sb a4,0(a5) # 40000000 <__global_pointer$+0x3ffee738>
100a0: fec42783 lw a5,-20(s0)
100a4: 00178793 addi a5,a5,1
100a8: fef42623 sw a5,-20(s0)
100ac: fec42703 lw a4,-20(s0)
100b0: 00900793 li a5,9
100b4: fce7dae3 ble a4,a5,10088 <main+0x14>
100b8: 00000013 nop
100bc: 01c12403 lw s0,28(sp)
100c0: 02010113 addi sp,sp,32
100c4: 00008067 ret

View File

@ -1,9 +0,0 @@
#define TRACE (*(unsigned char *)0x40000000)
void main(void) {
int i;
for(i=0;i<10;i++) {
TRACE = 'a' + i;
}
}

View File

@ -1,52 +0,0 @@
TARGET = trace3
TARGET_ARCH=riscv32
CC = riscv32-unknown-linux-gnu-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
# linking flags here
LFLAGS = -I. --entry main
LIBS = $(EXTRA_LIBS)
# change these to proper directories where each file should be
SRCDIR = ./
OBJDIR = .
BINDIR = ./
INCDIR = -I.
LIBDIR = -L.
SOURCES := $(wildcard $(SRCDIR)/*.c)
INCLUDES := $(wildcard $(INCDIR)/*.h)
OBJECTS := $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
rm = rm -f
$(BINDIR)/$(TARGET): $(OBJECTS)
# $(LINKER) $(OBJECTS) $(LFLAGS) $(LIBS) $(LIBDIR) -o $@
riscv32-unknown-linux-gnu-objdump -d $< > dump
objcopy -Oihex $< $(TARGET).hex
# @echo "Linking complete!"
$(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.c
@echo "Compiling "$<" ..."
# $(CC) $(CFLAGS) $(INCDIR) -c $< -o $@
$(CC) $(CFLAGS) $(INCDIR) $< -o $@
@echo "Done!"
.PHONY: clean
clean:
@$(rm) $(OBJECTS)
@echo "Cleanup complete!"
.PHONY: remove
remove: clean
@$(rm) $(BINDIR)/$(TARGET)
@echo "Executable removed!"

View File

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

View File

@ -1,10 +0,0 @@
.section .text
.globl _start
_start:
# Basic loop
ADDI t1, zero, 10 # t1 to 10
ADDI t2, zero, 1 #t2 to 1
loop:
SUB t1, t1, t2
BNE t1, zero, loop
# END

View File

@ -1,11 +0,0 @@
.section .text
.globl _start
_start:
li t1, 150
li t2, 300
li t3, -250
ADD t4, t1, t2
ADD t5, t2, t3
SUB t6, t2, t1
#SUB t7, t1, t2

View File

@ -1,12 +0,0 @@
.section .text
.globl _start
_start:
li t1, 150
li t2, 300
li t3, -250
loop:
ADD t4, t1, t2
ADD t5, t2, t3
SUB t6, t2, t1
J loop

View File

@ -1,5 +0,0 @@
:020000021000EC
:10000000130360099303C012130E60F0B30E730064
:0C001000338FC301B38F63406FF05FFFBC
:0400000310000000E9
:00000001FF

View File

@ -1,8 +0,0 @@
li t1, 0xCAFE
li t2, 300
li t3, 0xBEEF
sb t1, -6(t2)
sb t3, -13(t2)
li t1, 23
lbu t1, -6(t2)
lbu t3, -13(t2)

View File

@ -1,34 +0,0 @@
.equ TRACE_BASE, 0x40000000
#msg:
# .string "Hello World\n"
.section .text
.globl _start
_start:
li a2, TRACE_BASE
li t0, 'H'
sb t0, 0(a2)
li t0, 'e'
sb t0, 0(a2)
li t0, 'l'
sb t0, 0(a2)
li t0, 'l'
sb t0, 0(a2)
li t0, 'o'
sb t0, 0(a2)
li t0, ' '
sb t0, 0(a2)
li t0, 'w'
sb t0, 0(a2)
li t0, 'o'
sb t0, 0(a2)
li t0, 'r'
sb t0, 0(a2)
li t0, 'l'
sb t0, 0(a2)
li t0, 'd'
sb t0, 0(a2)
li t0, '\n'
sb t0, 0(a2)