diff options
author | Weiwei Li <liweiwei@iscas.ac.cn> | 2022-01-26 22:15:01 +0800 |
---|---|---|
committer | Weiwei Li <liweiwei@iscas.ac.cn> | 2022-01-26 22:15:01 +0800 |
commit | d685520fed95e6518d6c2174ae51310292b891fe (patch) | |
tree | 685fedf35c02ea9edf4dc41a7122b51afcb337e8 /spike_dasm | |
parent | 4557eef7005d648953ec00210c84cc234e1dd1eb (diff) | |
download | riscv-isa-sim-d685520fed95e6518d6c2174ae51310292b891fe.zip riscv-isa-sim-d685520fed95e6518d6c2174ae51310292b891fe.tar.gz riscv-isa-sim-d685520fed95e6518d6c2174ae51310292b891fe.tar.bz2 |
Use unified ISA-string processing in spike-dasm and spike
Diffstat (limited to 'spike_dasm')
-rw-r--r-- | spike_dasm/spike-dasm.cc | 17 | ||||
-rw-r--r-- | spike_dasm/spike_dasm.mk.in | 1 |
2 files changed, 3 insertions, 15 deletions
diff --git a/spike_dasm/spike-dasm.cc b/spike_dasm/spike-dasm.cc index fa6a25a..d40ac5d 100644 --- a/spike_dasm/spike-dasm.cc +++ b/spike_dasm/spike-dasm.cc @@ -27,21 +27,8 @@ int main(int argc, char** argv) parser.option(0, "isa", 1, [&](const char* s){isa = s;}); parser.parse(argv); - std::string lowercase; - for (const char *p = isa; *p; p++) - lowercase += std::tolower(*p); - - int xlen; - if (lowercase.compare(0, 4, "rv32") == 0) { - xlen = 32; - } else if (lowercase.compare(0, 4, "rv64") == 0) { - xlen = 64; - } else { - fprintf(stderr, "bad ISA string: %s\n", isa); - return 1; - } - - disassembler_t* disassembler = new disassembler_t(xlen); + isa_parser_t isa_parser(isa); + disassembler_t* disassembler = new disassembler_t(isa_parser.get_max_xlen()); if (extension) { for (auto disasm_insn : extension()->get_disasms()) { disassembler->add_insn(disasm_insn); diff --git a/spike_dasm/spike_dasm.mk.in b/spike_dasm/spike_dasm.mk.in index b6118fd..0233e62 100644 --- a/spike_dasm/spike_dasm.mk.in +++ b/spike_dasm/spike_dasm.mk.in @@ -1,5 +1,6 @@ spike_dasm_subproject_deps = \ disasm \ + softfloat \ $(if $(HAVE_DLOPEN),riscv,) \ spike_dasm_srcs = \ |