diff options
author | Chih-Min Chao <chihmin.chao@sifive.com> | 2020-06-11 21:10:46 -0700 |
---|---|---|
committer | Chih-Min Chao <chihmin.chao@sifive.com> | 2020-06-16 01:21:55 -0700 |
commit | 07bbbb52e9304aef7bedc65d236ccbb81979edcd (patch) | |
tree | 3e1e80be2dd11485ff5e2f631947e6d3e7c8bec2 /riscv/processor.cc | |
parent | 284716d4bdb263b8421a2235273736a8e51cf114 (diff) | |
download | spike-07bbbb52e9304aef7bedc65d236ccbb81979edcd.zip spike-07bbbb52e9304aef7bedc65d236ccbb81979edcd.tar.gz spike-07bbbb52e9304aef7bedc65d236ccbb81979edcd.tar.bz2 |
ext: handle diaseembler initialization from --extension
There are two options to specify custom extension and register it
1. --isa with x ex: --isa=rv64gcv_xmyext
parse, load, register in processor_t::processor_t
2. --extension
parse, load in main
register later by calling processort_t::register_extension
The patch fix the register pass in 2
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Diffstat (limited to 'riscv/processor.cc')
-rw-r--r-- | riscv/processor.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/riscv/processor.cc b/riscv/processor.cc index deaadae..b779004 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -1213,6 +1213,10 @@ void processor_t::register_extension(extension_t* x) register_insn(insn); build_opcode_map(); + if (disassembler) + for (auto disasm_insn : x->get_disasms()) + disassembler->add_insn(disasm_insn); + if (ext != NULL) throw std::logic_error("only one extension may be registered"); ext = x; |