684,701d683
< static Addr
< addrBlockOffset(Addr addr, unsigned int block_size)
< {
< return addr & (block_size - 1);
< }
<
< static Addr
< addrBlockAlign(Addr addr, uint64_t block_size)
< {
< return addr & ~(block_size - 1);
< }
<
< static bool
< transferNeedsBurst(Addr addr, uint64_t size, uint64_t block_size)
< {
< return (addrBlockOffset(addr, block_size) + size) > block_size;
< }
<
706c688,689
< uint64_t *res, AtomicOpFunctor *amo_op)
---
> uint64_t *res, AtomicOpFunctor *amo_op,
> const std::vector<bool>& byteEnable)
737a721,723
> if (!byteEnable.empty()) {
> req->_byteEnable = byteEnable;
> }
758a745
> inst->setMemAccPredicate(false);
851,853c838
< _inst->translationStarted(true);
< setState(State::Translation);
< flags.set(Flag::TranslationStarted);
---
> assert(_requests.size() == 0);
855,856c840
< _inst->savedReq = this;
< sendFragmentToTranslation(0);
---
> this->addRequest(_addr, _size, _byteEnable);
858c842,852
< if (isTranslationComplete()) {
---
> if (_requests.size() > 0) {
> _requests.back()->setReqInstSeqNum(_inst->seqNum);
> _requests.back()->taskId(_taskId);
> _inst->translationStarted(true);
> setState(State::Translation);
> flags.set(Flag::TranslationStarted);
>
> _inst->savedReq = this;
> sendFragmentToTranslation(0);
> } else {
> _inst->setMemAccPredicate(false);
880,884c874
< _inst->translationStarted(true);
< setState(State::Translation);
< flags.set(Flag::TranslationStarted);
<
< unsigned int cacheLineSize = _port.cacheLineSize();
---
> auto cacheLineSize = _port.cacheLineSize();
892a883,885
> if (!_byteEnable.empty()) {
> mainReq->setByteEnable(_byteEnable);
> }
901,903c894,901
< _requests.push_back(std::make_shared<Request>(_inst->getASID(), base_addr,
< next_addr - base_addr, _flags, _inst->masterId(),
< _inst->instAddr(), _inst->contextId()));
---
> if (_byteEnable.empty()) {
> this->addRequest(base_addr, next_addr - base_addr, _byteEnable);
> } else {
> auto it_start = _byteEnable.begin();
> auto it_end = _byteEnable.begin() + (next_addr - base_addr);
> this->addRequest(base_addr, next_addr - base_addr,
> std::vector<bool>(it_start, it_end));
> }
909,911c907,914
< _requests.push_back(std::make_shared<Request>(_inst->getASID(),
< base_addr, cacheLineSize, _flags, _inst->masterId(),
< _inst->instAddr(), _inst->contextId()));
---
> if (_byteEnable.empty()) {
> this->addRequest(base_addr, cacheLineSize, _byteEnable);
> } else {
> auto it_start = _byteEnable.begin() + size_so_far;
> auto it_end = _byteEnable.begin() + size_so_far + cacheLineSize;
> this->addRequest(base_addr, cacheLineSize,
> std::vector<bool>(it_start, it_end));
> }
918,920c921,928
< _requests.push_back(std::make_shared<Request>(_inst->getASID(),
< base_addr, _size - size_so_far, _flags, _inst->masterId(),
< _inst->instAddr(), _inst->contextId()));
---
> if (_byteEnable.empty()) {
> this->addRequest(base_addr, _size - size_so_far, _byteEnable);
> } else {
> auto it_start = _byteEnable.begin() + size_so_far;
> auto it_end = _byteEnable.end();
> this->addRequest(base_addr, _size - size_so_far,
> std::vector<bool>(it_start, it_end));
> }
923,930c931,936
< /* Setup the requests and send them to translation. */
< for (auto& r: _requests) {
< r->setReqInstSeqNum(_inst->seqNum);
< r->taskId(_taskId);
< }
< this->_inst->savedReq = this;
< numInTranslationFragments = 0;
< numTranslatedFragments = 0;
---
> if (_requests.size() > 0) {
> /* Setup the requests and send them to translation. */
> for (auto& r: _requests) {
> r->setReqInstSeqNum(_inst->seqNum);
> r->taskId(_taskId);
> }
932,933c938,950
< for (uint32_t i = 0; i < _requests.size(); i++) {
< sendFragmentToTranslation(i);
---
> _inst->translationStarted(true);
> setState(State::Translation);
> flags.set(Flag::TranslationStarted);
> this->_inst->savedReq = this;
> numInTranslationFragments = 0;
> numTranslatedFragments = 0;
> _fault.resize(_requests.size());
>
> for (uint32_t i = 0; i < _requests.size(); i++) {
> sendFragmentToTranslation(i);
> }
> } else {
> _inst->setMemAccPredicate(false);
971,972d987
< assert(pkt->req == _requests[pktIdx]);
< assert(pkt == _packets[pktIdx]);
1015c1030,1031
< ptrdiff_t offset = 0;
---
> Addr base_address = _addr;
>
1022c1038,1039
< for (auto& r: _requests) {
---
> for (int i = 0; i < _requests.size() && _fault[i] == NoFault; i++) {
> RequestPtr r = _requests[i];
1024c1041,1042
< : Packet::createWrite(r);
---
> : Packet::createWrite(r);
> ptrdiff_t offset = r->getVaddr() - base_address;
1034d1051
< offset += r->getSize();
1039c1056
< assert(_packets.size() == _requests.size());
---
> assert(_packets.size() > 0);