mirror of
https://github.com/openhwgroup/cva6.git
synced 2025-04-22 05:07:21 -04:00
ISACOV : Add test for sequential hazard instruction (#1471)
This commit is contained in:
parent
47722a541e
commit
e32e3871df
2 changed files with 87 additions and 0 deletions
81
verif/tests/custom/isacov/seq_hazard.S
Normal file
81
verif/tests/custom/isacov/seq_hazard.S
Normal file
|
@ -0,0 +1,81 @@
|
|||
# Copyright 2023 Thales DIS SAS
|
||||
#
|
||||
# Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0
|
||||
# You may obtain a copy of the License at https://solderpad.org/licenses/
|
||||
#
|
||||
# Original Author: Ayoub JALALI (ayoub.jalali@external.thalesgroup.com)
|
||||
|
||||
#*****************************************************************************
|
||||
# seq_hazard.S
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
.globl main
|
||||
main:
|
||||
# core of the test
|
||||
li s1, 0xffff0000 # Init reg value
|
||||
li s2, 0x80000000
|
||||
li a1, 0x1
|
||||
li a2, 0x1
|
||||
csrr s8, 0x340
|
||||
jal a1, jump1
|
||||
|
||||
jump1:
|
||||
jalr a1, a1, 8
|
||||
|
||||
jump2:
|
||||
jal a1, jump3
|
||||
|
||||
jump3:
|
||||
sb a1, 0(a1)
|
||||
jal a1, jump4
|
||||
|
||||
jump4:
|
||||
lb a1, 0(a1)
|
||||
mul a1, a1, s8
|
||||
csrrw s8, 0x340, a1
|
||||
mul a1, a2, s1
|
||||
lb a1, 0(a1)
|
||||
mulh a1, a2, s1
|
||||
lb a1, 0(a1)
|
||||
div a1, s1, a2
|
||||
lb a1, 0(a1)
|
||||
jal a1, jump5
|
||||
|
||||
jump5:
|
||||
csrrw a1, 0x340, a1
|
||||
csrr a1, 0x340
|
||||
jalr a1, a1, 12
|
||||
jal a1, jump6
|
||||
|
||||
jump6:
|
||||
sw a1, 0(s2)
|
||||
lw a1, 0(s2)
|
||||
jalr t1, a1, 12
|
||||
jal a1, jump7
|
||||
|
||||
jump7:
|
||||
mul a1, a1, a2
|
||||
jalr a1, a1, 8
|
||||
div a1, a1, a2
|
||||
jalr a1, a1, 8
|
||||
csrr a1, 0x340
|
||||
lb a1, 124(a1)
|
||||
|
||||
# (example of) final self-check test
|
||||
li a0, 0xCAFE;
|
||||
li a1, 0xCAFE;
|
||||
xor a2, a0, a1;
|
||||
beqz a2, pass;
|
||||
|
||||
fail:
|
||||
# Failure post-processing (messages, ecall setup etc.)
|
||||
li a0, 0x0;
|
||||
jal exit;
|
||||
|
||||
pass:
|
||||
# Success post-processing (messages, ecall setup etc.)
|
||||
li a0, 0x0;
|
||||
jal exit;
|
|
@ -48,3 +48,9 @@
|
|||
path_var: TESTS_PATH
|
||||
gcc_opts: "-static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles ../tests/custom/common/syscalls.c ../tests/custom/common/crt.S -I../tests/custom/env -I../tests/custom/common -T ../tests/custom/common/test.ld -lgcc"
|
||||
asm_tests: <path_var>/custom/isacov/csr_test.S
|
||||
|
||||
- test: seq_test
|
||||
iterations: 1
|
||||
path_var: TESTS_PATH
|
||||
gcc_opts: "-static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles ../tests/custom/common/syscalls.c ../tests/custom/common/crt.S -I../tests/custom/env -I../tests/custom/common -T ../tests/custom/common/test.ld -lgcc"
|
||||
asm_tests: <path_var>/custom/isacov/seq_hazard.S
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue