summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2011-07-10 12:56:08 -0500
committerAli Saidi <Ali.Saidi@ARM.com>2011-07-10 12:56:08 -0500
commitf8538f7456f76cf1eaf30c0ed73abfaf22c1d5a9 (patch)
tree4a5a446082602d7afd5306b8ca96ec153129cdc1
parent60579e8d74cecea5737a4502599ccf77e9e6a35e (diff)
downloadgem5-f8538f7456f76cf1eaf30c0ed73abfaf22c1d5a9.tar.xz
IO: Handle case where ISA Fake device is being used as a fake memory.
-rw-r--r--src/dev/Device.py2
-rw-r--r--src/dev/arm/RealView.py6
-rw-r--r--src/dev/isa_fake.cc8
3 files changed, 12 insertions, 4 deletions
diff --git a/src/dev/Device.py b/src/dev/Device.py
index 4babffa18..bf43449b5 100644
--- a/src/dev/Device.py
+++ b/src/dev/Device.py
@@ -64,6 +64,8 @@ class IsaFake(BasicPioDevice):
ret_bad_addr = Param.Bool(False, "Return pkt status bad address on access")
update_data = Param.Bool(False, "Update the data that is returned on writes")
warn_access = Param.String("", "String to print when device is accessed")
+ fake_mem = Param.Bool(False,
+ "Is this device acting like a memory and thus may get a cache line sized req")
class BadAddr(IsaFake):
pio_addr = 0
diff --git a/src/dev/arm/RealView.py b/src/dev/arm/RealView.py
index e7cba9106..c92905b47 100644
--- a/src/dev/arm/RealView.py
+++ b/src/dev/arm/RealView.py
@@ -146,7 +146,8 @@ class RealViewPBX(RealView):
l2x0_fake = IsaFake(pio_addr=0x1f002000, pio_size=0xfff)
- flash_fake = IsaFake(pio_addr=0x40000000, pio_size=0x20000000)
+ flash_fake = IsaFake(pio_addr=0x40000000, pio_size=0x20000000,
+ fake_mem=True)
dmac_fake = AmbaFake(pio_addr=0x10030000)
uart1_fake = AmbaFake(pio_addr=0x1000a000)
uart2_fake = AmbaFake(pio_addr=0x1000b000)
@@ -213,7 +214,8 @@ class RealViewEB(RealView):
kmi1 = Pl050(pio_addr=0x10007000, int_num=21, is_mouse=True)
l2x0_fake = IsaFake(pio_addr=0x1f002000, pio_size=0xfff, warn_access="1")
- flash_fake = IsaFake(pio_addr=0x40000000, pio_size=0x20000000-1)
+ flash_fake = IsaFake(pio_addr=0x40000000, pio_size=0x20000000-1,
+ fake_mem=True)
dmac_fake = AmbaFake(pio_addr=0x10030000)
uart1_fake = AmbaFake(pio_addr=0x1000a000)
uart2_fake = AmbaFake(pio_addr=0x1000b000)
diff --git a/src/dev/isa_fake.cc b/src/dev/isa_fake.cc
index 21b723bdc..98d3f9d45 100644
--- a/src/dev/isa_fake.cc
+++ b/src/dev/isa_fake.cc
@@ -56,8 +56,9 @@ IsaFake::IsaFake(Params *p)
Tick
IsaFake::read(PacketPtr pkt)
{
-
+ pkt->allocate();
pkt->makeAtomicResponse();
+
if (params()->warn_access != "")
warn("Device %s accessed by read to address %#x size=%d\n",
name(), pkt->getAddr(), pkt->getSize());
@@ -83,7 +84,10 @@ IsaFake::read(PacketPtr pkt)
pkt->set(retData8);
break;
default:
- panic("invalid access size!\n");
+ if (params()->fake_mem)
+ std::memset(pkt->getPtr<uint8_t>(), 0, pkt->getSize());
+ else
+ panic("invalid access size! Device being accessed by cache?\n");
}
}
return pioDelay;