diff options
Diffstat (limited to 'src/cpu/testers/networktest/networktest.cc')
-rw-r--r-- | src/cpu/testers/networktest/networktest.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cpu/testers/networktest/networktest.cc b/src/cpu/testers/networktest/networktest.cc index 8ad32d140..4a79d5a17 100644 --- a/src/cpu/testers/networktest/networktest.cc +++ b/src/cpu/testers/networktest/networktest.cc @@ -198,9 +198,6 @@ NetworkTest::generatePkt() destination = dest_y*networkDimension + dest_x; } - Request *req = new Request(); - Request::Flags flags; - // The source of the packets is a cache. // The destination of the packets is a directory. // The destination bits are embedded in the address after byte-offset. @@ -234,21 +231,24 @@ NetworkTest::generatePkt() // MemCmd::Command requestType; + Request *req = nullptr; + Request::Flags flags; + unsigned randomReqType = random_mt.random(0, 2); if (randomReqType == 0) { // generate packet for virtual network 0 requestType = MemCmd::ReadReq; - req->setPhys(paddr, access_size, flags, masterId); + req = new Request(paddr, access_size, flags, masterId); } else if (randomReqType == 1) { // generate packet for virtual network 1 requestType = MemCmd::ReadReq; flags.set(Request::INST_FETCH); - req->setVirt(0, 0x0, access_size, flags, 0x0, masterId); + req = new Request(0, 0x0, access_size, flags, masterId, 0x0, 0, 0); req->setPaddr(paddr); } else { // if (randomReqType == 2) // generate packet for virtual network 2 requestType = MemCmd::WriteReq; - req->setPhys(paddr, access_size, flags, masterId); + req = new Request(paddr, access_size, flags, masterId); } req->setThreadContext(id,0); |