1 # See LICENSE for license details.
3 #*****************************************************************************
5 #-----------------------------------------------------------------------------
7 # Test LR/SC instructions.
10 #include "riscv_test.h"
11 #include "test_macros.h"
16 # get a unique core id
21 # for now, only run this on core 0
28 # make sure that sc without a reservation fails.
29 TEST_CASE( 2, a4, 1, \
34 # make sure that sc with the wrong reservation fails.
35 # TODO is this actually mandatory behavior?
36 TEST_CASE( 3, a4, 1, \
43 #define LOG_ITERATIONS 10
45 # have each core add its coreid+1 to foo 1024 times
47 li a1, 1<<LOG_ITERATIONS
56 # wait for all cores to finish
64 # expected result is 512*ncores*(ncores+1)
65 TEST_CASE( 4, a0, 0, \
67 slli a1, a3, LOG_ITERATIONS-1; \
73 # make sure that sc-after-successful-sc fails.
74 TEST_CASE( 5, a1, 1, \