From 09b1969d2234836557df373e37f335ce992ca778 Mon Sep 17 00:00:00 2001 From: modeco80 Date: Sat, 22 Jul 2023 22:46:36 -0400 Subject: [PATCH] riscv: actually, CLINT allows reading the match registers! --- native/projects/riscv/src/Devices/ClntDevice.cpp | 6 ++++++ native/projects/riscv_test_harness/main.cpp | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/native/projects/riscv/src/Devices/ClntDevice.cpp b/native/projects/riscv/src/Devices/ClntDevice.cpp index 2c7468d..ba41953 100644 --- a/native/projects/riscv/src/Devices/ClntDevice.cpp +++ b/native/projects/riscv/src/Devices/ClntDevice.cpp @@ -27,6 +27,12 @@ namespace riscv::devices { case TIMERH_ADDRESS: return timerCountHigh; + + case MATCHL_ADDRESS: + return timerMatchLow; + + case MATCHH_ADDRESS: + return timerMatchHigh; default: return 0x0; diff --git a/native/projects/riscv_test_harness/main.cpp b/native/projects/riscv_test_harness/main.cpp index e5736c0..f9b5d7f 100644 --- a/native/projects/riscv_test_harness/main.cpp +++ b/native/projects/riscv_test_harness/main.cpp @@ -30,3 +30,7 @@ struct SimpleUartDevice : public riscv::Bus::MmioDevice { } } }; + +int main() { + return 0; +}