diff options
author | neuschaefer <j.neuschaefer@gmx.net> | 2016-06-03 22:45:05 +0200 |
---|---|---|
committer | Andrew Waterman <waterman@eecs.berkeley.edu> | 2016-06-03 13:45:05 -0700 |
commit | 906bbfae48713b9d7256eab37613e5b0ddc08133 (patch) | |
tree | dfe69ecbd5ee9f2ec4f02a93cf12a9f77e08814a | |
parent | 127cf78387447aba8f6bd19783a0c66ae5f3791a (diff) | |
download | spike-906bbfae48713b9d7256eab37613e5b0ddc08133.zip spike-906bbfae48713b9d7256eab37613e5b0ddc08133.tar.gz spike-906bbfae48713b9d7256eab37613e5b0ddc08133.tar.bz2 |
Minor usability improvements (#48)
* spike_main/disasm.cc: Print unknown CSR numbers in hex
* interactive mode: Print "Unknown command" when appropriate
-rw-r--r-- | riscv/interactive.cc | 2 | ||||
-rw-r--r-- | spike_main/disasm.cc | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/riscv/interactive.cc b/riscv/interactive.cc index 69f2461..d24ec50 100644 --- a/riscv/interactive.cc +++ b/riscv/interactive.cc @@ -100,6 +100,8 @@ void sim_t::interactive() { if(funcs.count(cmd)) (this->*funcs[cmd])(cmd, args); + else + fprintf(stderr, "Unknown command %s\n", cmd.c_str()); } catch(trap_t t) {} } diff --git a/spike_main/disasm.cc b/spike_main/disasm.cc index 9eea77e..65977fc 100644 --- a/spike_main/disasm.cc +++ b/spike_main/disasm.cc @@ -74,7 +74,12 @@ struct : public arg_t { #define DECLARE_CSR(name, num) case num: return #name; #include "encoding.h" #undef DECLARE_CSR - default: return "unknown"; + default: + { + char buf[16]; + snprintf(buf, sizeof buf, "unknown_%03" PRIx64, insn.csr()); + return std::string(buf); + } } } } csr; |