1
0
mirror of https://github.com/olofk/serv.git synced 2026-02-22 22:57:12 +00:00

Update Compliance testing framework

This commit is contained in:
Abdulwadoodd
2022-10-03 14:33:11 +05:00
committed by Olof Kindgren
parent 1bdd42acb5
commit 41ae06f6cf
11 changed files with 436 additions and 0 deletions

18
verif/plugin-serv/env/link.ld vendored Normal file
View File

@@ -0,0 +1,18 @@
OUTPUT_ARCH( "riscv" )
ENTRY(_start)
SECTIONS
{
. = 0x00000000;
.text.init : { *(.text.init) }
. = ALIGN(0x1000);
.tohost : { *(.tohost) }
. = ALIGN(0x1000);
.text : { *(.text) }
. = ALIGN(0x1000);
.data : { *(.data) }
.data.string : { *(.data.string)}
.bss : { *(.bss) }
_end = .;
}

71
verif/plugin-serv/env/model_test.h vendored Normal file
View File

@@ -0,0 +1,71 @@
#ifndef _COMPLIANCE_MODEL_H
#define _COMPLIANCE_MODEL_H
#define RVMODEL_HALT \
la a0, begin_signature; \
la a1, end_signature; \
li a2, 0x80000000; \
complience_halt_loop: \
beq a0, a1, complience_halt_break; \
addi a3, a0, 4; \
complience_halt_loop2: \
addi a3, a3, -1; \
\
lb a4, 0 (a3); \
srai a5, a4, 4; \
andi a5, a5, 0xF; \
li a6, 10; \
blt a5, a6, notLetter; \
addi a5, a5, 39; \
notLetter: \
addi a5, a5, 0x30; \
sw a5, 0 (a2); \
\
srai a5, a4, 0; \
andi a5, a5, 0xF; \
li a6, 10; \
blt a5, a6, notLetter2; \
addi a5, a5, 39; \
notLetter2: \
addi a5, a5, 0x30; \
sw a5, 0 (a2); \
bne a0, a3,complience_halt_loop2; \
addi a0, a0, 4; \
\
li a4, '\n'; \
sw a4, 0 (a2); \
j complience_halt_loop; \
j complience_halt_break; \
complience_halt_break:; \
lui a0,0x90000000>>12; \
sw a3,0(a0);
#define RVMODEL_DATA_BEGIN \
.align 4; .global begin_signature; begin_signature: \
#define RVMODEL_DATA_END \
.align 4; .global end_signature; end_signature: \
#define RVMODEL_BOOT \
.section .text.init; \
.align 4; \
.globl _start; \
_start:
#define LOCAL_IO_WRITE_STR(_STR) RVMODEL_IO_WRITE_STR(x31, _STR)
#define RVMODEL_IO_WRITE_STR(_SP, _STR)
#define LOCAL_IO_PUSH(_SP)
#define LOCAL_IO_POP(_SP)
#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
#endif // _COMPLIANCE_MODEL_H