diff options
author | Rupert Swarbrick <rswarbrick@gmail.com> | 2022-02-18 15:45:21 +0000 |
---|---|---|
committer | Rupert Swarbrick <rswarbrick@gmail.com> | 2022-03-12 21:51:01 +0000 |
commit | cb632586bdb1b57ea4e5a5543e21bbb257e47f3b (patch) | |
tree | 17720758321ebccff687f9d642ac5d14c49df95b /spike_main | |
parent | 59ec157568d2a52feeec568ac042362db1c5ddbc (diff) | |
download | riscv-isa-sim-cb632586bdb1b57ea4e5a5543e21bbb257e47f3b.zip riscv-isa-sim-cb632586bdb1b57ea4e5a5543e21bbb257e47f3b.tar.gz riscv-isa-sim-cb632586bdb1b57ea4e5a5543e21bbb257e47f3b.tar.bz2 |
Construct an isa_parser_t and pass it to processor_t constructor
This is a minor change, turning processor_t from a child class of
isa_parser_t into a class that contains an isa_parser_t as a field.
The point is that it is a step toward separating out
"configuration" (and ISA string parsing) from processor state. This
should be helpful for rejigging things so that we construct more from
a supplied device tree.
Diffstat (limited to 'spike_main')
-rw-r--r-- | spike_main/spike-log-parser.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/spike_main/spike-log-parser.cc b/spike_main/spike-log-parser.cc index 9481fb4..0a4442f 100644 --- a/spike_main/spike-log-parser.cc +++ b/spike_main/spike-log-parser.cc @@ -19,15 +19,16 @@ using namespace std; int main(int argc, char** argv) { string s; - const char* isa = DEFAULT_ISA; + const char* isa_string = DEFAULT_ISA; std::function<extension_t*()> extension; option_parser_t parser; parser.option(0, "extension", 1, [&](const char* s){extension = find_extension(s);}); - parser.option(0, "isa", 1, [&](const char* s){isa = s;}); + parser.option(0, "isa", 1, [&](const char* s){isa_string = s;}); parser.parse(argv); - processor_t p(isa, DEFAULT_PRIV, DEFAULT_VARCH, 0, 0, false, nullptr, cerr); + isa_parser_t isa(isa_string, DEFAULT_PRIV); + processor_t p(isa, DEFAULT_VARCH, 0, 0, false, nullptr, cerr); if (extension) { p.register_extension(extension()); } |