aboutsummaryrefslogtreecommitdiff
path: root/riscv/clint.cc
AgeCommit message (Collapse)AuthorFilesLines
2024-04-30Support per-device arguments and device factory reuseLIU Yu1-2/+2
As proposed in #1652, we made the following changes to MMIO device (factory) plugin API, to mitigate current limitations and facilitate factory reuse. - removed `sargs` from `device_factory_t`, and introduced a new type alias `device_factory_sargs_t` to capture `<device_factory_t *, sargs>` pairs, this is used to instantiate sim_t instances; - changed the signature of `device_factory_t::generate_fdt` and `device_factory_t::parse_from_fdt` to take on an extra `sargs` argument, for instantiating devices with per-device arguments; - made `device_factory_t` const and potentially resuable across multiple `sim_t` instances.
2023-12-11Merge pull request #1313 from endeneer/fdt-parse-clint-sifiveJerry Zhao1-1/+1
riscv: sim.cc: Parse for "sifive,clint0" if "riscv,clint0" is absent
2023-12-11riscv: sim.cc: Parse for "sifive,clint0" if "riscv,clint0" is absentTan En De1-1/+1
"riscv,clint0" and "sifive,clint0" in device tree's "compatible" string point to the same driver, as can be seen from drivers/clocksource/timer-clint.c in Linux kernel. https://github.com/torvalds/linux/commit/2ac6795fcc085e8d03649f1bbd0d70aaff612cad Signed-off-by: Tan En De <ende.tan@starfivetech.com>
2023-12-08Remove cfg_arg_t from cfg_tJerry Zhao1-1/+1
Argument parsing should be scoped to the code which constucts cfg_t
2023-12-08Fix Spike --device option to pass on args to downstream pluginsjoey03201-1/+2
2023-06-20device_t: Add device_factory_t's for ns16550/clint/plicJerry Zhao1-0/+31
2023-06-20devices: Pass const pointers to sim_t to clint/plicJerry Zhao1-1/+1
2023-06-20clint: Change clint_t::increment to override abstract_device_t::tick(rtc_ticks)Jerry Zhao1-5/+5
2023-03-09Use simif_t instead of sim_t for clint/plicScott Johnson1-2/+2
In keeping with the spirit of simif_t.
2023-03-03Fix misaligned accesses to clint's msip regsScott Johnson1-5/+7
Misaligned MMIO is unspecified but this is simple enough.
2023-03-02Initialize MTIP at resetScott Johnson1-0/+1
Since mtime and mtimecmp both initialize to 0, and "a machine timer interrupt becomes pending whenever mtime contains a value greater than or equal to mtimecmp," MTIP should be 1. Before this change, MTIP would be 0 until the first increment, or until reading/writing from CLINT regs (since clint_t::load() and clint_t::store() call increment(0)).
2023-03-01Support discontiguous hart IDs in CLINTAndrew Waterman1-30/+47
This is a large delta because the old implementation baked in multiple assumptions about the contiguity of hart IDs. As a side effect, fix implementation for big-endian hosts.
2022-12-20Allow reads/writes to reserved CLINT regionsJerry Zhao1-0/+4
Previously, all loads/stores to reserved regions caused access faults. Now, loads to reserved regions return 0, while writes are dropped. This more closely matches actual hardware implementations
2022-07-21add support for time/timeh/htimedelta/htimedeltah csrsWeiwei Li1-0/+1
2021-09-08Convert mip to csr_t familyScott Johnson1-5/+5
This changes the commitlog of `csrw sip` so that it only logs a change to `mip`, instead of both `mip` and `sip`. This is arguably preferable, since there is no real `sip` register -- it is only a view into `mip`. It also adds proper tracing of the modification to `mip` when doing `csrw` to `hip`, `hvip`, and `vsip`, which were all missing previously.
2020-02-15Make CLINT API use Hz instead of MHzAndrew Waterman1-3/+3
2020-02-15Add optional support for real-time clintAnup Patel1-3/+20
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>
2019-11-27Initialize mtimeAndrew Waterman1-1/+1
Closes #363
2017-03-22riscv: replace rtc device with a real clint implementationWesley W. Terpstra1-0/+72