aboutsummaryrefslogtreecommitdiff
path: root/isa/rv64ui/lrsc.S
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer@dabbelt.com>2016-07-12 09:19:08 -0700
committerPalmer Dabbelt <palmer@dabbelt.com>2016-07-12 09:19:08 -0700
commit00df2be7a414d34c7633142c73ac6130f6cbbd4b (patch)
tree49ade5408f077f851fd90280fc300709148883f9 /isa/rv64ui/lrsc.S
parentd82a880f81cb5d197f712bbd17e821e0d70d7b75 (diff)
parent3dc00e7b04834f862a074ac8822892e1ecfc009c (diff)
downloadriscv-tests-smi-demo.zip
riscv-tests-smi-demo.tar.gz
riscv-tests-smi-demo.tar.bz2
Merge commit '3dc00e7' into smi-demosmi-demo
Diffstat (limited to 'isa/rv64ui/lrsc.S')
-rw-r--r--isa/rv64ui/lrsc.S84
1 files changed, 0 insertions, 84 deletions
diff --git a/isa/rv64ui/lrsc.S b/isa/rv64ui/lrsc.S
deleted file mode 100644
index 9422739..0000000
--- a/isa/rv64ui/lrsc.S
+++ /dev/null
@@ -1,84 +0,0 @@
-# See LICENSE for license details.
-
-#*****************************************************************************
-# lrsr.S
-#-----------------------------------------------------------------------------
-#
-# Test LR/SC instructions.
-#
-
-#include "riscv_test.h"
-#include "test_macros.h"
-
-RVTEST_RV64U
-RVTEST_CODE_BEGIN
-
-# get a unique core id
-la a0, coreid
-li a1, 1
-amoadd.w a2, a1, (a0)
-
-# for now, only run this on core 0
-1:li a3, 1
-bgeu a2, a3, 1b
-
-1: lw a1, (a0)
-bltu a1, a3, 1b
-
-# make sure that sc without a reservation fails.
-TEST_CASE( 2, a4, 1, \
- la a0, foo; \
- sc.w a4, x0, (a0); \
-)
-
-# make sure that sc with the wrong reservation fails.
-# TODO is this actually mandatory behavior?
-TEST_CASE( 3, a4, 1, \
- la a0, foo; \
- add a1, a0, 1024; \
- lr.w a1, (a1); \
- sc.w a4, a1, (a0); \
-)
-
-# have each core add its coreid to foo 1000 times
-la a0, foo
-li a1, 1000
-1: lr.w a4, (a0)
-add a4, a4, a2
-sc.w a4, a4, (a0)
-bnez a4, 1b
-add a1, a1, -1
-bnez a1, 1b
-
-# wait for all cores to finish
-la a0, barrier
-li a1, 1
-amoadd.w x0, a1, (a0)
-1: lw a1, (a0)
-blt a1, a3, 1b
-fence
-
-# expected result is 1000*ncores*(ncores-1)/2
-TEST_CASE( 4, a2, 0, \
- la a0, foo; \
- li a1, 500; \
- mul a1, a1, a3; \
- add a2, a3, -1; \
- mul a1, a1, a2; \
- lw a2, (a0); \
- sub a2, a2, a1; \
-)
-
-TEST_PASSFAIL
-
-RVTEST_CODE_END
-
- .data
-RVTEST_DATA_BEGIN
-
- TEST_DATA
-
-coreid: .word 0
-barrier: .word 0
-foo: .word 0
-RVTEST_DATA_END