aboutsummaryrefslogtreecommitdiff
path: root/spike_main/spike.cc
AgeCommit message (Collapse)AuthorFilesLines
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-04Suppress unused-parameter warnings in spike mainAndrew Waterman1-16/+16
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.
2022-04-12Move hartids into cfg_tRupert Swarbrick1-11/+17
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.
2022-04-12Move the "default hartids" logic from sim.cc into spike.ccRupert Swarbrick1-0/+16
This moves another part of the "configuration" out of the generic sim.cc code.
2022-04-12Slightly refactor --hartids parsing in spike.ccRupert Swarbrick1-13/+16
We now parse to a std::vector<int> and then set the "hartids" variable to the result. There is a slight functional change here, in that if you pass "--hartids 1,2,3 --hartids 4,5", you'll now get 2 cores with ids of 4,5 rather than 5 cores with ids of 1,2,3,4,5. This is what most tools do with repeated command line arguments and I suspect the old behaviour was actually by accident!
2022-04-12Move start_pc into cfg_tRupert Swarbrick1-3/+2
2022-04-11Split mem layout computation in spike.cc (#957)Rupert Swarbrick1-25/+36
The motivation here is mostly to enable a refactoring where the memory layout (sans allocated memory) gets passed to DTS/DTB code before we ever allocate anything. But it turns out to make merge_overlapping_memory_regions a bit simpler, which is an added bonus.
2022-03-18Fold priv parameter into cfg_tRupert Swarbrick1-4/+4
2022-03-18Fold isa parameter into cfg_tRupert Swarbrick1-4/+5
2022-03-18Fold nprocs parameter into cfg_tRupert Swarbrick1-5/+5
2022-03-18Fold bootargs parameter in the new cfg_t typeRupert Swarbrick1-4/+4
2022-03-18Initial step towards factoring out command line configurationRupert Swarbrick1-7/+8
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.
2022-02-18Documentation: Cache block size for CMO operations default 64 (#923)John Ingalls1-1/+1
2022-01-29add blocksz parameter to specify the cache block size for CBO operationsliweiwei1-0/+10
2022-01-06Don't say "master" (#898)Tim Newsome1-3/+3
Requested by "LfX Security - Non Inclusive Language Alerts"
2021-09-17Don't use "using"Andrew Waterman1-4/+3
2021-09-14add option --cmd to read commands from file (#772)Elmar Melcher1-3/+11
2021-09-06add option --log=<name> to command line help (#795)Elmar Melcher1-0/+1
2021-08-03kill program if socket creation failsElmar Melcher1-0/+1
2021-08-03use socket output stream for processor debug outputElmar Melcher1-1/+1
2021-08-03declare socket properties in processor_tElmar Melcher1-0/+25
2021-08-03declare socket properties in sim_tElmar Melcher1-1/+10
2021-06-02sim: rewrite memory-region overlapping helperChih-Min Chao1-20/+19
problem: when the following memory region is specified -m0x00410000:0x1000, 0x00410200:0x1000, 0x00410400:0x1000, 0x00410600:0x1000, 0x00410800:0x1000, 0x00411000:0x1000, 0x00412000:0x1000, 0x00413000:0x1000, 0x00414000:0x1000 The error is ERROR (duplicate_node_names): Duplicate node name /memory@410 ERROR (duplicate_node_names): Duplicate node name /memory@410 ERROR (duplicate_node_names): Duplicate node name /memory@410 ERROR (duplicate_node_names): Duplicate node name /memory@410 ERROR (duplicate_node_names): Duplicate node name /memory@410 ERROR (duplicate_node_names): Duplicate node name /memory@410 ERROR: Input tree has errors, aborting (use -f to force output) cause: the merge_overlapping_memory_regions works not well in partial overlap case change: 1. use forward way to avoid weird reverse iterator behavior in C++ 2. use address but not page number since the base addresses are all aligned in make_mems Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
2021-02-14Support multiple extensions at the same timeZitao Fang1-3/+5
2021-02-04Fix --kernel and --initrd options w.r.t. sparse mem_t implementationAndrew Waterman1-4/+7
For some reason, the old accessors for the non-sparse version were left dangling. These methods are used by the --kernel and --initrd options, and so those options were just broken. This also fixes a memory leak and refactors the implementation a bit.
2020-12-29Fix compile warningsAndrew Waterman1-1/+1
2020-10-26Validate integer command-line argumentsAndrew Waterman1-6/+23
Resolves #583
2020-08-11Add option to dissable implicit ebreak in program bufferSamuel Obuch1-1/+5
2020-07-09Add kernel command line option for spikeAnup Patel1-0/+18
It is very inconvenient to always embed kernel flat image into OpenSBI for booting Linux/Xvisor on Spike. We add optional "--kernel" command line option for spike. Using this new option, users can specify kernel flat image separately and OpenSBI ELF separately. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2020-07-09Add bootargs command-line option to SpikeAnup Patel1-1/+4
We add bootargs command-line option to Spike which allows us to provide custom kernel parameters to Linux and Xvisor. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2020-05-28fix the memory regions checker (#474)Dave Wen1-1/+1
2020-05-10Merge branch 'configurable_PMP'Andrew Waterman1-2/+3
2020-04-27fdt: restructure dtb create and config flowChih-Min Chao1-3/+1
1. pass dtb option from constructor 2. separate dtb generation from rom initialization 3. setup clint base from dtb Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
2020-04-27fdt: option: add --dtb option to specify dtb binary fileChih-Min Chao1-0/+3
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
2020-04-27merge the overlapping or containing memory regions when user specifiedDave.Wen1-0/+40
the memory regions (-m)
2020-04-13Handle misaligned memories by aligning them, rather than erroringAndrew Waterman1-1/+16
Resolves #442
2020-03-27Write execution logs to a named log file (#409)Rupert Swarbrick1-4/+7
This patch adds a --log argument to spike. If not given, the behaviour is unchanged: messages logging execution of instructions and (if commit logging is enabled) commits go to stderr. If --log=P is given, Spike now writes these messages to a log file at the path P. This is nice, because they are no longer tangled up with other errors and warnings. The code is mostly plumbing: passing a FILE* object through to the functions that were using stderr. I've written a simple "log_file_t" class, which opens a log file if necessary and yields it or stderr.
2020-02-15Add optional support for real-time clintAnup Patel1-1/+5
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>
2020-02-14Make spike capable of booting LinuxAnup Patel1-1/+39
Latest Linux does not boot Spike mainly because: 1. Spike does not set bootargs in DTS 2. Spike does not provide mechanism to load initrd for Linux This patch addresses both above issues and we can now get latest Linux to prompt on Spike. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-11-12Add --priv option to control which privilege modes are availableAndrew Waterman1-1/+4
2019-09-18Adds --log-commits commandline option. (#323)dave-estes-syzexion1-0/+3
* Adds --log-commits commandline option. Similar to histogram support, the commit logging feature must be enabled with a configure option: --enable-commitlog. However, unlike that feature, there was no way to turn off the logging with a commandline option once the functionality was built in. This (git) commit provides that abilty. * Changes addressing review feedback.
2019-07-22Implement MMIO device plugins.Aaron Jones1-3/+64