1/* 2 * Copyright (c) 2016 Georgia Institute of Technology 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; --- 115 unchanged lines hidden (view full) --- 124{ 125 numPacketsSent = 0; 126} 127 128 129void 130GarnetSyntheticTraffic::completeRequest(PacketPtr pkt) 131{ |
132 DPRINTF(GarnetSyntheticTraffic, 133 "Completed injection of %s packet for address %x\n", 134 pkt->isWrite() ? "write" : "read\n", |
135 pkt->req->getPaddr()); |
136 137 assert(pkt->isResponse()); 138 noResponseCycles = 0; |
139 delete pkt; 140} 141 142 143void 144GarnetSyntheticTraffic::tick() 145{ 146 if (++noResponseCycles >= responseLimit) { --- 141 unchanged lines hidden (view full) --- 288 { 289 // randomly inject in any vnet 290 injReqType = random_mt.random(0, 2); 291 } 292 293 if (injReqType == 0) { 294 // generate packet for virtual network 0 295 requestType = MemCmd::ReadReq; |
296 req = std::make_shared<Request>(paddr, access_size, flags, masterId); |
297 } else if (injReqType == 1) { 298 // generate packet for virtual network 1 299 requestType = MemCmd::ReadReq; 300 flags.set(Request::INST_FETCH); |
301 req = std::make_shared<Request>( 302 0, 0x0, access_size, flags, masterId, 0x0, 0); |
303 req->setPaddr(paddr); 304 } else { // if (injReqType == 2) 305 // generate packet for virtual network 2 306 requestType = MemCmd::WriteReq; |
307 req = std::make_shared<Request>(paddr, access_size, flags, masterId); |
308 } 309 310 req->setContext(id); 311 312 //No need to do functional simulation 313 //We just do timing simulation of the network 314 315 DPRINTF(GarnetSyntheticTraffic, --- 43 unchanged lines hidden --- |