From 91f5736fd3fe989a7d5f3db10070fdedea36e1b4 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Wed, 22 Jun 2005 09:59:13 -0400 Subject: Move max_time and progress_interval parameters to the Root object and get rid of the ParamContext that each used to have. python/m5/objects/Root.py: Add max_time and progress_interval to the Root object sim/root.cc: Add max_time and progress_interval to the Root object. These parameters used to be in their own contexts in sim_events.cc sim/sim_events.cc: Get rid of the ParamContext for max cycles and the progress event. Move the functionality to the Root object sim/sim_events.hh: Move ProgressEvent declaration to the header so that it can be used in other files. --HG-- extra : convert_revision : ff664b806855e8eb9201b8a25392aa53204464f0 --- python/m5/objects/Root.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'python') diff --git a/python/m5/objects/Root.py b/python/m5/objects/Root.py index 79e3721fc..a5aaadd8c 100644 --- a/python/m5/objects/Root.py +++ b/python/m5/objects/Root.py @@ -7,6 +7,9 @@ from Trace import Trace class Root(SimObject): type = 'Root' clock = Param.RootClock('200MHz', "tick frequency") + max_time = Param.Latency('0ns', "maximum simulation time (0 = infinite)") + progress_interval = Param.Latency('0ns', + "print a progress message at a regular interval (0 = never)") output_file = Param.String('cout', "file to dump simulator output to") checkpoint = Param.String('', "checkpoint file to load") # hier = Param.HierParams(HierParams(do_data = False, do_events = True), -- cgit v1.2.3 From cad549d7aaefece708495842f2be5e6532a27bb7 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Thu, 23 Jun 2005 01:07:04 -0700 Subject: Added Float class Fixed printing so the tokenizer in m5 doesn't get confused Expanded NullSimObject so it could be used as an element in a VectorParam --HG-- extra : convert_revision : 661b1916967d663ab7aee891f15f7ca190deeba6 --- python/m5/config.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'python') diff --git a/python/m5/config.py b/python/m5/config.py index 091df3662..754b18525 100644 --- a/python/m5/config.py +++ b/python/m5/config.py @@ -421,14 +421,14 @@ class SimObject(object): print '[' + self.path() + ']' # .ini section header if hasattr(self, 'type') and not isinstance(self, ParamContext): - print 'type =', self.type + print 'type=%s' % self.type child_names = self._children.keys() child_names.sort() np_child_names = [c for c in child_names \ if not isinstance(self._children[c], ParamContext)] if len(np_child_names): - print 'children =', ' '.join(np_child_names) + print 'children=%s' % ' '.join(np_child_names) param_names = self._params.keys() param_names.sort() @@ -444,7 +444,7 @@ class SimObject(object): (param, self.path()) raise setattr(self, param, value) - print param, '=', self._values[param].ini_str() + print '%s=%s' % (param, self._values[param].ini_str()) print # blank line between objects @@ -921,6 +921,9 @@ class UdpPort(CheckedInt): size = 16; unsigned = True class Percent(CheckedInt): min = 0; max = 100 +class Float(ParamValue, float): + pass + class MemorySize(CheckedInt): size = 64 unsigned = True @@ -1024,6 +1027,14 @@ class NullSimObject(object): def ini_str(self): return 'Null' + def unproxy(self,base): + return self + + def set_path(self, parent, name): + pass + def __str__(self): + return 'Null' + # The only instance you'll ever need... Null = NULL = NullSimObject() @@ -1262,7 +1273,7 @@ def instantiate(root): # short to avoid polluting other namespaces. __all__ = ['SimObject', 'ParamContext', 'Param', 'VectorParam', 'Parent', 'Self', - 'Enum', 'Bool', 'String', + 'Enum', 'Bool', 'String', 'Float', 'Int', 'Unsigned', 'Int8', 'UInt8', 'Int16', 'UInt16', 'Int32', 'UInt32', 'Int64', 'UInt64', 'Counter', 'Addr', 'Tick', 'Percent', -- cgit v1.2.3