summaryrefslogtreecommitdiff
path: root/dev/baddev.cc
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2006-04-10 14:14:25 -0400
committerAli Saidi <saidi@eecs.umich.edu>2006-04-10 14:14:25 -0400
commite17a15f4c5d9a0b65de5e4b0ddceac81385d5360 (patch)
treea559a7023720aeb8f34e5e29875e6eb64f5eabcf /dev/baddev.cc
parent5e11a1763dc0c30438e424938960f76d39742e0b (diff)
parente8b6eb49bcaa768c40c10e354bb66cae0a65a2a1 (diff)
downloadgem5-e17a15f4c5d9a0b65de5e4b0ddceac81385d5360.tar.xz
Merge zizzer:/bk/newmem
into zeep.eecs.umich.edu:/z/saidi/work/m5.newmem --HG-- extra : convert_revision : 36da0febc30675e955a10eb8bc45586b6242a8c3
Diffstat (limited to 'dev/baddev.cc')
-rw-r--r--dev/baddev.cc61
1 files changed, 23 insertions, 38 deletions
diff --git a/dev/baddev.cc b/dev/baddev.cc
index 87d683a5d..f15c1d953 100644
--- a/dev/baddev.cc
+++ b/dev/baddev.cc
@@ -48,69 +48,54 @@
using namespace std;
using namespace TheISA;
-BadDevice::BadDevice(const string &name, Addr a, MemoryController *mmu,
- HierParams *hier, Bus *pio_bus, const string &devicename)
- : PioDevice(name, NULL), addr(a), devname(devicename)
+BadDevice::BadDevice(Params *p)
+ : BasicPioDevice(p), devname(p->devic_ename)
{
- mmu->add_child(this, RangeSize(addr, size));
-
- if (pio_bus) {
- pioInterface = newPioInterface(name, hier, pio_bus, this,
- &BadDevice::cacheAccess);
- pioInterface->addAddrRange(RangeSize(addr, size));
- }
-
+ pioSize = 0xf;
}
-Fault
-BadDevice::read(MemReqPtr &req, uint8_t *data)
-{
-
- panic("Device %s not imlpmented\n", devname);
- return NoFault;
-}
-
-Fault
-BadDevice::write(MemReqPtr &req, const uint8_t *data)
+Tick
+BadDevice::read(Packet &pkt)
{
panic("Device %s not imlpmented\n", devname);
- return NoFault;
}
Tick
-BadDevice::cacheAccess(MemReqPtr &req)
+BadDevice::write(Packet &pkt)
{
- return curTick;
+ panic("Device %s not imlpmented\n", devname);
}
BEGIN_DECLARE_SIM_OBJECT_PARAMS(BadDevice)
+ Param<string> devicename;
+ Param<Addr> pio_addr;
+ SimObjectParam<AlphaSystem *> system;
SimObjectParam<Platform *> platform;
- SimObjectParam<MemoryController *> mmu;
- Param<Addr> addr;
- SimObjectParam<HierParams *> hier;
- SimObjectParam<Bus*> pio_bus;
Param<Tick> pio_latency;
- Param<string> devicename;
END_DECLARE_SIM_OBJECT_PARAMS(BadDevice)
BEGIN_INIT_SIM_OBJECT_PARAMS(BadDevice)
- INIT_PARAM(platform, "Platform"),
- INIT_PARAM(mmu, "Memory Controller"),
- INIT_PARAM(addr, "Device Address"),
- INIT_PARAM_DFLT(hier, "Hierarchy global variables", &defaultHierParams),
- INIT_PARAM_DFLT(pio_bus, "The IO Bus to attach to", NULL),
- INIT_PARAM_DFLT(pio_latency, "Programmed IO latency", 1000),
- INIT_PARAM(devicename, "Name of device to error on")
+ INIT_PARAM(devicename, "Name of device to error on"),
+ INIT_PARAM(pio_addr, "Device Address"),
+ INIT_PARAM(system, "system object"),
+ INIT_PARAM(platform, "platform"),
+ INIT_PARAM_DFLT(pio_latency, "Programmed IO latency", 1000)
END_INIT_SIM_OBJECT_PARAMS(BadDevice)
CREATE_SIM_OBJECT(BadDevice)
{
- return new BadDevice(getInstanceName(), addr, mmu, hier, pio_bus,
- devicename);
+ BadDevice::Params *p = new BadDevice::Params;
+ p->name =getInstanceName();
+ p->platform = platform;
+ p->pio_addr = pio_addr;
+ p->pio_delay = pio_latency;
+ p->system = system;
+ p->devicename = devicename;
+ return new BadDevice(p);
}
REGISTER_SIM_OBJECT("BadDevice", BadDevice)