-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support spike #17
base: master
Are you sure you want to change the base?
Support spike #17
Conversation
support for spike
@@ -14,7 +14,7 @@ extern void enable_timer(); | |||
extern void init_pmp(); | |||
extern void enable_pmp(uintptr_t pmp_reg, uintptr_t pmp_addr, uintptr_t pmp_size, uint8_t lock, uint8_t permission); | |||
extern void enable_pmp_TOR(uintptr_t pmp_reg, uintptr_t pmp_addr, uintptr_t pmp_size, bool lock, uint8_t permission); | |||
#include <pmp.h> | |||
// #include <pmp.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for running nexus-am
@@ -0,0 +1,13 @@ | |||
include $(AM_HOME)/am/arch/isa/riscv64.mk | |||
include $(AM_HOME)/am/arch/platform/spike.mk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
support for spike
LDFLAGS += -L $(AM_HOME)/am/src/spike/ldscript | ||
|
||
NEMU_ARGS += -l --isa=$(RV_MARCH) | ||
ifeq ($(HAS_RVV),1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
support for RVV
@echo + OBJCOPY "->" $(BINARY_REL).bin | ||
@$(OBJCOPY) -S --set-section-flags .bss=alloc,contents -O binary $(BINARY).elf $(BINARY).bin | ||
|
||
run:image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
support for spike
csrwi fcsr, 0 | ||
jal _trm_init | ||
|
||
.section ".tohost","aw",@progbits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
support for spike
extern volatile uint64_t fromhost; | ||
|
||
void _halt(int code) { | ||
tohost = (code << 1) | 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
support for spike
_pmem_start = pmem_base; | ||
_pmem_end = _pmem_start + LENGTH(ram); | ||
. = ALIGN(0x1000); | ||
.tohost : { *(.tohost) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
support for spike
arch: add support for spike
manual:
finished:
#include <pmp.h>
in am/src/nemu/isa/riscv/cte64.ctodo: