Skip to content

Commit 1f9e2fe

Browse files
committed
Add Ziccid test
Requires latest Spike.
1 parent 7b7074a commit 1f9e2fe

File tree

3 files changed

+61
-2
lines changed

3 files changed

+61
-2
lines changed

isa/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ include $(src_dir)/rv64um/Makefrag
1313
include $(src_dir)/rv64ua/Makefrag
1414
include $(src_dir)/rv64uf/Makefrag
1515
include $(src_dir)/rv64ud/Makefrag
16+
include $(src_dir)/rv64uziccid/Makefrag
1617
include $(src_dir)/rv64uzfh/Makefrag
1718
include $(src_dir)/rv64uzba/Makefrag
1819
include $(src_dir)/rv64uzbb/Makefrag
@@ -59,10 +60,10 @@ vpath %.S $(src_dir)
5960
$(RISCV_OBJDUMP) $< > $@
6061

6162
%.out: %
62-
$(RISCV_SIM) --isa=rv64gch_zfh_zicboz_svnapot_zicntr_zba_zbb_zbc_zbs --misaligned $< 2> $@
63+
$(RISCV_SIM) --isa=rv64gch_ziccid_zfh_zicboz_svnapot_zicntr_zba_zbb_zbc_zbs --misaligned $< 2> $@
6364

6465
%.out32: %
65-
$(RISCV_SIM) --isa=rv32gc_zfh_zicboz_svnapot_zicntr_zba_zbb_zbc_zbs --misaligned $< 2> $@
66+
$(RISCV_SIM) --isa=rv32gc_ziccid_zfh_zicboz_svnapot_zicntr_zba_zbb_zbc_zbs --misaligned $< 2> $@
6667

6768
define compile_template
6869

@@ -108,6 +109,7 @@ $(eval $(call compile_template,rv64um,-march=rv64g -mabi=lp64))
108109
$(eval $(call compile_template,rv64ua,-march=rv64g -mabi=lp64))
109110
$(eval $(call compile_template,rv64uf,-march=rv64g -mabi=lp64))
110111
$(eval $(call compile_template,rv64ud,-march=rv64g -mabi=lp64))
112+
$(eval $(call compile_template,rv64uziccid,-march=rv64g -mabi=lp64))
111113
$(eval $(call compile_template,rv64uzfh,-march=rv64g_zfh -mabi=lp64))
112114
$(eval $(call compile_template,rv64uzba,-march=rv64g_zba -mabi=lp64))
113115
$(eval $(call compile_template,rv64uzbb,-march=rv64g_zbb -mabi=lp64))

isa/rv64uziccid/Makefrag

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#=======================================================================
2+
# Makefrag for rv64uziccid tests
3+
#-----------------------------------------------------------------------
4+
5+
rv64uziccid_sc_tests = \
6+
ziccid \
7+
8+
rv64uziccid_p_tests = $(addprefix rv64uziccid-p-, $(rv64uziccid_sc_tests))
9+
rv64uziccid_v_tests = $(addprefix rv64uziccid-v-, $(rv64uziccid_sc_tests))

isa/rv64uziccid/ziccid.S

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# See LICENSE for license details.
2+
3+
#*****************************************************************************
4+
# ziccid.S
5+
#-----------------------------------------------------------------------------
6+
#
7+
# Test Ziccid eventuality property.
8+
#
9+
10+
#include "riscv_test.h"
11+
#include "test_macros.h"
12+
13+
RVTEST_RV64UF
14+
RVTEST_CODE_BEGIN
15+
16+
la t0, insn
17+
li t1, 0x00100513 # li a0, 1
18+
li t2, 0x00000513 # li a0, 0
19+
20+
sw t2, (t0)
21+
fence.i
22+
23+
li a1, 100
24+
loop:
25+
.balign 2
26+
insn:
27+
.word 0
28+
29+
addi a1, a1, -1
30+
bnez a1, 1f
31+
# modify instruction on 100th iteration
32+
sw t1, (t0)
33+
1:
34+
# break out of loop if the modified instruction is executed
35+
beqz a0, loop
36+
37+
TEST_CASE(2, x0, 0, nop)
38+
39+
TEST_PASSFAIL
40+
41+
RVTEST_CODE_END
42+
43+
.data
44+
RVTEST_DATA_BEGIN
45+
46+
TEST_DATA
47+
48+
RVTEST_DATA_END

0 commit comments

Comments
 (0)