-
Notifications
You must be signed in to change notification settings - Fork 113
Integrate riscv-compliance #5
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
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b7c3484
Integrate riscv-compliance v2.0
sammer1107 fed15cb
Add README for running compliance
sammer1107 61c2688
Update submodule to https protocol
sammer1107 0b08bdd
Modify makefile to pull submodule automatically
sammer1107 bc7128a
Remove symbolic links in compliance target
sammer1107 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
build/DOOM1.WAD* | ||
build/rv32emu | ||
build/compliance | ||
*.o | ||
*.o.d |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "riscv-compliance"] | ||
path = riscv-compliance | ||
url = https://github.com/riscv/riscv-compliance.git |
This file contains hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
RUN_TARGET= $(TARGETDIR)/build/rv32emu $(<) \ | ||
$(RISCV_TARGET_FLAGS) \ | ||
--compliance $(*).signature.output \ | ||
1>$(@) 2>&1 | ||
|
||
RISCV_GCC ?= $(RISCV_PREFIX)gcc | ||
RISCV_GCC_OPTS ?= \ | ||
-march=rv32g \ | ||
-mabi=ilp32 \ | ||
-static \ | ||
-mcmodel=medany \ | ||
-fvisibility=hidden \ | ||
$(RVTEST_DEFINES) \ | ||
-nostdlib \ | ||
-nostartfiles | ||
|
||
COMPILE_TARGET=\ | ||
$$(RISCV_GCC) $(1) $$(RISCV_GCC_OPTS) \ | ||
-I$(ROOTDIR)/riscv-test-suite/env/ \ | ||
-I$(TARGETDIR)/$(RISCV_TARGET)/ \ | ||
-T$(TARGETDIR)/$(RISCV_TARGET)/link.ld \ | ||
$$(<) -o $$(@); |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
RUN_TARGET= $(TARGETDIR)/build/rv32emu $(<) \ | ||
$(RISCV_TARGET_FLAGS) \ | ||
--compliance $(*).signature.output \ | ||
1>$(@) 2>&1 | ||
|
||
RISCV_GCC ?= $(RISCV_PREFIX)gcc | ||
RISCV_GCC_OPTS ?= \ | ||
-march=rv32g \ | ||
-mabi=ilp32 \ | ||
-static \ | ||
-mcmodel=medany \ | ||
-fvisibility=hidden \ | ||
$(RVTEST_DEFINES) \ | ||
-nostdlib \ | ||
-nostartfiles | ||
|
||
COMPILE_TARGET=\ | ||
$$(RISCV_GCC) $(1) $$(RISCV_GCC_OPTS) \ | ||
-I$(ROOTDIR)/riscv-test-suite/env/ \ | ||
-I$(TARGETDIR)/$(RISCV_TARGET)/ \ | ||
-T$(TARGETDIR)/$(RISCV_TARGET)/link.ld \ | ||
$$(<) -o $$(@); |
22 changes: 22 additions & 0 deletions
22
compliance-target/device/rv32i_m/Zifencei/Makefile.include
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
RUN_TARGET= $(TARGETDIR)/build/rv32emu $(<) \ | ||
$(RISCV_TARGET_FLAGS) \ | ||
--compliance $(*).signature.output \ | ||
1>$(@) 2>&1 | ||
|
||
RISCV_GCC ?= $(RISCV_PREFIX)gcc | ||
RISCV_GCC_OPTS ?= \ | ||
-march=rv32g \ | ||
-mabi=ilp32 \ | ||
-static \ | ||
-mcmodel=medany \ | ||
-fvisibility=hidden \ | ||
$(RVTEST_DEFINES) \ | ||
-nostdlib \ | ||
-nostartfiles | ||
|
||
COMPILE_TARGET=\ | ||
$$(RISCV_GCC) $(1) $$(RISCV_GCC_OPTS) \ | ||
-I$(ROOTDIR)/riscv-test-suite/env/ \ | ||
-I$(TARGETDIR)/$(RISCV_TARGET)/ \ | ||
-T$(TARGETDIR)/$(RISCV_TARGET)/link.ld \ | ||
$$(<) -o $$(@); |
22 changes: 22 additions & 0 deletions
22
compliance-target/device/rv32i_m/privilege/Makefile.include
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
RUN_TARGET= $(TARGETDIR)/build/rv32emu $(<) \ | ||
$(RISCV_TARGET_FLAGS) \ | ||
--compliance $(*).signature.output \ | ||
1>$(@) 2>&1 | ||
|
||
RISCV_GCC ?= $(RISCV_PREFIX)gcc | ||
RISCV_GCC_OPTS ?= \ | ||
-march=rv32g \ | ||
-mabi=ilp32 \ | ||
-static \ | ||
-mcmodel=medany \ | ||
-fvisibility=hidden \ | ||
$(RVTEST_DEFINES) \ | ||
-nostdlib \ | ||
-nostartfiles | ||
|
||
COMPILE_TARGET=\ | ||
$$(RISCV_GCC) $(1) $$(RISCV_GCC_OPTS) \ | ||
-I$(ROOTDIR)/riscv-test-suite/env/ \ | ||
-I$(TARGETDIR)/$(RISCV_TARGET)/ \ | ||
-T$(TARGETDIR)/$(RISCV_TARGET)/link.ld \ | ||
$$(<) -o $$(@); |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
OUTPUT_ARCH( "riscv" ) | ||
ENTRY(rvtest_entry_point) | ||
|
||
SECTIONS | ||
{ | ||
. = 0x80000000; | ||
.text.init : { *(.text.init) } | ||
. = ALIGN(0x1000); | ||
.text : { *(.text) } | ||
. = ALIGN(0x1000); | ||
.data : { *(.data) } | ||
.data.string : { *(.data.string)} | ||
.bss : { *(.bss) } | ||
_end = .; | ||
} | ||
|
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
#define RVMODEL_HALT \ | ||
add a7, x0, 93; \ | ||
add a0, x0, 0; \ | ||
ecall | ||
|
||
#define RVMODEL_BOOT | ||
|
||
#define RVTEST_RV32M | ||
|
||
#define RVMODEL_DATA_BEGIN \ | ||
.align 4; .global begin_signature; begin_signature: | ||
|
||
#define RVMODEL_DATA_END \ | ||
.align 4; .global end_signature; end_signature: | ||
|
||
|
||
#define RVMODEL_IO_INIT | ||
#define RVMODEL_IO_WRITE_STR(_SP, _STR) | ||
#define RVMODEL_IO_CHECK() | ||
#define RVMODEL_IO_ASSERT_GPR_EQ(_SP, _R, _I) | ||
#define RVMODEL_IO_ASSERT_SFPR_EQ(_F, _R, _I) | ||
#define RVMODEL_IO_ASSERT_DFPR_EQ(_D, _R, _I) | ||
#define RVMODEL_SET_MSW_INT | ||
#define RVMODEL_CLEAR_MSW_INT | ||
#define RVMODEL_CLEAR_MTIMER_INT | ||
#define RVMODEL_CLEAR_MEXT_INT |
This file contains hidden or 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 hidden or 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 hidden or 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
Submodule riscv-compliance
added at
2e95f1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I am not sure why
pwd
is necessary. Can you explain?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.
Because the build process of compliance involves multiple makefiles in different places, I found out that the makefile from the compliance will fail to find our target file if I just set
TARGETDIR
to.
. Therefore, I set it to the absolute path of our project root.