summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorKevin Lim <ktlim@umich.edu>2005-05-02 14:16:33 -0400
committerKevin Lim <ktlim@umich.edu>2005-05-02 14:16:33 -0400
commit6191d3e4443b5337232a238a3a0dd5d11249e223 (patch)
tree4adb8d7c510a8b123b285e0cd0cb2d74f093a108 /python
parente2ad9e68160659712f017a2aa24cc2acc29cd7f0 (diff)
parent950ce813c436cd5a70ed44794f0508799c09ed3a (diff)
downloadgem5-6191d3e4443b5337232a238a3a0dd5d11249e223.tar.xz
Merge ktlim@zizzer.eecs.umich.edu:/bk/m5
into zamp.eecs.umich.edu:/z/ktlim2/m5 --HG-- extra : convert_revision : ac0788599c365b2d7fe0870f0fea4b62c3b3ef22
Diffstat (limited to 'python')
-rw-r--r--python/m5/config.py14
-rw-r--r--python/m5/objects/Ethernet.mpy5
2 files changed, 15 insertions, 4 deletions
diff --git a/python/m5/config.py b/python/m5/config.py
index 74988109b..2db2164fc 100644
--- a/python/m5/config.py
+++ b/python/m5/config.py
@@ -177,7 +177,7 @@ class Proxy(object):
# support multiplying proxies by constants
def __mul__(self, other):
- if not isinstance(other, int):
+ if not isinstance(other, (int, float)):
raise TypeError, "Proxy multiplier must be integer"
if self._multiplier == None:
self._multiplier = other
@@ -186,13 +186,19 @@ class Proxy(object):
self._multiplier *= other
return self
+ __rmul__ = __mul__
+
def _mulcheck(self, result):
if self._multiplier == None:
return result
if not isinstance(result, int):
- raise TypeError, "Proxy with multiplier resolves to " \
- "non-integer value"
- return result * self._multiplier
+ # this was an error, but for now we'll assume if it's not
+ # an int it must be a Frequency (yuk)
+ result = Frequency._convert(result)
+ # assuming we're dealing with a frequency here, turn it into
+ # a string and give it a 't' suffix so the Frequency._convert
+ # doesn't choke on it later.
+ return ("%d" % int(round((result * self._multiplier)))) + 't'
def unproxy(self, base, ptype):
obj = base
diff --git a/python/m5/objects/Ethernet.mpy b/python/m5/objects/Ethernet.mpy
index ed95ce233..141d138da 100644
--- a/python/m5/objects/Ethernet.mpy
+++ b/python/m5/objects/Ethernet.mpy
@@ -41,6 +41,7 @@ simobj EtherDev(DmaDevice):
dma_read_factor = Param.Latency('0us', "multiplier for dma reads")
dma_write_delay = Param.Latency('0us', "fixed delay for dma writes")
dma_write_factor = Param.Latency('0us', "multiplier for dma writes")
+ dma_no_allocate = Param.Bool(True, "Should we allocate cache on read")
rx_filter = Param.Bool(True, "Enable Receive Filter")
rx_delay = Param.Latency('1us', "Receive Delay")
@@ -64,6 +65,8 @@ simobj NSGigE(PciDevice):
dma_read_factor = Param.Latency('0us', "multiplier for dma reads")
dma_write_delay = Param.Latency('0us', "fixed delay for dma writes")
dma_write_factor = Param.Latency('0us', "multiplier for dma writes")
+ dma_no_allocate = Param.Bool(True, "Should we allocate cache on read")
+
rx_filter = Param.Bool(True, "Enable Receive Filter")
rx_delay = Param.Latency('1us', "Receive Delay")
@@ -72,6 +75,8 @@ simobj NSGigE(PciDevice):
rx_fifo_size = Param.MemorySize('128kB', "max size in bytes of rxFifo")
tx_fifo_size = Param.MemorySize('128kB', "max size in bytes of txFifo")
+ m5reg = Param.UInt32(0, "Register for m5 usage")
+
intr_delay = Param.Latency('0us', "Interrupt Delay in microseconds")
payload_bus = Param.Bus(NULL, "The IO Bus to attach to for payload")
physmem = Param.PhysicalMemory(parent.any, "Physical Memory")