GarnetSyntheticTraffic.cc (12748:ae5ce8e42de7) GarnetSyntheticTraffic.cc (12749:223c83ed9979)
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{
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 RequestPtr req = pkt->req;
133
134 DPRINTF(GarnetSyntheticTraffic,
135 "Completed injection of %s packet for address %x\n",
136 pkt->isWrite() ? "write" : "read\n",
132 DPRINTF(GarnetSyntheticTraffic,
133 "Completed injection of %s packet for address %x\n",
134 pkt->isWrite() ? "write" : "read\n",
137 req->getPaddr());
135 pkt->req->getPaddr());
138
139 assert(pkt->isResponse());
140 noResponseCycles = 0;
136
137 assert(pkt->isResponse());
138 noResponseCycles = 0;
141 delete req;
142 delete pkt;
143}
144
145
146void
147GarnetSyntheticTraffic::tick()
148{
149 if (++noResponseCycles >= responseLimit) {

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

291 {
292 // randomly inject in any vnet
293 injReqType = random_mt.random(0, 2);
294 }
295
296 if (injReqType == 0) {
297 // generate packet for virtual network 0
298 requestType = MemCmd::ReadReq;
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;
299 req = new Request(paddr, access_size, flags, masterId);
296 req = std::make_shared<Request>(paddr, access_size, flags, masterId);
300 } else if (injReqType == 1) {
301 // generate packet for virtual network 1
302 requestType = MemCmd::ReadReq;
303 flags.set(Request::INST_FETCH);
297 } else if (injReqType == 1) {
298 // generate packet for virtual network 1
299 requestType = MemCmd::ReadReq;
300 flags.set(Request::INST_FETCH);
304 req = new Request(0, 0x0, access_size, flags, masterId, 0x0, 0);
301 req = std::make_shared<Request>(
302 0, 0x0, access_size, flags, masterId, 0x0, 0);
305 req->setPaddr(paddr);
306 } else { // if (injReqType == 2)
307 // generate packet for virtual network 2
308 requestType = MemCmd::WriteReq;
303 req->setPaddr(paddr);
304 } else { // if (injReqType == 2)
305 // generate packet for virtual network 2
306 requestType = MemCmd::WriteReq;
309 req = new Request(paddr, access_size, flags, masterId);
307 req = std::make_shared<Request>(paddr, access_size, flags, masterId);
310 }
311
312 req->setContext(id);
313
314 //No need to do functional simulation
315 //We just do timing simulation of the network
316
317 DPRINTF(GarnetSyntheticTraffic,

--- 43 unchanged lines hidden ---
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 ---