-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
104 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
OUTPUT_ARCH( "riscv" ) | ||
ENTRY(rvtest_entry_point) | ||
|
||
MEMORY | ||
{ | ||
text (rxai!w) : ORIGIN = 0x00000000, LENGTH = 2M | ||
data (wxa!ri) : ORIGIN = 0x10000000, LENGTH = 1M | ||
mmio (wa!rxi) : ORIGIN = 0x80000000, LENGTH = 1K | ||
signature (wa!rxi) : ORIGIN = 0x81000000, LENGTH = 16K | ||
|
||
} | ||
|
||
PHDRS | ||
{ | ||
text PT_LOAD; | ||
data_init PT_LOAD; | ||
data PT_NULL; | ||
mmio PT_LOAD; | ||
signature PT_LOAD; | ||
} | ||
|
||
SECTIONS | ||
{ | ||
.text.init : { *(.text.init) } >text AT>text :text | ||
. = ALIGN(0x1000); | ||
.text : { *(.text) } >text AT>text :text | ||
|
||
. = ALIGN(0x1000); | ||
.data : { *(.data) } >data AT>data :data_init | ||
.data.string : { *(.data.string)} >data AT>data :data_init | ||
.bss : { *(.bss) } >data AT>data :data | ||
|
||
. = ALIGN(0x1000); | ||
.hostmmio : { *(.hostmmio) } >mmio AT>mmio :mmio | ||
|
||
. = ALIGN(0x1000); | ||
.signature : { *(.signature) } >signature AT>signature :signature | ||
|
||
_end = .; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#ifndef _COMPLIANCE_MODEL_H | ||
#define _COMPLIANCE_MODEL_H | ||
#define RVMODEL_DATA_SECTION \ | ||
.pushsection .hostmmio,"aw",@progbits; \ | ||
.align 8; .global tohost; tohost: .dword 0; \ | ||
.align 8; .global fromhost; fromhost: .dword 0; \ | ||
.popsection; \ | ||
.align 8; .global begin_regstate; begin_regstate: \ | ||
.word 128; \ | ||
.align 8; .global end_regstate; end_regstate: \ | ||
.word 4; | ||
|
||
//RV_COMPLIANCE_HALT | ||
#define RVMODEL_HALT \ | ||
li x1, 1; \ | ||
write_tohost: \ | ||
sw x1, tohost, t5; \ | ||
j write_tohost; | ||
|
||
#define RVMODEL_BOOT | ||
|
||
//RV_COMPLIANCE_DATA_BEGIN | ||
#define RVMODEL_DATA_BEGIN \ | ||
RVMODEL_DATA_SECTION \ | ||
.pushsection .signature,"aw",@progbits; \ | ||
.align 2; \ | ||
.global begin_signature; begin_signature: | ||
|
||
//RV_COMPLIANCE_DATA_END | ||
#define RVMODEL_DATA_END \ | ||
.global end_signature; end_signature: \ | ||
.popsection; | ||
|
||
//RVTEST_IO_INIT | ||
#define RVMODEL_IO_INIT | ||
//RVTEST_IO_WRITE_STR | ||
#define RVMODEL_IO_WRITE_STR(_R, _STR) | ||
//RVTEST_IO_CHECK | ||
#define RVMODEL_IO_CHECK() | ||
//RVTEST_IO_ASSERT_GPR_EQ | ||
#define RVMODEL_IO_ASSERT_GPR_EQ(_S, _R, _I) | ||
//RVTEST_IO_ASSERT_SFPR_EQ | ||
#define RVMODEL_IO_ASSERT_SFPR_EQ(_F, _R, _I) | ||
//RVTEST_IO_ASSERT_DFPR_EQ | ||
#define RVMODEL_IO_ASSERT_DFPR_EQ(_D, _R, _I) | ||
|
||
// empty macros to supress warnings | ||
#define RVMODEL_SET_MSW_INT | ||
#define RVMODEL_CLEAR_MSW_INT | ||
#define RVMODEL_CLEAR_MTIMER_INT | ||
#define RVMODEL_CLEAR_MEXT_INT | ||
#define RVMODEL_CLR_MSW_INT | ||
#define RVMODEL_CLR_MTIMER_INT | ||
#define RVMODEL_CLR_MEXT_INT | ||
#define RVMODEL_SET_SSW_INT | ||
#define RVMODEL_CLR_SSW_INT | ||
#define RVMODEL_CLR_STIMER_INT | ||
#define RVMODEL_CLR_SEXT_INT | ||
#define RVMODEL_SET_VSW_INT | ||
#define RVMODEL_CLR_VSW_INT | ||
#define RVMODEL_CLR_VTIMER_INT | ||
#define RVMODEL_CLR_VEXT_INT | ||
|
||
#endif // _COMPLIANCE_MODEL_H |