From: Scott Beamer Date: Mon, 13 Jul 2015 23:17:13 +0000 (-0700) Subject: simplified default case and added comments X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=42358fbb245a51036eecd8b6124496b67f23c0b2;p=riscv-isa-sim.git simplified default case and added comments --- diff --git a/riscv/interactive.cc b/riscv/interactive.cc index 6ae1892..07b2801 100644 --- a/riscv/interactive.cc +++ b/riscv/interactive.cc @@ -183,9 +183,8 @@ reg_t sim_t::get_reg(const std::vector& args) r = strtoul(args[1].c_str(), &ptr, 10); if (*ptr) { #define DECLARE_CSR(name, number) if (args[1] == #name) return p->get_csr(number); - if (0) ; - #include "encoding.h" - else r = NXPR; + #include "encoding.h" // generates if's for all csrs + r = NXPR; // else case (csr name not found) #undef DECLARE_CSR } }