changeset 6823ef6d7a9f in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=6823ef6d7a9f
description:
        X86, Config: Move the setting of work count options to a separate 
function.

        This way things that don't care about work count options and/or aren't 
called
        by something that has those command line options set up doesn't have to 
build
        a fake object to carry in inert values.

diffstat:

 configs/common/FSConfig.py |  36 ++++++++++++++++++------------------
 configs/example/fs.py      |   3 ++-
 configs/example/ruby_fs.py |   3 ++-
 3 files changed, 22 insertions(+), 20 deletions(-)

diffs (79 lines):

diff -r 20dc73b1d980 -r 6823ef6d7a9f configs/common/FSConfig.py
--- a/configs/common/FSConfig.py        Mon Feb 07 01:21:21 2011 -0800
+++ b/configs/common/FSConfig.py        Mon Feb 07 01:22:15 2011 -0800
@@ -405,8 +405,24 @@
     for i in range(3, 15):
         assignISAInt(i, i)
 
-def makeLinuxX86System(mem_mode, options, mdesc = None, Ruby = False):
-    numCPUs = options.num_cpus
+def setWorkCountOptions(system, options):
+    if options.work_item_id != None:
+        system.work_item_id = options.work_item_id
+    if options.work_begin_cpu_id_exit != None:
+        system.work_begin_cpu_id_exit = options.work_begin_cpu_id_exit
+    if options.work_end_exit_count != None:
+        system.work_end_exit_count = options.work_end_exit_count
+    if options.work_end_checkpoint_count != None:
+        system.work_end_ckpt_count = options.work_end_checkpoint_count
+    if options.work_begin_exit_count != None:
+        system.work_begin_exit_count = options.work_begin_exit_count
+    if options.work_begin_checkpoint_count != None:
+        system.work_begin_ckpt_count = options.work_begin_checkpoint_count
+    if options.work_cpus_checkpoint_count != None:
+        system.work_cpus_ckpt_count = options.work_cpus_checkpoint_count
+
+
+def makeLinuxX86System(mem_mode, numCPUs = 1, mdesc = None, Ruby = False):
     self = LinuxX86System()
 
     # Build up the x86 system and then specialize it for Linux
@@ -416,22 +432,6 @@
     # just to avoid corner cases.
     assert(self.physmem.range.second.getValue() >= 0x200000)
 
-    # set work count options
-    if options.work_item_id != None:
-        self.work_item_id = options.work_item_id
-    if options.work_begin_cpu_id_exit != None:
-        self.work_begin_cpu_id_exit = options.work_begin_cpu_id_exit
-    if options.work_end_exit_count != None:
-        self.work_end_exit_count = options.work_end_exit_count
-    if options.work_end_checkpoint_count != None:
-        self.work_end_ckpt_count = options.work_end_checkpoint_count
-    if options.work_begin_exit_count != None:
-        self.work_begin_exit_count = options.work_begin_exit_count
-    if options.work_begin_checkpoint_count != None:
-        self.work_begin_ckpt_count = options.work_begin_checkpoint_count
-    if options.work_cpus_checkpoint_count != None:
-        self.work_cpus_ckpt_count = options.work_cpus_checkpoint_count
-
     # Mark the first megabyte of memory as reserved
     self.e820_table.entries.append(X86E820Entry(
                 addr = 0,
diff -r 20dc73b1d980 -r 6823ef6d7a9f configs/example/fs.py
--- a/configs/example/fs.py     Mon Feb 07 01:21:21 2011 -0800
+++ b/configs/example/fs.py     Mon Feb 07 01:22:15 2011 -0800
@@ -131,7 +131,8 @@
 elif buildEnv['TARGET_ISA'] == "sparc":
     test_sys = makeSparcSystem(test_mem_mode, bm[0])
 elif buildEnv['TARGET_ISA'] == "x86":
-    test_sys = makeLinuxX86System(test_mem_mode, options, bm[0])
+    test_sys = makeLinuxX86System(test_mem_mode, options.num_cpus, bm[0])
+    setWorkCountOptions(test_sys, options)
 elif buildEnv['TARGET_ISA'] == "arm":
     test_sys = makeLinuxArmSystem(test_mem_mode, bm[0],
             bare_metal=options.bare_metal, machine_type=options.machine_type)
diff -r 20dc73b1d980 -r 6823ef6d7a9f configs/example/ruby_fs.py
--- a/configs/example/ruby_fs.py        Mon Feb 07 01:21:21 2011 -0800
+++ b/configs/example/ruby_fs.py        Mon Feb 07 01:22:15 2011 -0800
@@ -116,7 +116,8 @@
                                      system.piobus,
                                      system.dma_devices)
 elif buildEnv['TARGET_ISA'] == "x86":
-    system = makeLinuxX86System(test_mem_mode, options, bm[0], True)
+    system = makeLinuxX86System(test_mem_mode, options.num_cpus, bm[0], True)
+    setWorkCountOptions(system, options)
     system.ruby = Ruby.create_system(options,
                                      system,
                                      system.piobus)
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to