aboutsummaryrefslogtreecommitdiff
path: root/spike_main
AgeCommit message (Collapse)AuthorFilesLines
2024-04-30Support per-device arguments and device factory reuseLIU Yu1-3/+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.
2024-02-29Fix help message to document `--device=<name>,<args>` usage by #1522LIU Yu1-1/+2
2023-12-08Rely on default initializer to provide debug_module_config_t defaultsJerry Zhao1-11/+1
2023-12-08Remove old explicit-fields cfg_t constructor, switch to default constructorJerry Zhao2-26/+2
2023-12-08Remove cfg_arg_t from cfg_tJerry Zhao1-2/+2
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-2/+18
2023-11-04expose pmp granularity as a cli option.Karthik B K2-0/+4
PMP Granularity is made available as a command line option. The default value is 4 Bytes. The value can be changed by passing the option --pmp-granularity=<value> to spike. Signed-off-by: Karthik B K <karthik.bk@incoresemi.com>
2023-07-20Introduce `abstract_mem_t` to allow custom implementationsMichal Terepeta1-4/+5
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.
2023-07-11build: Force inclusion of all symbols from extension.o in spike-mainJerry Zhao1-0/+4
The --extension feature requires that all symbols in extension.o be available when the libraries are dynamically loaded by dlopen. Prepending extension.o to the linker command adds the otherwise omitted symbols to spike's dynamic symbol table.
2023-06-20devices: Switch plugin device interface to use device_factory_tJerry Zhao1-49/+9
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
2023-06-20sim_t: change plugin_devices to a vec of shared_ptrsJerry Zhao1-5/+2
2023-03-30Fix --bootargs default value in spike usage help() functionJulien Olivain1-1/+2
Commit 191634d285 changed the default kernel boot args from "console=hvc0 earlycon=sbi" to "console=ttyS0 earlycon", but didn't updated the spike usage help() function. This commit introduces a new macro DEFAULT_KERNEL_BOOTARGS in order to have a single definition. This macro is used everywhere in dts.cc and spike.cc help() function. Signed-off-by: Julien Olivain <ju.o@free.fr>
2023-02-27Improve input validation for --hartids flagAndrew Waterman1-0/+18
Disallow negative hartids, repeated hartids, and empty lists.
2023-02-27Use size_t, rather than int, for hartidsAndrew Waterman2-5/+5
They aren't signed quantities.
2023-01-27Remove dirty_enabled from cfg_tAaron Durbin2-2/+0
The addition of Svadu support and removal of --mmu-dirty command line flag results in the dirty_enabled configuration state no longer being used. Remove the remnants of this state.
2023-01-27Remove --mmu-dirty command line flagAaron Durbin1-2/+0
With the addition of Svadu support, the --mmu-dirty flag no longer controls behavior of A/D updates to PTEs. Remove the flag.
2023-01-18Add --triggers flag to select number of triggersJerry Zhao1-0/+2
2023-01-18Add trigger_count field to cfg_tJerry Zhao2-2/+4
2023-01-10improve merge_mem_regions to handle memory region covering the whole 64-bit ↵Parshintsev Anatoly1-0/+24
address space
2023-01-09simplify check_mem_overlap by utilizing get_inclusive_end of mem_cfg_tParshintsev Anatoly1-4/+1
2023-01-09simplify merge_mem_regions by utilizing get_inclusive_end() of mem_cfg_tParshintsev Anatoly1-3/+3
this is to properly handle potential 64-bit overflow in (base + size) expression
2023-01-09get_inclusive_end implementation for mem_cfg_tParshintsev Anatoly1-3/+2
The method can simplify proper processing of sitiations when (base + size) overflows 64-bit interger.
2023-01-09implement get_size() getter for mem_cfg_t objectParshintsev Anatoly1-7/+7
NFT. We also mark `base` and `size` fields as private.
2023-01-09implement get_base() getter for mem_cfg_t objectParshintsev Anatoly1-10/+10
NFC. The intention is for `base` and `size` fields of mem_cfg_t to be private members. This is the fist part of this commit.
2023-01-04Add --mmu-dirty runtime flagJerry Zhao1-0/+2
2023-01-04Add cfg_t field to enable PTE dirtyingJerry Zhao2-0/+2
2023-01-03Add --[no-]misaligned command-line optionsAndrew Waterman2-0/+4
They don't do anything yet.
2023-01-03Pass cfg object to processor_t constructorAndrew Waterman1-1/+12
This reduces boilerplate as we add additional options.
2022-12-22Remove non-installed header lists from Makefile fragmentsAndrew Waterman1-2/+0
It's just dead code. (Dependences on headers are auto-generated as `.d` files.)
2022-12-15Add config.h includes directly to source files instead of relying on header ↵Jerry Zhao2-0/+2
chaining This step is to ensure that removing config.h out of headers will not cause regressions.
2022-12-15Rename memif_endianness_t to endianness_tJerry Zhao2-3/+3
2022-12-13Move boost asio socket interface to socketif_tJerry Zhao1-26/+1
This reduces dependencies on config.h in sim.h
2022-11-30Reimplement memory merging routinesParshintsev Anatoly1-22/+41
This commit simplifies the codebase by factoring out memory merging and intersection checking routines into separate functions. This allows us to check for corner cases more easily.
2022-11-16Merge pull request #1119 from aap-sc/aap-sc/max_pa_restrictionAndrew Waterman1-5/+24
Do not allow memory regions larger than (1ull << MAX_PADDR_BITS)
2022-11-16Only allow memory regions that are less than (1ull << MAX_PADDR_BITS)Parshintsev Anatoly1-1/+21
Other regions are inaccessible to the hardware being modeled
2022-11-15get rid of redundant casts during mem layout processingParshintsev Anatoly1-4/+3
2022-10-25Remove set_target_endianness | add --big-endian flagJerry Zhao2-1/+4
Set target endianess in constructors
2022-10-20Set 16..4096-byte bound on cache-block sizeAndrew Waterman1-2/+5
16 B suffices to subsume all aligned accesses (including the Q extension). Spike does not actually rely on this property, but in some real systems, it is impractical to guarantee atomicity across cache lines. 4096 B suffices to prevent cache lines from spanning pages (which would require multiple TLB accesses). This one is a bug fix, since we were not performing multiple TLB accesses in this case.
2022-10-14Support command-line configuration of number of pmpregionsJerry Zhao1-0/+3
2022-10-14Report error if an unsupported memory configuration is detectedParshintsev Anatoly1-3/+8
2022-10-07Add --dm-no-abstract-fpr option.Tim Newsome1-1/+5
Previously FPRs could always be accessed using abstract commands. I need this to get coverage of some OpenOCD code that I broke. (See https://github.com/riscv/riscv-openocd/pull/745)
2022-10-04Suppress unused-variable warnings in spike mainAndrew Waterman1-1/+1
2022-10-04Fix or work around other unused-parameter warnings in ancillary programsAndrew Waterman2-5/+6
2022-10-04Suppress unused-parameter warnings in spike mainAndrew Waterman1-16/+16
2022-09-23Build and install lib and header dependencies for HammerJerin Joy1-0/+2
https://github.com/rivosinc/hammer Signed-off-by: Jerin Joy <joy@rivosinc.com>
2022-08-10Add missed decription for log-commits optionWeiwei Li1-0/+1
2022-04-30Add missing description of --dtb in --help messageAndrew Waterman1-0/+1
2022-04-12Move real_time_clint into cfg_tRupert Swarbrick1-4/+4
2022-04-12Move varch into cfg_tRupert Swarbrick1-3/+3
2022-04-12Remove nprocs from cfg_tRupert Swarbrick1-7/+8
Now we have hartids, we can remove nprocs so that we have a single source of truth.