diff options
Diffstat (limited to 'riscv/devices.h')
-rw-r--r-- | riscv/devices.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/riscv/devices.h b/riscv/devices.h index cb3b6d9..f3ecb67 100644 --- a/riscv/devices.h +++ b/riscv/devices.h @@ -34,17 +34,20 @@ class rom_device_t : public abstract_device_t { std::vector<char> data; }; -class rtc_t : public abstract_device_t { +class clint_t : public abstract_device_t { public: - rtc_t(std::vector<processor_t*>&); + clint_t(std::vector<processor_t*>&); 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 regs.size() * sizeof(regs[0]); } + size_t size() { return CLINT_SIZE; } void increment(reg_t inc); private: + typedef uint64_t mtime_t; + typedef uint64_t mtimecmp_t; + typedef uint32_t msip_t; std::vector<processor_t*>& procs; - std::vector<uint64_t> regs; - uint64_t time() { return regs[0]; } + mtime_t mtime; + std::vector<mtimecmp_t> mtimecmp; }; #endif |