packet.cc (3400:469db0566924) | packet.cc (3605:ed3c5b4e8bca) |
---|---|
1/* 2 * Copyright (c) 2006 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 154 unchanged lines hidden (view full) --- 163 return true; 164 165 if (func->isRead()) { 166 if (funcStart >= timingStart && funcEnd <= timingEnd) { 167 func->allocate(); 168 memcpy(func->getPtr<uint8_t>(), timing->getPtr<uint8_t>() + 169 funcStart - timingStart, func->getSize()); 170 func->result = Packet::Success; | 1/* 2 * Copyright (c) 2006 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 154 unchanged lines hidden (view full) --- 163 return true; 164 165 if (func->isRead()) { 166 if (funcStart >= timingStart && funcEnd <= timingEnd) { 167 func->allocate(); 168 memcpy(func->getPtr<uint8_t>(), timing->getPtr<uint8_t>() + 169 funcStart - timingStart, func->getSize()); 170 func->result = Packet::Success; |
171 func->flags |= SATISFIED; |
|
171 return false; 172 } else { 173 // In this case the timing packet only partially satisfies the 174 // requset, so we would need more information to make this work. 175 // Like bytes valid in the packet or something, so the request could 176 // continue and get this bit of possibly newer data along with the 177 // older data not written to yet. 178 panic("Timing packet only partially satisfies the functional" 179 "request. Now what?"); 180 } 181 } else if (func->isWrite()) { 182 if (funcStart >= timingStart) { 183 memcpy(timing->getPtr<uint8_t>() + (funcStart - timingStart), 184 func->getPtr<uint8_t>(), | 172 return false; 173 } else { 174 // In this case the timing packet only partially satisfies the 175 // requset, so we would need more information to make this work. 176 // Like bytes valid in the packet or something, so the request could 177 // continue and get this bit of possibly newer data along with the 178 // older data not written to yet. 179 panic("Timing packet only partially satisfies the functional" 180 "request. Now what?"); 181 } 182 } else if (func->isWrite()) { 183 if (funcStart >= timingStart) { 184 memcpy(timing->getPtr<uint8_t>() + (funcStart - timingStart), 185 func->getPtr<uint8_t>(), |
185 std::min(funcEnd, timingEnd) - funcStart); | 186 (std::min(funcEnd, timingEnd) - funcStart) + 1); |
186 } else { // timingStart > funcStart 187 memcpy(timing->getPtr<uint8_t>(), 188 func->getPtr<uint8_t>() + (timingStart - funcStart), | 187 } else { // timingStart > funcStart 188 memcpy(timing->getPtr<uint8_t>(), 189 func->getPtr<uint8_t>() + (timingStart - funcStart), |
189 std::min(funcEnd, timingEnd) - timingStart); | 190 (std::min(funcEnd, timingEnd) - timingStart) + 1); |
190 } 191 // we always want to keep going with a write 192 return true; 193 } else 194 panic("Don't know how to handle command type %#x\n", 195 func->cmdToIndex()); 196 197} --- 41 unchanged lines hidden --- | 191 } 192 // we always want to keep going with a write 193 return true; 194 } else 195 panic("Don't know how to handle command type %#x\n", 196 func->cmdToIndex()); 197 198} --- 41 unchanged lines hidden --- |