summaryrefslogtreecommitdiff
path: root/src/python
diff options
context:
space:
mode:
Diffstat (limited to 'src/python')
-rw-r--r--src/python/m5/params.py25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/python/m5/params.py b/src/python/m5/params.py
index 9892df97c..da7ddd65e 100644
--- a/src/python/m5/params.py
+++ b/src/python/m5/params.py
@@ -51,6 +51,7 @@ import sys
import time
import convert
+import proxy
import ticks
from util import *
@@ -477,12 +478,13 @@ def IncEthernetAddr(addr, val = 1):
assert(bytes[0] <= 255)
return ':'.join(map(lambda x: '%02x' % x, bytes))
-class NextEthernetAddr(object):
- addr = "00:90:00:00:00:01"
+_NextEthernetAddr = "00:90:00:00:00:01"
+def NextEthernetAddr():
+ global _NextEthernetAddr
- def __init__(self, inc = 1):
- self.value = NextEthernetAddr.addr
- NextEthernetAddr.addr = IncEthernetAddr(NextEthernetAddr.addr, inc)
+ value = _NextEthernetAddr
+ _NextEthernetAddr = IncEthernetAddr(_NextEthernetAddr, 1)
+ return value
class EthernetAddr(ParamValue):
cxx_type = 'Net::EthAddr'
@@ -508,17 +510,11 @@ class EthernetAddr(ParamValue):
def unproxy(self, base):
if self.value == NextEthernetAddr:
- self.addr = self.value().value
+ return EthernetAddr(self.value())
return self
- def __str__(self):
- if self.value == NextEthernetAddr:
- if hasattr(self, 'addr'):
- return self.addr
- else:
- return "NextEthernetAddr (unresolved)"
- else:
- return self.value
+ def ini_str(self):
+ return self.value
time_formats = [ "%a %b %d %H:%M:%S %Z %Y",
"%a %b %d %H:%M:%S %Z %Y",
@@ -1028,6 +1024,5 @@ __all__ = ['Param', 'VectorParam',
# see comment on imports at end of __init__.py.
from SimObject import isSimObject, isSimObjectSequence, isSimObjectClass
-import proxy
import objects
import internal