summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Lim <ktlim@umich.edu>2005-03-09 17:59:02 -0500
committerKevin Lim <ktlim@umich.edu>2005-03-09 17:59:02 -0500
commit51108a8c0a3a42702f49a945f8a4dac776a8d189 (patch)
treed2362364f7922458e062908499c06d643e9addfc
parent2162b433adfa596bc0d6515b8157b24cd2599541 (diff)
parent7d91bda6bfba1bd0cf49ff7ff20373b5d44df87a (diff)
downloadgem5-51108a8c0a3a42702f49a945f8a4dac776a8d189.tar.xz
Merge ktlim@zizzer.eecs.umich.edu:/bk/m5
into zamp.eecs.umich.edu:/z/ktlim2/m5 --HG-- extra : convert_revision : 936710126053a7f08b1d80b935df38f5ea837f79
-rw-r--r--dev/etherlink.cc2
-rw-r--r--objects/BaseCPU.mpy28
-rw-r--r--sim/pyconfig/SConscript31
-rw-r--r--sim/pyconfig/m5config.py46
-rwxr-xr-xutil/tracediff13
5 files changed, 59 insertions, 61 deletions
diff --git a/dev/etherlink.cc b/dev/etherlink.cc
index 94293815d..81cdbc20f 100644
--- a/dev/etherlink.cc
+++ b/dev/etherlink.cc
@@ -178,7 +178,7 @@ EtherLink::Link::serialize(const string &base, ostream &os)
packet->serialize(base + ".packet", os);
bool event_scheduled = doneEvent.scheduled();
- paramOut(os, base + ".event_scheuled", event_scheduled);
+ paramOut(os, base + ".event_scheduled", event_scheduled);
if (event_scheduled) {
Tick event_time = doneEvent.when();
paramOut(os, base + ".event_time", event_time);
diff --git a/objects/BaseCPU.mpy b/objects/BaseCPU.mpy
index f6e6ff96c..484fcccd6 100644
--- a/objects/BaseCPU.mpy
+++ b/objects/BaseCPU.mpy
@@ -4,11 +4,13 @@ simobj BaseCPU(SimObject):
icache = Param.BaseMem(NULL, "L1 instruction cache object")
dcache = Param.BaseMem(NULL, "L1 data cache object")
- dtb = Param.AlphaDTB("Data TLB")
- itb = Param.AlphaITB("Instruction TLB")
- mem = Param.FunctionalMemory("memory")
- system = Param.BaseSystem(Super, "system object")
- workload = VectorParam.Process("processes to run")
+ if Bool._convert(env.get('FULL_SYSTEM', 'False')):
+ dtb = Param.AlphaDTB("Data TLB")
+ itb = Param.AlphaITB("Instruction TLB")
+ mem = Param.FunctionalMemory("memory")
+ system = Param.BaseSystem(Super, "system object")
+ else:
+ workload = VectorParam.Process("processes to run")
max_insts_all_threads = Param.Counter(0,
"terminate when all threads have reached this inst count")
@@ -21,19 +23,3 @@ simobj BaseCPU(SimObject):
defer_registration = Param.Bool(False,
"defer registration with system (for sampling)")
-
- def check(self):
- has_workload = self._hasvalue('workload')
- has_dtb = self._hasvalue('dtb')
- has_itb = self._hasvalue('itb')
- has_mem = self._hasvalue('mem')
- has_system = self._hasvalue('system')
-
- if has_workload:
- self.dtb.disable = True
- self.itb.disable = True
- self.mem.disable = True
- self.system.disable = True
-
- if has_dtb or has_itb or has_mem or has_system:
- self.workload.disable = True
diff --git a/sim/pyconfig/SConscript b/sim/pyconfig/SConscript
index 9154d3b99..2799ef64f 100644
--- a/sim/pyconfig/SConscript
+++ b/sim/pyconfig/SConscript
@@ -144,6 +144,29 @@ def MakeEmbeddedPyFile(target, source, env):
for pyfile, path, name, ext, filename in files:
WriteEmbeddedPyFile(target, pyfile, path, name, ext, filename)
+def MakeDefinesPyFile(target, source, env):
+ target = file(str(target[0]), 'w')
+
+ print >>target, "import os"
+ defines = env['CPPDEFINES']
+ if isinstance(defines, list):
+ for var in defines:
+ if isinstance(var, tuple):
+ key,val = var
+ else:
+ key,val = var,'True'
+
+ if not isinstance(key, basestring):
+ panic("invalid type for define: %s" % type(key))
+
+ print >>target, "os.environ['%s'] = '%s'" % (key, val)
+
+ elif isinstance(defines, dict):
+ for key,val in defines.iteritems():
+ print >>target, "os.environ['%s'] = '%s'" % (key, val)
+ else:
+ panic("invalid type for defines: %s" % type(defines))
+
CFileCounter = 0
def MakePythonCFile(target, source, env):
global CFileCounter
@@ -170,7 +193,7 @@ EmbedMap %(name)s("%(fname)s",
/* namespace */ }
'''
-embedded_py_files = ['m5config.py', '../../util/pbs/jobfile.py']
+embedded_py_files = ['m5config.py', 'importer.py', '../../util/pbs/jobfile.py']
objpath = os.path.join(env['SRCDIR'], 'objects')
for root, dirs, files in os.walk(objpath, topdown=True):
for i,dir in enumerate(dirs):
@@ -184,7 +207,9 @@ for root, dirs, files in os.walk(objpath, topdown=True):
embedded_py_files.append(os.path.join(root, f))
embedfile_hh = os.path.join(env['SRCDIR'], 'base/embedfile.hh')
-env.Depends('embedded_py.cc', embedfile_hh)
+env.Command('defines.py', None, MakeDefinesPyFile)
env.Command('embedded_py.py', embedded_py_files, MakeEmbeddedPyFile)
-env.Command('embedded_py.cc', ['importer.py', 'embedded_py.py'],
+env.Depends('embedded_py.cc', embedfile_hh)
+env.Command('embedded_py.cc',
+ ['string_importer.py', 'defines.py', 'embedded_py.py'],
MakePythonCFile)
diff --git a/sim/pyconfig/m5config.py b/sim/pyconfig/m5config.py
index 7b1719dfa..e6201b3ad 100644
--- a/sim/pyconfig/m5config.py
+++ b/sim/pyconfig/m5config.py
@@ -26,6 +26,9 @@
from __future__ import generators
import os, re, sys, types, inspect
+
+from importer import AddToPath, LoadMpyFile
+
noDot = False
try:
import pydot
@@ -243,7 +246,6 @@ class MetaConfigNode(type):
cls._params = {}
cls._values = {}
cls._enums = {}
- cls._disable = {}
cls._bases = [c for c in cls.__mro__ if isConfigNode(c)]
cls._anon_subclass_counter = 0
@@ -379,15 +381,6 @@ class MetaConfigNode(type):
def _setvalue(cls, name, value):
cls._values[name] = value
- def _getdisable(cls, name):
- for c in cls._bases:
- if c._disable.has_key(name):
- return c._disable[name]
- return False
-
- def _setdisable(cls, name, value):
- cls._disable[name] = value
-
def __getattr__(cls, attr):
if cls._isvalue(attr):
return Value(cls, attr)
@@ -462,9 +455,6 @@ class MetaConfigNode(type):
cls.check()
for key,value in cls._getvalues().iteritems():
- if cls._getdisable(key):
- continue
-
if isConfigNode(value):
cls.add_child(instance, key, value)
if issequence(value):
@@ -474,15 +464,11 @@ class MetaConfigNode(type):
for pname,param in cls._getparams().iteritems():
try:
- if cls._getdisable(pname):
- continue
-
- try:
- value = cls._getvalue(pname)
- except:
- print 'Error getting %s' % pname
- raise
+ value = cls._getvalue(pname)
+ except:
+ panic('Error getting %s' % pname)
+ try:
if isConfigNode(value):
value = instance.child_objects[value]
elif issequence(value):
@@ -706,8 +692,12 @@ class Node(object):
if self.children:
# instantiate children in same order they were added for
# backward compatibility (else we can end up with cpu1
- # before cpu0).
- self.children.sort(lambda x,y: cmp(x.name, y.name))
+ # before cpu0). Changing ordering can also influence timing
+ # in the current memory system, as caches get added to a bus
+ # in different orders which affects their priority in the
+ # case of simulataneous requests. We should uncomment the
+ # following line once we take care of that issue.
+ # self.children.sort(lambda x,y: cmp(x.name, y.name))
children = [ c.name for c in self.children if not c.paramcontext]
print 'children =', ' '.join(children)
@@ -807,16 +797,10 @@ class Value(object):
return self.obj._getvalue(self.attr)
def __setattr__(self, attr, value):
- if attr == 'disable':
- self.obj._setdisable(self.attr, value)
- else:
- setattr(self._getattr(), attr, value)
+ setattr(self._getattr(), attr, value)
def __getattr__(self, attr):
- if attr == 'disable':
- return self.obj._getdisable(self.attr)
- else:
- return getattr(self._getattr(), attr)
+ return getattr(self._getattr(), attr)
def __getitem__(self, index):
return self._getattr().__getitem__(index)
diff --git a/util/tracediff b/util/tracediff
index 402abbe55..87210f1ed 100755
--- a/util/tracediff
+++ b/util/tracediff
@@ -51,12 +51,15 @@ $sim2 = shift;
# be given to both invocations
$simargs = '"' . join('" "', @ARGV) . '"';
-# Redirect config output to cout so that gets diffed too (in case
-# that's the source of the problem).
-$simargs .= " --root:config_output_file=cout";
+# Run individual invocations in separate dirs so output and intermediate
+# files (particularly config.py and config.ini) don't conflict.
+$dir1 = "tracediff-$$-1";
+$dir2 = "tracediff-$$-2";
+mkdir($dir1) or die "Can't create dir $dir1\n";
+mkdir($dir2) or die "Can't create dir $dir2\n";
-$cmd1 = "$sim1 $simargs --stats:text_file=tracediff-$$-1.stats 2>&1 |";
-$cmd2 = "$sim2 $simargs --stats:text_file=tracediff-$$-2.stats 2>&1 |";
+$cmd1 = "$sim1 $simargs -d $dir1 2>&1 |";
+$cmd2 = "$sim2 $simargs -d $dir2 2>&1 |";
# This only works if you have rundiff in your path. I just edit it
# with an explicit path if necessary.