From 8d084dbd092a916a2c26d9cb7f30d5651aa3181b Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Thu, 29 Dec 2022 15:28:50 -0800 Subject: Pass cfg object to processor_t constructor This reduces boilerplate as we add additional options. --- spike_main/spike-log-parser.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'spike_main') diff --git a/spike_main/spike-log-parser.cc b/spike_main/spike-log-parser.cc index adf6b68..111e0db 100644 --- a/spike_main/spike-log-parser.cc +++ b/spike_main/spike-log-parser.cc @@ -28,8 +28,19 @@ int main(int UNUSED argc, char** argv) parser.option(0, "isa", 1, [&](const char* s){isa_string = s;}); parser.parse(argv); + cfg_t cfg(/*default_initrd_bounds=*/std::make_pair((reg_t)0, (reg_t)0), + /*default_bootargs=*/nullptr, + /*default_isa=*/DEFAULT_ISA, + /*default_priv=*/DEFAULT_PRIV, + /*default_varch=*/DEFAULT_VARCH, + /*default_endianness*/endianness_little, + /*default_pmpregions=*/16, + /*default_mem_layout=*/std::vector(), + /*default_hartids=*/std::vector(), + /*default_real_time_clint=*/false); + isa_parser_t isa(isa_string, DEFAULT_PRIV); - processor_t p(&isa, DEFAULT_VARCH, 0, 0, false, endianness_little, nullptr, cerr); + processor_t p(&isa, &cfg, 0, 0, false, nullptr, cerr); if (extension) { p.register_extension(extension()); } -- cgit v1.1