d91069baec1075086b0a39a4008d2b493c94cba9
4 * BadDevice implemenation
11 #include "base/trace.hh"
12 #include "cpu/exec_context.hh"
13 #include "dev/scsi_ctrl.hh"
14 #include "dev/baddev.hh"
15 #include "dev/tsunamireg.h"
16 #include "dev/tsunami.hh"
17 #include "mem/functional_mem/memory_control.hh"
18 #include "sim/builder.hh"
19 #include "sim/system.hh"
23 BadDevice::BadDevice(const string
&name
,
24 Addr addr
, Addr mask
, MemoryController
*mmu
, const string
&devicename
)
25 : MmapDevice(name
, addr
, mask
, mmu
), devname(devicename
)
30 BadDevice::read(MemReqPtr
&req
, uint8_t *data
)
33 panic("Device %s not imlpmented\n", devname
);
38 BadDevice::write(MemReqPtr
&req
, const uint8_t *data
)
40 panic("Device %s not imlpmented\n", devname
);
45 BEGIN_DECLARE_SIM_OBJECT_PARAMS(BadDevice
)
47 SimObjectParam
<MemoryController
*> mmu
;
50 Param
<string
> devicename
;
52 END_DECLARE_SIM_OBJECT_PARAMS(BadDevice
)
54 BEGIN_INIT_SIM_OBJECT_PARAMS(BadDevice
)
56 INIT_PARAM(mmu
, "Memory Controller"),
57 INIT_PARAM(addr
, "Device Address"),
58 INIT_PARAM(mask
, "Address Mask"),
59 INIT_PARAM(devicename
, "Name of device to error on")
61 END_INIT_SIM_OBJECT_PARAMS(BadDevice
)
63 CREATE_SIM_OBJECT(BadDevice
)
65 return new BadDevice(getInstanceName(), addr
, mask
, mmu
, devicename
);
68 REGISTER_SIM_OBJECT("BadDevice", BadDevice
)