+ if (params()->warnAccess != "") {
+ uint64_t data;
+ switch (pkt->getSize()) {
+ case sizeof(uint64_t):
+ data = pkt->get<uint64_t>();
+ break;
+ case sizeof(uint32_t):
+ data = pkt->get<uint32_t>();
+ break;
+ case sizeof(uint16_t):
+ data = pkt->get<uint16_t>();
+ break;
+ case sizeof(uint8_t):
+ data = pkt->get<uint8_t>();
+ break;
+ default:
+ panic("invalid access size!\n");
+ }
+ warn("Device %s accessed by write to address %#x size=%d data=%#x\n",
+ name(), pkt->getAddr(), pkt->getSize(), data);
+ }
+ if (params()->retBadAddr) {
+ DPRINTF(Tsunami, "write to bad address va=%#x size=%d \n",
+ pkt->getAddr(), pkt->getSize());
+ pkt->result = Packet::BadAddress;
+ } else {
+ DPRINTF(Tsunami, "write - va=%#x size=%d \n",
+ pkt->getAddr(), pkt->getSize());
+
+ if (params()->updateData) {
+ switch (pkt->getSize()) {
+ case sizeof(uint64_t):
+ retData64 = pkt->get<uint64_t>();
+ break;
+ case sizeof(uint32_t):
+ retData32 = pkt->get<uint32_t>();
+ break;
+ case sizeof(uint16_t):
+ retData16 = pkt->get<uint16_t>();
+ break;
+ case sizeof(uint8_t):
+ retData8 = pkt->get<uint8_t>();
+ break;
+ default:
+ panic("invalid access size!\n");
+ }
+ }
+ pkt->result = Packet::Success;
+ }