simplified default case and added comments
authorScott Beamer <sbeamer@eecs.berkeley.edu>
Mon, 13 Jul 2015 23:17:13 +0000 (16:17 -0700)
committerScott Beamer <sbeamer@eecs.berkeley.edu>
Mon, 13 Jul 2015 23:17:13 +0000 (16:17 -0700)
riscv/interactive.cc

index 6ae1892f001ea2c2ff9878a468eeb0c666727b88..07b2801fa6627b23675b9238ddcbb5ca3f84ceec 100644 (file)
@@ -183,9 +183,8 @@ reg_t sim_t::get_reg(const std::vector<std::string>& 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
     }
   }