diff options
author | Florian Zaruba <zarubaf@iis.ee.ethz.ch> | 2018-11-16 19:03:17 +0100 |
---|---|---|
committer | Andrew Waterman <aswaterman@gmail.com> | 2018-11-16 10:03:17 -0800 |
commit | 980711c00ec47abf98a746b3b78368fe3595a283 (patch) | |
tree | f8533ed4c5067d49d64a021b393b4ddb61b8c447 | |
parent | 8a2b5bb543bcfa5e92c2cac1e2cfa7ee6602d7ce (diff) | |
download | riscv-tests-980711c00ec47abf98a746b3b78368fe3595a283.zip riscv-tests-980711c00ec47abf98a746b3b78368fe3595a283.tar.gz riscv-tests-980711c00ec47abf98a746b3b78368fe3595a283.tar.bz2 |
Test memory content on failing SC (#171)
-rw-r--r-- | isa/rv64ua/lrsc.S | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/isa/rv64ua/lrsc.S b/isa/rv64ua/lrsc.S index f73a404..c7589d7 100644 --- a/isa/rv64ua/lrsc.S +++ b/isa/rv64ua/lrsc.S @@ -28,12 +28,18 @@ 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); \ + li a5, 0xdeadbeef; \ + sc.w a4, a5, (a0); \ +) + +# make sure the failing sc did not commit into memory +TEST_CASE( 3, a4, 0, \ + lw a4, foo; \ ) # make sure that sc with the wrong reservation fails. # TODO is this actually mandatory behavior? -TEST_CASE( 3, a4, 1, \ +TEST_CASE( 4, a4, 1, \ la a0, foo; \ la a1, fooTest3; \ lr.w a1, (a1); \ @@ -62,7 +68,7 @@ blt a1, a3, 1b fence # expected result is 512*ncores*(ncores+1) -TEST_CASE( 4, a0, 0, \ +TEST_CASE( 5, a0, 0, \ lw a0, foo; \ slli a1, a3, LOG_ITERATIONS-1; \ 1:sub a0, a0, a1; \ @@ -71,7 +77,7 @@ TEST_CASE( 4, a0, 0, \ ) # make sure that sc-after-successful-sc fails. -TEST_CASE( 5, a1, 1, \ +TEST_CASE( 6, a1, 1, \ la a0, foo; \ 1:lr.w a1, (a0); \ sc.w a1, x0, (a0); \ |