Merge ktlim@zizzer.eecs.umich.edu:/bk/m5
into zamp.eecs.umich.edu:/z/ktlim2/m5 --HG-- extra : convert_revision : 936710126053a7f08b1d80b935df38f5ea837f79
This commit is contained in:
commit
51108a8c0a
5 changed files with 59 additions and 61 deletions
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue