Merge zizzer.eecs.umich.edu:/z/m5/Bitkeeper/m5
into ziff.eecs.umich.edu:/z/binkertn/research/m5/current --HG-- extra : convert_revision : abc24d21097770ad323a2c0d537d3e9424db0d7d
This commit is contained in:
@@ -183,6 +183,9 @@ base_sources = Split('''
|
||||
mem/trace/mem_trace_writer.cc
|
||||
mem/trace/m5_writer.cc
|
||||
|
||||
python/pyconfig.cc
|
||||
python/embedded_py.cc
|
||||
|
||||
sim/builder.cc
|
||||
sim/configfile.cc
|
||||
sim/debug.cc
|
||||
@@ -199,8 +202,6 @@ base_sources = Split('''
|
||||
sim/stat_control.cc
|
||||
sim/trace_context.cc
|
||||
sim/universe.cc
|
||||
sim/pyconfig/pyconfig.cc
|
||||
sim/pyconfig/embedded_py.cc
|
||||
''')
|
||||
|
||||
# MySql sources
|
||||
@@ -376,7 +377,7 @@ env.Command(Split('''arch/alpha/decoder.cc
|
||||
# SConscript-local is the per-config build, which just copies some
|
||||
# header files into a place where they can be found.
|
||||
SConscript('libelf/SConscript-local', exports = 'env', duplicate=0)
|
||||
SConscript('sim/pyconfig/SConscript', exports = ['env'], duplicate=0)
|
||||
SConscript('python/SConscript', exports = ['env'], duplicate=0)
|
||||
|
||||
|
||||
# This function adds the specified sources to the given build
|
||||
|
||||
@@ -193,8 +193,8 @@ EmbedMap %(name)s("%(fname)s",
|
||||
/* namespace */ }
|
||||
'''
|
||||
|
||||
embedded_py_files = ['m5config.py', 'importer.py', '../../util/pbs/jobfile.py']
|
||||
objpath = os.path.join(env['SRCDIR'], 'objects')
|
||||
embedded_py_files = [ 'mpy_importer.py', '../util/pbs/jobfile.py' ]
|
||||
objpath = os.path.join(env['SRCDIR'], 'python/m5')
|
||||
for root, dirs, files in os.walk(objpath, topdown=True):
|
||||
for i,dir in enumerate(dirs):
|
||||
if dir == 'SCCS':
|
||||
7
python/m5/__init__.py
Normal file
7
python/m5/__init__.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from mpy_importer import *
|
||||
from config import *
|
||||
from objects import *
|
||||
|
||||
cpp_classes = MetaSimObject.cpp_classes
|
||||
cpp_classes.sort()
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
from __future__ import generators
|
||||
import os, re, sys, types, inspect
|
||||
|
||||
from importer import AddToPath, LoadMpyFile
|
||||
from mpy_importer import AddToPath, LoadMpyFile
|
||||
|
||||
noDot = False
|
||||
try:
|
||||
@@ -449,7 +449,7 @@ class MetaConfigNode(type):
|
||||
|
||||
# Print instance info to .ini file.
|
||||
def instantiate(cls, name, parent = None):
|
||||
instance = Node(name, cls, cls.type, parent, isParamContext(cls))
|
||||
instance = Node(name, cls, parent, isParamContext(cls))
|
||||
|
||||
if hasattr(cls, 'check'):
|
||||
cls.check()
|
||||
@@ -584,10 +584,13 @@ class NodeParam(object):
|
||||
|
||||
class Node(object):
|
||||
all = {}
|
||||
def __init__(self, name, realtype, type, parent, paramcontext):
|
||||
def __init__(self, name, realtype, parent, paramcontext):
|
||||
self.name = name
|
||||
self.realtype = realtype
|
||||
self.type = type
|
||||
if isSimObject(realtype):
|
||||
self.type = realtype.type
|
||||
else:
|
||||
self.type = None
|
||||
self.parent = parent
|
||||
self.children = []
|
||||
self.child_names = {}
|
||||
@@ -1298,6 +1301,3 @@ class SimObject(ConfigNode):
|
||||
type = 'SimObject'
|
||||
|
||||
from objects import *
|
||||
|
||||
cpp_classes = MetaSimObject.cpp_classes
|
||||
cpp_classes.sort()
|
||||
@@ -51,6 +51,7 @@
|
||||
#include "base/time.hh"
|
||||
#include "cpu/base_cpu.hh"
|
||||
#include "cpu/full_cpu/smt.hh"
|
||||
#include "python/pyconfig.hh"
|
||||
#include "sim/async.hh"
|
||||
#include "sim/builder.hh"
|
||||
#include "sim/configfile.hh"
|
||||
@@ -61,7 +62,6 @@
|
||||
#include "sim/stat_control.hh"
|
||||
#include "sim/stats.hh"
|
||||
#include "sim/universe.hh"
|
||||
#include "sim/pyconfig/pyconfig.hh"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -30,12 +30,10 @@ from os.path import join as joinpath, realpath
|
||||
|
||||
mypath = sys.path[0]
|
||||
sys.path.append(joinpath(mypath, '..'))
|
||||
sys.path.append(joinpath(mypath, '../python'))
|
||||
sys.path.append(joinpath(mypath, '../util/pbs'))
|
||||
sys.path.append(joinpath(mypath, '../sim/pyconfig'))
|
||||
|
||||
from importer import AddToPath, LoadMpyFile
|
||||
|
||||
AddToPath('.')
|
||||
pathlist = [ '.' ]
|
||||
|
||||
try:
|
||||
opts, args = getopt.getopt(sys.argv[1:], '-E:I:')
|
||||
@@ -50,11 +48,14 @@ try:
|
||||
value = arg[offset+1:]
|
||||
os.environ[name] = value
|
||||
if opt == '-I':
|
||||
AddToPath(arg)
|
||||
pathlist.append(arg)
|
||||
except getopt.GetoptError:
|
||||
sys.exit('Improper Usage')
|
||||
|
||||
from m5config import *
|
||||
from m5 import *
|
||||
|
||||
for path in pathlist:
|
||||
AddToPath(path)
|
||||
|
||||
for arg in args:
|
||||
LoadMpyFile(arg)
|
||||
|
||||
Reference in New Issue
Block a user