summaryrefslogtreecommitdiff
path: root/src/python
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2008-06-14 21:51:08 -0700
committerNathan Binkert <nate@binkert.org>2008-06-14 21:51:08 -0700
commitb2036bfda88aa99304e48f26541e5d84ada34db9 (patch)
treeddc667556c9064036840d9aa263c5bd1b86e0afa /src/python
parentbbeb8082a56b765181b769c5e1f41e173c0444fa (diff)
downloadgem5-b2036bfda88aa99304e48f26541e5d84ada34db9.tar.xz
Command line option to print out List of SimObjects and their parameters
Diffstat (limited to 'src/python')
-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)