aboutsummaryrefslogtreecommitdiff
path: root/riscv/processor.cc
diff options
context:
space:
mode:
authorChih-Min Chao <chihmin.chao@sifive.com>2020-06-04 00:58:39 -0700
committerChih-Min Chao <chihmin.chao@sifive.com>2020-06-10 11:41:09 -0700
commit4ae7271b61a124b2227594ebec8f95a3e853c4d1 (patch)
tree899505e566fec5daafeb21926b03cf31f5588056 /riscv/processor.cc
parentfefd356697bbbe732c22b0e6dc6121b8aeca2946 (diff)
downloadspike-4ae7271b61a124b2227594ebec8f95a3e853c4d1.zip
spike-4ae7271b61a124b2227594ebec8f95a3e853c4d1.tar.gz
spike-4ae7271b61a124b2227594ebec8f95a3e853c4d1.tar.bz2
ext: support default library name and fix isa parser
for --isa=rv64_zavmo_xmyext 1. make custom extension work with z extension and underline char 2. search libmyext.so and libcustomext.so 3. check myext in open library 4. fix custom extension disassembler initialization bug Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Diffstat (limited to 'riscv/processor.cc')
-rw-r--r--riscv/processor.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/riscv/processor.cc b/riscv/processor.cc
index 0b4ca65..deaadae 100644
--- a/riscv/processor.cc
+++ b/riscv/processor.cc
@@ -237,7 +237,7 @@ void processor_t::parse_isa_string(const char* str)
p++;
} else if (*p == 'x') {
const char* ext = p + 1, *end = ext;
- while (islower(*end))
+ while (islower(*end) || *end == '_')
end++;
auto ext_str = std::string(ext, end - ext);
@@ -251,6 +251,11 @@ void processor_t::parse_isa_string(const char* str)
}
} else if (*p == '_') {
const char* ext = p + 1, *end = ext;
+ if (*ext == 'x') {
+ p++;
+ continue;
+ }
+
while (islower(*end))
end++;
@@ -1207,8 +1212,7 @@ void processor_t::register_extension(extension_t* x)
for (auto insn : x->get_instructions())
register_insn(insn);
build_opcode_map();
- 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;