forked from lowRISC/opentitan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RISC-V compliance demo + misc changes
- Loading branch information
Showing
6 changed files
with
34 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,4 +21,8 @@ void _crt(void) { | |
memset(_bss_start, 0, _bss_end - _bss_start); | ||
|
||
main(); | ||
|
||
while(1) { | ||
asm volatile("wfi"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,9 +106,6 @@ SECTIONS | |
{ | ||
[ .stabstr ] | ||
} | ||
|
||
/* Discard the remaining sections */ | ||
/DISCARD/ : { *(*) } | ||
} | ||
|
||
ENTRY(main) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
OPENTITAN = $(ROOTDIR)/riscv-target/$(RISCV_TARGET)/device/rv32imc | ||
OT_SW = $(ROOTDIR)/../../device | ||
OT_BUILD = $(ROOTDIR)/../../../build/sw/device | ||
OT_ROOT = $(OT_SW)/../../ | ||
OT_TOOLS ?= /tools/riscv/bin | ||
OT_FPGA_UART ?= | ||
|
@@ -36,7 +37,8 @@ RUN_TARGET=\ | |
--log $(work_dir_isa)/$<.uart.log; \ | ||
grep -o 'SIG: [a-zA-Z0-9_]*' $(work_dir_isa)/$<.uart.log | sed 's/SIG: //' \ | ||
> $(work_dir_isa)/$(*).signature.temp.output; \ | ||
tr '[:upper:]' '[:lower:]' < $(work_dir_isa)/$(*).signature.temp.output > $(work_dir_isa)/$(*).signature.output; | ||
tr '[:upper:]' '[:lower:]' < $(work_dir_isa)/$(*).signature.temp.output > $(work_dir_isa)/$(*).signature.output; \ | ||
sleep 1s; | ||
|
||
|
||
RISCV_PREFIX ?= ${OT_TOOLS}/riscv32-unknown-elf- | ||
|
@@ -54,17 +56,18 @@ RISCV_GCC_OPTS ?= -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostart | |
# After the libraries are built, the necessary collateral (vmem for verilator, bin | ||
# for fpga) are created | ||
COMPILE_TARGET=\ | ||
make -C $$(OT_SW) SW_DIR=boot_rom $(MAKEARG) RV_TOOLS=$(OT_TOOLS) clean all; \ | ||
make -C $$(OT_SW) SW_DIR=examples/hello_world $(MAKEARG) RV_TOOLS=$(OT_TOOLS) all; \ | ||
$$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) \ | ||
-I$(ROOTDIR)/riscv-test-env/ \ | ||
-I$(ROOTDIR)/riscv-test-env/p/ \ | ||
-I$(OT_SW)/boot_rom/lib \ | ||
-I$(OT_SW)/lib \ | ||
-I$(TARGETDIR)/$(RISCV_TARGET)/ \ | ||
-I$(TARGETDIR)/$(RISCV_TARGET)/ \ | ||
-DRISCV_TEST_NAME=$$(subst -01,,$$(*F)) \ | ||
$(DEFINES) -T$(LDSCRIPT) $$< \ | ||
$(OPENTITAN)/wrap.c \ | ||
-L$(OT_SW)/boot_rom/lib \ | ||
-L$(OT_BUILD)/examples/hello_world/lib \ | ||
-lot \ | ||
-o $(work_dir_isa)/$$@; \ | ||
$$(RISCV_OBJDUMP) -SD $(work_dir_isa)/$$@ > $(work_dir_isa)/[email protected]; \ | ||
|