Skip to content

Commit

Permalink
Add --strict command-line arg to spike-dasm
Browse files Browse the repository at this point in the history
  • Loading branch information
aswaterman committed Dec 18, 2024
1 parent 1e589aa commit 8ad998f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spike_dasm/spike-dasm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,19 @@ int main(int UNUSED argc, char** argv)
{
string s;
const char* isa = DEFAULT_ISA;
bool strict = false;

std::function<extension_t*()> extension;
option_parser_t parser;
#ifdef HAVE_DLOPEN
parser.option(0, "extension", 1, [&](const char* s){extension = find_extension(s);});
#endif
parser.option(0, "isa", 1, [&](const char* s){isa = s;});
parser.option(0, "strict", 0, [&](const char UNUSED *s){strict = true;});
parser.parse(argv);

isa_parser_t isa_parser(isa, DEFAULT_PRIV);
disassembler_t* disassembler = new disassembler_t(&isa_parser);
disassembler_t* disassembler = new disassembler_t(&isa_parser, strict);
if (extension) {
for (auto disasm_insn : extension()->get_disasms()) {
disassembler->add_insn(disasm_insn);
Expand Down

0 comments on commit 8ad998f

Please sign in to comment.