diff options
author | Anup Patel <anup.patel@wdc.com> | 2020-02-15 19:22:35 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2020-02-15 19:22:35 +0530 |
commit | 9d7c52c6bba57efe895be88fd3ba6a90e66bd3a8 (patch) | |
tree | a5b934d36c3b1d99df869c33a26900135578cc80 /spike_main/spike.cc | |
parent | e5e64c0fa69993448d498735bfaef400aabd090b (diff) | |
download | spike-9d7c52c6bba57efe895be88fd3ba6a90e66bd3a8.zip spike-9d7c52c6bba57efe895be88fd3ba6a90e66bd3a8.tar.gz spike-9d7c52c6bba57efe895be88fd3ba6a90e66bd3a8.tar.bz2 |
Add optional support for real-time clint
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>
Diffstat (limited to 'spike_main/spike.cc')
-rw-r--r-- | spike_main/spike.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/spike_main/spike.cc b/spike_main/spike.cc index f14ef87..1474a4c 100644 --- a/spike_main/spike.cc +++ b/spike_main/spike.cc @@ -51,6 +51,7 @@ static void help(int exit_code = 1) fprintf(stderr, " --dump-dts Print device tree string and exit\n"); fprintf(stderr, " --disable-dtb Don't write the device tree blob into memory\n"); fprintf(stderr, " --initrd=<path> Load kernel initrd into memory\n"); + fprintf(stderr, " --real-time-clint Increment clint time at real-time rate\n"); fprintf(stderr, " --dm-progsize=<words> Progsize for the debug module [default 2]\n"); fprintf(stderr, " --dm-sba=<bits> Debug bus master supports up to " "<bits> wide accesses [default 0]\n"); @@ -131,6 +132,7 @@ int main(int argc, char** argv) bool log = false; bool dump_dts = false; bool dtb_enabled = true; + bool real_time_clint = false; size_t nprocs = 1; size_t initrd_size; reg_t initrd_start = 0, initrd_end = 0; @@ -241,6 +243,7 @@ int main(int argc, char** argv) parser.option(0, "dump-dts", 0, [&](const char *s){dump_dts = true;}); parser.option(0, "disable-dtb", 0, [&](const char *s){dtb_enabled = false;}); parser.option(0, "initrd", 1, [&](const char* s){initrd = s;}); + parser.option(0, "real-time-clint", 0, [&](const char *s){real_time_clint = true;}); parser.option(0, "extlib", 1, [&](const char *s){ void *lib = dlopen(s, RTLD_NOW | RTLD_GLOBAL); if (lib == NULL) { @@ -286,7 +289,8 @@ int main(int argc, char** argv) } } - sim_t s(isa, priv, varch, nprocs, halted, initrd_start, initrd_end, start_pc, mems, plugin_devices, htif_args, + sim_t s(isa, priv, varch, nprocs, halted, real_time_clint, + initrd_start, initrd_end, start_pc, mems, plugin_devices, htif_args, std::move(hartids), dm_config); std::unique_ptr<remote_bitbang_t> remote_bitbang((remote_bitbang_t *) NULL); std::unique_ptr<jtag_dtm_t> jtag_dtm( |