summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/python/m5/main.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/python/m5/main.py b/src/python/m5/main.py
index 4f28cf385..dbabd9600 100644
--- a/src/python/m5/main.py
+++ b/src/python/m5/main.py
@@ -116,6 +116,11 @@ add_option("--trace-file", metavar="FILE", default="cout",
add_option("--trace-ignore", metavar="EXPR", action='append', split=':',
help="Ignore EXPR sim objects")
+# Help options
+set_group("Help Options")
+add_option("--list-sim-objects", action='store_true', default=False,
+ help="List all built-in SimObjects, their parameters and default values")
+
def main():
import defines
import event
@@ -187,6 +192,27 @@ def main():
print_list(traceflags.compoundFlagMap[flag], indent=8)
print
+ if options.list_sim_objects:
+ import SimObject
+ done = True
+ print "SimObjects:"
+ objects = SimObject.allClasses.keys()
+ objects.sort()
+ for name in objects:
+ obj = SimObject.allClasses[name]
+ print " %s" % obj
+ params = obj._params.keys()
+ params.sort()
+ for pname in params:
+ param = obj._params[pname]
+ default = getattr(param, 'default', '')
+ print " %s" % pname
+ if default:
+ print " default: %s" % default
+ print " desc: %s" % param.desc
+ print
+ print
+
if done:
sys.exit(0)