aboutsummaryrefslogtreecommitdiff
path: root/riscv/devices.h
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2020-02-15 19:22:35 +0530
committerAnup Patel <anup@brainfault.org>2020-02-15 19:22:35 +0530
commit9d7c52c6bba57efe895be88fd3ba6a90e66bd3a8 (patch)
treea5b934d36c3b1d99df869c33a26900135578cc80 /riscv/devices.h
parente5e64c0fa69993448d498735bfaef400aabd090b (diff)
downloadspike-9d7c52c6bba57efe895be88fd3ba6a90e66bd3a8.zip
spike-9d7c52c6bba57efe895be88fd3ba6a90e66bd3a8.tar.gz
spike-9d7c52c6bba57efe895be88fd3ba6a90e66bd3a8.tar.bz2
Add optional support for real-time clint
This patch adds optional support clint timer incrementing at real-time rate. This can be enabled by passing command line parameter "--real-time-clint". This feature can be used for: 1. Checking whether any code addition to Spike is slowing down simulation too much 2. Comparing run-time for software on Spike with other functional simulators (such as QEMU) Signed-off-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'riscv/devices.h')
-rw-r--r--riscv/devices.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/riscv/devices.h b/riscv/devices.h
index aa4c050..130be3c 100644
--- a/riscv/devices.h
+++ b/riscv/devices.h
@@ -63,7 +63,7 @@ class mem_t : public abstract_device_t {
class clint_t : public abstract_device_t {
public:
- clint_t(std::vector<processor_t*>&);
+ clint_t(std::vector<processor_t*>&, uint64_t freq_mhz, bool real_time);
bool load(reg_t addr, size_t len, uint8_t* bytes);
bool store(reg_t addr, size_t len, const uint8_t* bytes);
size_t size() { return CLINT_SIZE; }
@@ -73,6 +73,10 @@ class clint_t : public abstract_device_t {
typedef uint64_t mtimecmp_t;
typedef uint32_t msip_t;
std::vector<processor_t*>& procs;
+ uint64_t freq_mhz;
+ bool real_time;
+ uint64_t real_time_ref_secs;
+ uint64_t real_time_ref_usecs;
mtime_t mtime;
std::vector<mtimecmp_t> mtimecmp;
};