mshr.cc (11284:b3926db25371) mshr.cc (11286:2071db8f864b)
1/*
2 * Copyright (c) 2012-2013, 2015 ARM Limited
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 101 unchanged lines hidden (view full) ---

110
111 emplace_back(pkt, readyTime, order, source, markPending);
112}
113
114
115static void
116replaceUpgrade(PacketPtr pkt)
117{
1/*
2 * Copyright (c) 2012-2013, 2015 ARM Limited
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 101 unchanged lines hidden (view full) ---

110
111 emplace_back(pkt, readyTime, order, source, markPending);
112}
113
114
115static void
116replaceUpgrade(PacketPtr pkt)
117{
118 // remember if the current packet has data allocated
119 bool has_data = pkt->hasData() || pkt->hasRespData();
120
118 if (pkt->cmd == MemCmd::UpgradeReq) {
119 pkt->cmd = MemCmd::ReadExReq;
120 DPRINTF(Cache, "Replacing UpgradeReq with ReadExReq\n");
121 } else if (pkt->cmd == MemCmd::SCUpgradeReq) {
122 pkt->cmd = MemCmd::SCUpgradeFailReq;
123 DPRINTF(Cache, "Replacing SCUpgradeReq with SCUpgradeFailReq\n");
124 } else if (pkt->cmd == MemCmd::StoreCondReq) {
125 pkt->cmd = MemCmd::StoreCondFailReq;
126 DPRINTF(Cache, "Replacing StoreCondReq with StoreCondFailReq\n");
127 }
121 if (pkt->cmd == MemCmd::UpgradeReq) {
122 pkt->cmd = MemCmd::ReadExReq;
123 DPRINTF(Cache, "Replacing UpgradeReq with ReadExReq\n");
124 } else if (pkt->cmd == MemCmd::SCUpgradeReq) {
125 pkt->cmd = MemCmd::SCUpgradeFailReq;
126 DPRINTF(Cache, "Replacing SCUpgradeReq with SCUpgradeFailReq\n");
127 } else if (pkt->cmd == MemCmd::StoreCondReq) {
128 pkt->cmd = MemCmd::StoreCondFailReq;
129 DPRINTF(Cache, "Replacing StoreCondReq with StoreCondFailReq\n");
130 }
131
132 if (!has_data) {
133 // there is no sensible way of setting the data field if the
134 // new command actually would carry data
135 assert(!pkt->hasData());
136
137 if (pkt->hasRespData()) {
138 // we went from a packet that had no data (neither request,
139 // nor response), to one that does, and therefore we need to
140 // actually allocate space for the data payload
141 pkt->allocate();
142 }
143 }
128}
129
130
131void
132MSHR::TargetList::replaceUpgrades()
133{
134 if (!hasUpgrade)
135 return;

--- 395 unchanged lines hidden ---
144}
145
146
147void
148MSHR::TargetList::replaceUpgrades()
149{
150 if (!hasUpgrade)
151 return;

--- 395 unchanged lines hidden ---