Add xspike program
[riscv-isa-sim.git] / riscv / spike.cc
index 8fbe25b137ed3c42320db3a834bd8ae2642f109a..00997bd1fe1c345d896b6b376915dc3ad9af1aa7 100644 (file)
@@ -19,7 +19,6 @@ static void help()
   fprintf(stderr, "  -m <n>             Provide <n> MB of target memory\n");
   fprintf(stderr, "  -d                 Interactive debug mode\n");
   fprintf(stderr, "  -h                 Print this help message\n");
-  fprintf(stderr, "  -h                 Print this help message\n");
   fprintf(stderr, "  --ic=<S>:<W>:<B>   Instantiate a cache model with S sets,\n");
   fprintf(stderr, "  --dc=<S>:<W>:<B>     W ways, and B-byte blocks (with S and\n");
   fprintf(stderr, "  --l2=<S>:<W>:<B>     B both powers of 2).\n");
@@ -37,6 +36,7 @@ int main(int argc, char** argv)
 
   option_parser_t parser;
   parser.help(&help);
+  parser.option('h', 0, 0, [&](const char* s){help();});
   parser.option('d', 0, 0, [&](const char* s){debug = true;});
   parser.option('p', 0, 1, [&](const char* s){nprocs = atoi(s);});
   parser.option('m', 0, 1, [&](const char* s){mem_mb = atoi(s);});