Skip to content

Commit

Permalink
Merge pull request #357 from ahadali-10x/atomic_ACTs
Browse files Browse the repository at this point in the history
Add tests for Atomic Memory Operation(AMO) instructions
  • Loading branch information
allenjbaum authored Sep 27, 2023
2 parents 46cf99d + c4a7733 commit f66d8ff
Show file tree
Hide file tree
Showing 29 changed files with 17,548 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## [3.7.1] - 2023-08-03
- Add ACTs for Atomic Extension excluding Lr/Sc Instructions.
- Added Test macro for the execution of atomic instructions.

## [3.7.0] - 2023-05-16
- Updated the LI macro
- Make Trap handler compatible for RV32E
Expand Down
12 changes: 12 additions & 0 deletions riscv-test-suite/env/test_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,18 @@ RVTEST_SIGUPD_F(swreg,destreg,flagreg)
RVTEST_SIGUPD_FID(swreg,destreg,flagreg) ;\
RVMODEL_IO_ASSERT_GPR_EQ(testreg, destreg, correctval)

//Tests for atomic memory operation(AMO) instructions
#define TEST_AMO_OP(inst, destreg, origptr, reg2, origval, updval, sigptr, ...) ;\
.if NARG(__VA_ARGS__) == 1 ;\
.set offset,_ARG1(__VA_OPT__(__VA_ARGS__,0)) ;\
.endif ;\
LI(reg2, MASK_XLEN(origval)) ;\
RVTEST_SIGUPD(sigptr, reg2) /*Write original AMO src */ ;\
LI(reg2, MASK_XLEN(updval)) ;\
addi origptr, sigptr, offset-REGWIDTH /* Calculate where orig AMO src is stored */ ;\
inst destreg, reg2, (origptr) /*origval -> destreg; updated val -> (origptr) */ ;\
RVTEST_SIGUPD(sigptr, destreg) /* write original AMO val */

#define TEST_AUIPC(inst, destreg, correctval, imm, swreg, offset, testreg) ;\
TEST_CASE(testreg, destreg, correctval, swreg, offset, \
LA testreg, 1f ;\
Expand Down
Loading

0 comments on commit f66d8ff

Please sign in to comment.