aboutsummaryrefslogtreecommitdiff
path: root/spike_main
diff options
context:
space:
mode:
Diffstat (limited to 'spike_main')
-rw-r--r--spike_main/spike-log-parser.cc1
-rw-r--r--spike_main/spike.cc3
2 files changed, 4 insertions, 0 deletions
diff --git a/spike_main/spike-log-parser.cc b/spike_main/spike-log-parser.cc
index 9bea5c5..6ac4ab0 100644
--- a/spike_main/spike-log-parser.cc
+++ b/spike_main/spike-log-parser.cc
@@ -36,6 +36,7 @@ int main(int UNUSED argc, char** argv)
/*default_misaligned=*/false,
/*default_endianness*/endianness_little,
/*default_pmpregions=*/16,
+ /*default_pmpgranularity=*/(1 << PMP_SHIFT),
/*default_mem_layout=*/std::vector<mem_cfg_t>(),
/*default_hartids=*/std::vector<size_t>(),
/*default_real_time_clint=*/false,
diff --git a/spike_main/spike.cc b/spike_main/spike.cc
index 7b28e25..8fd9104 100644
--- a/spike_main/spike.cc
+++ b/spike_main/spike.cc
@@ -41,6 +41,7 @@ static void help(int exit_code = 1)
fprintf(stderr, " --debug-cmd=<name> Read commands from file (use with -d)\n");
fprintf(stderr, " --isa=<name> RISC-V ISA string [default %s]\n", DEFAULT_ISA);
fprintf(stderr, " --pmpregions=<n> Number of PMP regions [default 16]\n");
+ fprintf(stderr, " --pmpgranularity=<n> PMP Granularity in bytes [default 4]\n");
fprintf(stderr, " --priv=<m|mu|msu> RISC-V privilege modes supported [default %s]\n", DEFAULT_PRIV);
fprintf(stderr, " --varch=<name> RISC-V Vector uArch string [default %s]\n", DEFAULT_VARCH);
fprintf(stderr, " --pc=<address> Override ELF entry point\n");
@@ -366,6 +367,7 @@ int main(int argc, char** argv)
/*default_misaligned=*/false,
/*default_endianness*/endianness_little,
/*default_pmpregions=*/16,
+ /*default_pmpgranularity=*/(1 << PMP_SHIFT),
/*default_mem_layout=*/parse_mem_layout("2048"),
/*default_hartids=*/std::vector<size_t>(),
/*default_real_time_clint=*/false,
@@ -406,6 +408,7 @@ int main(int argc, char** argv)
parser.option(0, "log-cache-miss", 0, [&](const char UNUSED *s){log_cache = true;});
parser.option(0, "isa", 1, [&](const char* s){cfg.isa = s;});
parser.option(0, "pmpregions", 1, [&](const char* s){cfg.pmpregions = atoul_safe(s);});
+ parser.option(0, "pmpgranularity", 1, [&](const char* s){cfg.pmpgranularity = atoul_safe(s);});
parser.option(0, "priv", 1, [&](const char* s){cfg.priv = s;});
parser.option(0, "varch", 1, [&](const char* s){cfg.varch = s;});
parser.option(0, "device", 1, device_parser);