Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
|
|
This change allows to create custom implementations of `abstract_mem_t`
and inject them when constructing `sim_t`. The current `mem_t`
implementation remains unchanged.
Fixes #1408.
|
|
This is public so libspike users can precisely configure the device bus
without going through the DTS interface
|
|
Plugins should now implement and register a device_factory_t to
configure how that device should be parsed from a FDT, and an optional
default DTS string.
This drops support for command-line flag-based device configuration
|
|
|
|
make_dtb is only called here, this simplifies later work
towards refactoring device DTS node generation
|
|
|
|
|
|
|
|
These are redundant with sim_t::devices
|
|
|
|
|
|
|
|
So we can soon convert those classes to use simif_t instead of sim_t.
|
|
To be explicit about which methods of simif_t and htif_t we implement.
|
|
Support discontiguous hart IDs in debug module
|
|
|
|
This facility will allow interactive routines to loop without starving
the HTIF.
|
|
Before 3b26740, the reset was necessary because sim_t::get_dts would be
called before sim_t::make_dtb was called in reset(). This is no longer
necessary since now `make_dtb` is called in the constructor of sim_t
|
|
|
|
The two-thread approach was originally motivated by making Spike look
as similar as possible to other HTIF targets. But we can get the same
semantics without threading by running the simulator inside of the HTIF
host's idle loop instead of performing a context switch.
This was motivated by speeding up the simulator on Mac OS (it's worth
around 20% because using pthread condition variables to force strict
alternation is very slow). But I think it also simplifies the control
flow enough to justify it on that basis, too.
|
|
|
|
|
|
|
|
|
|
This reduces dependencies on config.h in sim.h
|
|
Set target endianess in constructors
|
|
|
|
|
|
|
|
|
|
Update README
|
|
The ns16550 is a widely use serial device so we add a simplified
ns16550 device emulation which is good enough for Linux, OpenSBI,
and hypervisors to use as console.
Signed-off-by: Anup Patel <anup@brainfault.org>
|
|
We need an interrupt controller in Spike which will allow us to
emulate more real-world devices such as UART, VirtIO net, VirtIO
block, etc.
The RISC-V PLIC (or SiFive PLIC) is the commonly used interrupt
controller in existing RISC-V platforms so this patch adds PLIC
emulation for Spike.
Signed-off-by: Anup Patel <anup@brainfault.org>
|
|
|
|
|
|
The only slightly difficult thing here is that hartids will always
be considered "overridden" by the time we get to sim_t::sim_t (either
overridden by a command line argument, or overridden when we set
default hartids just before the constructor). To allow downstream code
to distinguish between "I picked IDs 0, 1, 2, 3 because the user asked
for 4 processors" and "The user explicitly asked for IDs 0, 1, 2, 3",
we have an extra explicit_hartids field.
|
|
|
|
|
|
|
|
|
|
|
|
This commit defines a "cfg_t" structure, which currently just holds
the initrd address range. It will be augmented in future commits to
hold other configuration arguments as well.
To represent a configuration argument, we define an arg_t base class.
This holds a current value, together with a flag that tells us whether
the value has been updated from the default. The idea is that in
future we're going to use that flag when reading a DTB file: if an
argument has actually been specified on the command line, we need to
take it into account; if not, we can ignore the default and use the
DTB file's supplied value.
|
|
This is a minor change, turning processor_t from a child class of
isa_parser_t into a class that contains an isa_parser_t as a field.
The point is that it is a step toward separating out
"configuration" (and ISA string parsing) from processor state. This
should be helpful for rejigging things so that we construct more from
a supplied device tree.
|
|
|
|
|
|
sout is renamed to sout_ to reduce likelihood programmers accidentally use it.
|
|
|
|
|