Major improvements in the graph output code. Mostly adding more
[gem5.git] / sim / main.cc
index ee59cb83bb4ac0c8983f210c7a5ca0fc20ff3ee4..6f6143506aa06857ef42a544ca1f47b4a88514ff 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2004 The Regents of The University of Michigan
+ * Copyright (c) 2000-2005 The Regents of The University of Michigan
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -49,8 +49,8 @@
 #include "base/statistics.hh"
 #include "base/str.hh"
 #include "base/time.hh"
-#include "cpu/base_cpu.hh"
-#include "cpu/full_cpu/smt.hh"
+#include "cpu/base.hh"
+#include "cpu/smt.hh"
 #include "python/pyconfig.hh"
 #include "sim/async.hh"
 #include "sim/builder.hh"
@@ -61,7 +61,7 @@
 #include "sim/sim_object.hh"
 #include "sim/stat_control.hh"
 #include "sim/stats.hh"
-#include "sim/universe.hh"
+#include "sim/root.hh"
 
 using namespace std;
 
@@ -127,38 +127,11 @@ showBriefHelp(ostream &out)
 "   -I            add the directory <dir> to python's path\n"
 "   -P            execute <python> directly in the configuration\n"
 "   --var=val     set the python variable <var> to '<val>'\n"
-"   <configfile>  config file name (.py or .mpy)\n",
+"   <configfile>  config file name (ends in .py)\n\n",
              prog);
 
-    ccprintf(out, "%s -X\n    -X            extract embedded files\n", prog);
-    ccprintf(out, "%s -h\n    -h            print long help\n", prog);
-}
-
-/// Show verbose help message.  Includes parameter listing from
-/// showBriefHelp(), plus an exhaustive list of ini-file parameters
-/// and SimObjects (with their parameters).
-void
-showLongHelp(ostream &out)
-{
-    showBriefHelp(out);
-
-    out << endl
-        << endl
-        << "-----------------" << endl
-        << "Global Parameters" << endl
-        << "-----------------" << endl
-        << endl;
-
-    ParamContext::describeAllContexts(out);
-
-    out << endl
-        << endl
-        << "-----------------" << endl
-        << "Simulator Objects" << endl
-        << "-----------------" << endl
-        << endl;
-
-    SimObjectClass::describeAllClasses(out);
+    ccprintf(out, "%s -X\n   -X            extract embedded files\n\n", prog);
+    ccprintf(out, "%s -h\n   -h            print short help\n\n", prog);
 }
 
 /// Print welcome message.
@@ -245,12 +218,17 @@ main(int argc, char **argv)
     signal(SIGINT, exitNowHandler);            // dump final stats and exit
     signal(SIGABRT, abortHandler);
 
-    sayHello(cerr);
-
     bool configfile_found = false;
     PythonConfig pyconfig;
     string outdir;
 
+    if (argc < 2) {
+        showBriefHelp(cerr);
+        exit(1);
+    }
+
+    sayHello(cerr);
+
     // Parse command-line options.
     // Since most of the complex options are handled through the
     // config database, we don't mess with getopts, and just parse
@@ -283,7 +261,7 @@ main(int argc, char **argv)
                 break;
 
               case 'h':
-                showLongHelp(cerr);
+                showBriefHelp(cerr);
                 exit(1);
 
               case 'E':
@@ -328,9 +306,8 @@ main(int argc, char **argv)
             string file(arg_str);
             string base, ext;
 
-            if (!split_last(file, base, ext, '.') ||
-                ext != "py" && ext != "mpy")
-                panic("Config file '%s' must end in '.py' or '.mpy'\n", file);
+            if (!split_last(file, base, ext, '.') || ext != "py")
+                panic("Config file '%s' must end in '.py'\n", file);
 
             pyconfig.load(file);
             configfile_found = true;