changeset daf49a57df75 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=daf49a57df75
description:
        m5: improvements to the ruby_fs.py file

diffstat:

1 file changed, 24 insertions(+), 5 deletions(-)
configs/example/ruby_fs.py |   29 ++++++++++++++++++++++++-----

diffs (62 lines):

diff -r 394bc95d417b -r daf49a57df75 configs/example/ruby_fs.py
--- a/configs/example/ruby_fs.py        Wed Nov 18 16:34:32 2009 -0800
+++ b/configs/example/ruby_fs.py        Wed Nov 18 16:34:32 2009 -0800
@@ -71,8 +71,12 @@
 parser.add_option("-i", "--input", default="", help="Read stdin from a file.")
 parser.add_option("--output", default="", help="Redirect stdout to a file.")
 parser.add_option("--errout", default="", help="Redirect stderr to a file.")
+
+# ruby options
 parser.add_option("--ruby-debug", action="store_true")
 parser.add_option("--ruby-debug-file", default="", help="Ruby debug out file 
(stdout if blank)")
+parser.add_option("--protocol", default="", help="Ruby protocol compiled into 
binary")
+
 
 # ruby host memory experimentation
 parser.add_option("--cache_size", type="int")
@@ -98,12 +102,17 @@
     bm = [SysConfig()]
 
 #
-# currently ruby fs only works in timing mode because ruby does not support
-# atomic accesses by devices
+# currently ruby fs only works in simple timing mode because ruby does not
+# support atomic accesses by devices.  Also ruby_fs currently assumes
+# that is running a checkpoints that were created by ALPHA_FS under atomic
+# mode.  Since switch cpus are not defined in these checkpoints, we don't
+# fast forward with the atomic cpu and instead set the FutureClass to None.
+# Therefore the cpus resolve to the correct names and unserialize correctly.
 #
 assert(options.timing)
-
-(CPUClass, test_mem_mode, FutureClass) = Simulation.setCPUClass(options)
+class CPUClass(TimingSimpleCPU): pass
+test_mem_mode = 'timing'
+FutureClass = None
 
 CPUClass.clock = '1GHz'
 
@@ -139,12 +148,22 @@
 else:
     map_levels = 4 # 4 levels is the default
 
+if options.protocol == "MOESI_hammer":
+    ruby_config_file = "MOESI_hammer-homogeneous.rb"
+elif options.protocol == "MOESI_CMP_token":
+    ruby_config_file = "TwoLevel_SplitL1UnifiedL2.rb"
+elif options.protocol == "MI_example":
+    ruby_config_file = "MI_example-homogeneous.rb"
+else:
+    print "Error: unsupported ruby protocol"
+    sys.exit(1)
+
 #
 # Currently, since ruby configuraiton is separate from m5, we need to manually
 # tell ruby that two dma ports are created by makeLinuxAlphaRubySystem().
 # Eventually, this will be fix with a unified configuration system.
 #
-rubymem = ruby_config.generate("MI_example-homogeneous.rb",
+rubymem = ruby_config.generate(ruby_config_file,
                                np,
                                np,
                                128,
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to