diff options
Diffstat (limited to 'src/cpu/testers/networktest')
-rw-r--r-- | src/cpu/testers/networktest/NetworkTest.py | 2 | ||||
-rw-r--r-- | src/cpu/testers/networktest/networktest.cc | 10 | ||||
-rw-r--r-- | src/cpu/testers/networktest/networktest.hh | 2 |
3 files changed, 10 insertions, 4 deletions
diff --git a/src/cpu/testers/networktest/NetworkTest.py b/src/cpu/testers/networktest/NetworkTest.py index 0a18ca938..b2eda9aa2 100644 --- a/src/cpu/testers/networktest/NetworkTest.py +++ b/src/cpu/testers/networktest/NetworkTest.py @@ -28,6 +28,7 @@ from MemObject import MemObject from m5.params import * +from m5.proxy import * class NetworkTest(MemObject): type = 'NetworkTest' @@ -41,3 +42,4 @@ class NetworkTest(MemObject): inj_rate = Param.Float(0.1, "Packet injection rate") precision = Param.Int(3, "Number of digits of precision after decimal point") test = Port("Port to the memory system to test") + system = Param.System(Parent.any, "System we belong to") diff --git a/src/cpu/testers/networktest/networktest.cc b/src/cpu/testers/networktest/networktest.cc index 56fcc46c4..3fe153c4e 100644 --- a/src/cpu/testers/networktest/networktest.cc +++ b/src/cpu/testers/networktest/networktest.cc @@ -44,6 +44,7 @@ #include "mem/request.hh" #include "sim/sim_events.hh" #include "sim/stats.hh" +#include "sim/system.hh" using namespace std; @@ -113,7 +114,8 @@ NetworkTest::NetworkTest(const Params *p) maxPackets(p->max_packets), trafficType(p->traffic_type), injRate(p->inj_rate), - precision(p->precision) + precision(p->precision), + masterId(p->system->getMasterId(name())) { // set up counters noResponseCycles = 0; @@ -263,17 +265,17 @@ NetworkTest::generatePkt() if (randomReqType == 0) { // generate packet for virtual network 0 requestType = MemCmd::ReadReq; - req->setPhys(paddr, access_size, flags); + req->setPhys(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); + req->setVirt(0, 0x0, access_size, flags, 0x0, masterId); req->setPaddr(paddr); } else { // if (randomReqType == 2) // generate packet for virtual network 2 requestType = MemCmd::WriteReq; - req->setPhys(paddr, access_size, flags); + req->setPhys(paddr, access_size, flags, masterId); } req->setThreadContext(id,0); diff --git a/src/cpu/testers/networktest/networktest.hh b/src/cpu/testers/networktest/networktest.hh index c277cfbab..de67d41a0 100644 --- a/src/cpu/testers/networktest/networktest.hh +++ b/src/cpu/testers/networktest/networktest.hh @@ -134,6 +134,8 @@ class NetworkTest : public MemObject double injRate; int precision; + MasterID masterId; + void completeRequest(PacketPtr pkt); void generatePkt(); |