summaryrefslogtreecommitdiff
path: root/python/m5
diff options
context:
space:
mode:
authorBenjamin Nash <benash@umich.edu>2005-08-16 15:27:39 -0400
committerBenjamin Nash <benash@umich.edu>2005-08-16 15:27:39 -0400
commit0d82e0f8b6d44bc759c3cd7d1e4d499fbbdc459e (patch)
tree986c2bad5216f4eb480bc84a1617803413f39a4a /python/m5
parentbcc333e92006f52baeef1ae0f94d4765513584d8 (diff)
parent09bb20348465f960b9465d94182306137d4b854f (diff)
downloadgem5-0d82e0f8b6d44bc759c3cd7d1e4d499fbbdc459e.tar.xz
Merge m5.eecs.umich.edu:/bk/m5
into zed.eecs.umich.edu:/z/benash/bk/m5 --HG-- extra : convert_revision : 36bb126381caf84d85a566579225b02c15f8f356
Diffstat (limited to 'python/m5')
-rw-r--r--python/m5/config.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/python/m5/config.py b/python/m5/config.py
index a281feccc..3c49421d3 100644
--- a/python/m5/config.py
+++ b/python/m5/config.py
@@ -417,6 +417,9 @@ class SimObject(object):
found_obj = match_obj
return found_obj, found_obj != None
+ def unproxy(self, base):
+ return self
+
def print_ini(self):
print '[' + self.path() + ']' # .ini section header
@@ -632,7 +635,7 @@ class AnyProxy(BaseProxy):
return 'any'
def isproxy(obj):
- if isinstance(obj, BaseProxy):
+ if isinstance(obj, (BaseProxy, EthernetAddr)):
return True
elif isinstance(obj, (list, tuple)):
for v in obj:
@@ -980,12 +983,11 @@ def IncEthernetAddr(addr, val = 1):
return ':'.join(map(lambda x: '%02x' % x, bytes))
class NextEthernetAddr(object):
- __metaclass__ = Singleton
addr = "00:90:00:00:00:01"
def __init__(self, inc = 1):
- self.value = self.addr
- self.addr = IncEthernetAddr(self.addr, inc)
+ self.value = NextEthernetAddr.addr
+ NextEthernetAddr.addr = IncEthernetAddr(NextEthernetAddr.addr, inc)
class EthernetAddr(ParamValue):
def __init__(self, value):
@@ -1006,10 +1008,16 @@ class EthernetAddr(ParamValue):
self.value = value
+ def unproxy(self, base):
+ if self.value == NextEthernetAddr:
+ self.addr = self.value().value
+ return self
+
def __str__(self):
if self.value == NextEthernetAddr:
- self.value = self.value().value
- return self.value
+ return self.addr
+ else:
+ return self.value
# Special class for NULL pointers. Note the special check in
# make_param_value() above that lets these be assigned where a
@@ -1027,7 +1035,7 @@ class NullSimObject(object):
def ini_str(self):
return 'Null'
- def unproxy(self,base):
+ def unproxy(self, base):
return self
def set_path(self, parent, name):