Commit 0ec7a6ec authored by Tomasz Wlostowski's avatar Tomasz Wlostowski

test simulation-only firmware for WRPC RISC-V port. WIP

parent 10ce9590
Pipeline #948 failed with stage
in 34 seconds
......@@ -28,7 +28,7 @@ PPSI = ppsi
# list of file extensions to be copied for MAKEALL script
MAKEALL_COPY_LIST=.bin .elf
cflags-arch = -march=rv32imc -mabi=ilp32
cflags-arch = -march=rv32im -mabi=ilp32
USER_CFLAGS = $(cflags-arch)
#PPSI_O_LDFLAGS = -melf32lriscv
#-mabi=ilp32
......@@ -123,7 +123,7 @@ CFLAGS = $(cflags-y) -Wall -Wstrict-prototypes \
ASFLAGS = -I.
LDFLAGS = $(ldflags-y) \
-march=rv32imc -mabi=ilp32 -Wl,--gc-sections -Os -lgcc -lc
-march=rv32im -mabi=ilp32 -Wl,--gc-sections -Os -lgcc -lc
WRC-O-FLAGS-$(CONFIG_LM32) = --gc-sections -e _start
......@@ -239,7 +239,7 @@ distclean: clean
${CC} $(CFLAGS) $(PTPD_CFLAGS) $(INCLUDE_DIR) $(LIB_DIR) -c $*.c -o $@
%.o: %.S
${CC} -march=rv32imc -mabi=ilp32 -c $*.S -o $@
${CC} -march=rv32im -mabi=ilp32 -c $*.S -o $@
liblinux:
......
......@@ -11,14 +11,14 @@
*/
/* Fixed base addresses */
#define BASE_MINIC 0x40000
#define BASE_EP 0x40100
#define BASE_SOFTPLL 0x40200
#define BASE_PPS_GEN 0x40300
#define BASE_SYSCON 0x40400
#define BASE_UART 0x40500
#define BASE_ONEWIRE 0x40600
#define BASE_ETHERBONE_CFG 0x48000
#define BASE_MINIC 0x80000000
#define BASE_EP 0x80000100
#define BASE_SOFTPLL 0x80000200
#define BASE_PPS_GEN 0x80000300
#define BASE_SYSCON 0x80000400
#define BASE_UART 0x80000500
#define BASE_ONEWIRE 0x80000600
#define BASE_ETHERBONE_CFG 0x80008000
/* Board-specific parameters */
#define TICS_PER_SECOND 1000
......
......@@ -15,6 +15,7 @@ static uint32_t prev_ticks_for_profile;
uint32_t print_task_time_threshold = CONFIG_DEFAULT_PRINT_TASK_TIME_THRESHOLD;
static struct wrc_task tasks[WRC_MAX_TASKS];
static struct wrc_task* last_task = &tasks[0];
static void task_time_normalize(struct wrc_task *t)
{
......
......@@ -19,7 +19,7 @@ OBJDUMP = $(CROSS_COMPILE)objdump
# calculate endianness at compile time
ENDIAN := $(shell ./check-endian $(CC))
CFLAGS = -Wall -ggdb -O2 -march=rv32imc -mabi=ilp32
CFLAGS = -Wall -ggdb -O2 -march=rv32im -mabi=ilp32
CFLAGS += -I../include/linux -I../include # for <sdb.h>
CFLAGS += -ffunction-sections -fdata-sections
CFLAGS += -Wno-pointer-sign
......
......@@ -17,10 +17,10 @@ const char *byte_to_binary(int x)
static char b[33];
b[0] = '\0';
x = htonl(x); // ugly hack
for (z = 0x80000000; z > 0; z >>= 1)
{
strcat(b, ((x & z) == z) ? "1" : "0");
}
return b;
}
......
......@@ -26,6 +26,8 @@
#include <stdio.h>
#include <inttypes.h>
#include "boards/generic/board.h"
#include "system_checks.h"
#include "dev/endpoint.h"
#include "dev/minic.h"
......@@ -84,14 +86,10 @@ static void wrc_sim_initialize(void)
// uncomment the following line to perform a dynamic search
// at runtime.
//sdb_find_devices();
BASE_MINIC = (void *)0x20000;
BASE_EP = (void *)0x20100;
BASE_SOFTPLL = (void *)0x20200;
BASE_PPS_GEN = (void *)0x20300;
BASE_SYSCON = (void *)0x20400;
BASE_UART = (void *)0x20500;
BASE_ONEWIRE = (void *)0x20600;
BASE_ETHERBONE_CFG = (void *)0x20700;
console_init();
pp_printf("WR Core Sim Says Hello!\n");
timer_init(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment