aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2017-01-15 08:42:31 -0800
committerMax Filippov <jcmvbkbc@gmail.com>2017-01-15 13:01:56 -0800
commit0a362d0768c443cf9e5c36c8398c92bfebe9b8a4 (patch)
tree11e0c32d8483b71586b17d07f2c5d96efc73404e /tests/tcg
parent4f89b41c28a17739c4fd40886542e3cb8c7a15a3 (diff)
target/xtensa: tests: add ccount write tests
Check that CCOUNT SR is writable and that CCOMPARE timers are updated when CCOUNT is written to. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'tests/tcg')
-rw-r--r--tests/tcg/xtensa/test_timer.S34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/tcg/xtensa/test_timer.S b/tests/tcg/xtensa/test_timer.S
index 844c0327aa..6cda71adbb 100644
--- a/tests/tcg/xtensa/test_timer.S
+++ b/tests/tcg/xtensa/test_timer.S
@@ -19,6 +19,40 @@ test ccount
assert ne, a3, a4
test_end
+test ccount_write
+ rsr a3, ccount
+ rsr a4, ccount
+ sub a4, a4, a3
+ movi a2, 0x12345678
+ wsr a2, ccount
+ esync
+ rsr a3, ccount
+ sub a3, a3, a2
+ slli a4, a4, 2
+ assert ltu, a3, a4
+test_end
+
+test ccount_update_deadline
+ movi a2, 0
+ wsr a2, intenable
+ rsr a2, interrupt
+ wsr a2, intclear
+ movi a2, 0
+ wsr a2, ccompare1
+ wsr a2, ccompare2
+ movi a2, 0x12345678
+ wsr a2, ccompare0
+ rsr a3, interrupt
+ assert eqi, a3, 0
+ movi a2, 0x12345677
+ wsr a2, ccount
+ esync
+ nop
+ rsr a2, interrupt
+ movi a3, 1 << XCHAL_TIMER0_INTERRUPT
+ assert eq, a2, a3
+test_end
+
test ccompare
movi a2, 0
wsr a2, intenable