Shivani Parekh has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/33524 )
Change subject: sim: Update master/slave variables/comments
......................................................................
sim: Update master/slave variables/comments
Change-Id: I53c93e049e26ef24f3640b332d7c66bd8a2a248d
---
M src/sim/cxx_config.hh
M src/sim/cxx_manager.cc
M src/sim/cxx_manager.hh
M src/sim/probe/mem.hh
M src/sim/system.cc
5 files changed, 51 insertions(+), 49 deletions(-)
diff --git a/src/sim/cxx_config.hh b/src/sim/cxx_config.hh
index 9f8a07d..9a45e76 100644
--- a/src/sim/cxx_config.hh
+++ b/src/sim/cxx_config.hh
@@ -95,12 +95,12 @@
/* Is this a vector or singleton parameters/SimObject */
const bool isVector;
- /** Is this a master or slave port */
- const bool isMaster;
+ /** Is this a request or response port */
+ const bool isRequestor;
PortDesc(const std::string &name_,
- bool isVector_, bool isMaster_) :
- name(name_), isVector(isVector_), isMaster(isMaster_)
+ bool isVector_, bool isRequestor_) :
+ name(name_), isVector(isVector_), isRequestor(isRequestor_)
{ }
};
diff --git a/src/sim/cxx_manager.cc b/src/sim/cxx_manager.cc
index 71ee10b..5511d5f 100644
--- a/src/sim/cxx_manager.cc
+++ b/src/sim/cxx_manager.cc
@@ -444,39 +444,39 @@
void
CxxConfigManager::bindPort(
- SimObject *master_object, const std::string &master_port_name,
- PortID master_port_index,
- SimObject *slave_object, const std::string &slave_port_name,
- PortID slave_port_index)
+ SimObject *master_object, const std::string &request_port_name,
+ PortID request_port_index,
+ SimObject *response_object, const std::string &response_port_name,
+ PortID response_port_index)
{
- /* FIXME, check slave_port_index against connection_count
+ /* FIXME, check response_port_index against connection_count
* defined for port, need getPortConnectionCount and a
* getCxxConfigDirectoryEntry for each object. */
/* It would be nice to be able to catch the errors from these calls. */
- Port &master_port = master_object->getPort(
- master_port_name, master_port_index);
- Port &slave_port = slave_object->getPort(
- slave_port_name, slave_port_index);
+ Port &request_port = master_object->getPort(
+ request_port_name, request_port_index);
+ Port &response_port = response_object->getPort(
+ response_port_name, response_port_index);
- if (master_port.isConnected()) {
+ if (request_port.isConnected()) {
throw Exception(master_object->name(), csprintf(
- "Master port: %s[%d] is already connected\n", master_port_name,
- master_port_index));
+ "Request port: %s[%d] is already connected\n",
request_port_name,
+ request_port_index));
}
- if (slave_port.isConnected()) {
- throw Exception(slave_object->name(), csprintf(
- "Slave port: %s[%d] is already connected\n", slave_port_name,
- slave_port_index));
+ if (response_port.isConnected()) {
+ throw Exception(response_object->name(), csprintf(
+ "Response port: %s[%d] is already connected\n",
response_port_name,
+ response_port_index));
}
DPRINTF(CxxConfig, "Binding port %s.%s[%d]"
" to %s:%s[%d]\n",
- master_object->name(), master_port_name, master_port_index,
- slave_object->name(), slave_port_name, slave_port_index);
+ master_object->name(), request_port_name, request_port_index,
+ response_object->name(), response_port_name, response_port_index);
- master_port.bind(slave_port);
+ request_port.bind(response_port);
}
void
@@ -484,32 +484,34 @@
const CxxConfigDirectoryEntry::PortDesc &port,
const std::vector<std::string> &peers)
{
- unsigned int master_port_index = 0;
+ unsigned int request_port_index = 0;
for (auto peer_i = peers.begin(); peer_i != peers.end();
++peer_i)
{
const std::string &peer = *peer_i;
- std::string slave_object_name;
- std::string slave_port_name;
- unsigned int slave_port_index;
+ std::string response_object_name;
+ std::string response_port_name;
+ unsigned int response_port_index;
- parsePort(peer, slave_object_name, slave_port_name,
- slave_port_index);
+ parsePort(peer, response_object_name, response_port_name,
+ response_port_index);
- std::string slave_instance_name = rename(slave_object_name);
+ std::string response_instance_name = rename(response_object_name);
- if (objectsByName.find(slave_instance_name) ==
objectsByName.end()) {
+ if (objectsByName.find(response_instance_name)
+ == objectsByName.end()) {
throw Exception(object->name(), csprintf(
- "Can't find slave port object: %s", slave_instance_name));
+ "Can't find response port object: %s",
+ response_instance_name));
}
- SimObject *slave_object = objectsByName[slave_instance_name];
+ SimObject *response_object = objectsByName[response_instance_name];
- bindPort(object, port.name, master_port_index,
- slave_object, slave_port_name, slave_port_index);
+ bindPort(object, port.name, request_port_index,
+ response_object, response_port_name, response_port_index);
- master_port_index++;
+ request_port_index++;
}
}
@@ -540,7 +542,7 @@
/* Only handle master ports as binding only needs to happen once
* for each observed pair of ports */
- if (port->isMaster) {
+ if (port->isRequestor) {
if (!port->isVector && peers.size() > 1) {
throw Exception(instance_name, csprintf(
"Too many connections to non-vector port %s (%d)\n",
diff --git a/src/sim/cxx_manager.hh b/src/sim/cxx_manager.hh
index 30339ad..413e59f 100644
--- a/src/sim/cxx_manager.hh
+++ b/src/sim/cxx_manager.hh
@@ -126,11 +126,11 @@
std::list<Renaming> renamings;
/** Bind a single connection between two objects' ports */
- void bindPort(SimObject *masterObject, const std::string &masterPort,
- PortID masterPortIndex, SimObject *slaveObject,
- const std::string &slavePort, PortID slavePortIndex);
+ void bindPort(SimObject *masterObject, const std::string &requestPort,
+ PortID requestPortIndex, SimObject *responseObject,
+ const std::string &responsePort, PortID responsePortIndex);
- /** Bind a single (possibly vectored) master port to peers from the
+ /** Bind a single (possibly vectored) request port to peers from the
* unparsed list peers with elements in the .ini connection format:
* path(.path)*.port[index] */
void bindMasterPort(SimObject *object,
diff --git a/src/sim/probe/mem.hh b/src/sim/probe/mem.hh
index fed7bcf..e8fa6e0 100644
--- a/src/sim/probe/mem.hh
+++ b/src/sim/probe/mem.hh
@@ -56,7 +56,7 @@
uint32_t size;
Request::FlagsType flags;
Addr pc;
- MasterID master;
+ MasterID id;
explicit PacketInfo(const PacketPtr& pkt) :
cmd(pkt->cmd),
@@ -64,7 +64,7 @@
size(pkt->getSize()),
flags(pkt->req->getFlags()),
pc(pkt->req->hasPC() ? pkt->req->getPC() : 0),
- master(pkt->req->masterId()) { }
+ id(pkt->req->masterId()) { }
};
/**
diff --git a/src/sim/system.cc b/src/sim/system.cc
index 8185f13..971cc79 100644
--- a/src/sim/system.cc
+++ b/src/sim/system.cc
@@ -581,8 +581,8 @@
{
std::string name = stripSystemName(master_name);
- for (int i = 0; i < masters.size(); i++) {
- if (masters[i].masterName == name) {
+ for (int i = 0; i < requestors.size(); i++) {
+ if (requestors[i].req_name == name) {
return i;
}
}
@@ -609,8 +609,8 @@
std::string name = stripSystemName(master_name);
// CPUs in switch_cpus ask for ids again after switching
- for (int i = 0; i < masters.size(); i++) {
- if (masters[i].masterName == name) {
+ for (int i = 0; i < requestors.size(); i++) {
+ if (requestors[i].req_name == name) {
return i;
}
}
@@ -651,8 +651,8 @@
if (master_id >= masters.size())
fatal("Invalid master_id passed to getMasterName()\n");
- const auto& master_info = masters[master_id];
- return master_info.masterName;
+ const auto& requestor_info = requestors[unique_id];
+ return requestor_info.req_name;
}
System *
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/33524
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I53c93e049e26ef24f3640b332d7c66bd8a2a248d
Gerrit-Change-Number: 33524
Gerrit-PatchSet: 1
Gerrit-Owner: Shivani Parekh <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s