Hello Andreas Sandberg,
I'd like you to do a code review. Please visit
https://gem5-review.googlesource.com/10301
to review the following change.
Change subject: sim: Remove trailing dot when assigning a master's name
......................................................................
sim: Remove trailing dot when assigning a master's name
This patch fixes the master's name allocation in the system. The error
was occurring when a submaster was not specified in getMasterId: a
trailing separation dot was still added to the master's name.
Change-Id: I0e67900f6fdd36a61900453b55219fc7007d1b05
Signed-off-by: Giacomo Travaglini <giacomo.travagl...@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandb...@arm.com>
---
M src/sim/system.cc
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/sim/system.cc b/src/sim/system.cc
index 911ee5d..74bc94e 100644
--- a/src/sim/system.cc
+++ b/src/sim/system.cc
@@ -538,10 +538,13 @@
std::string
System::leafMasterName(const SimObject* master, const std::string&
submaster)
{
- // Get the full master name by appending the submaster name to
- // the root SimObject master name
- auto master_name = master->name() + "." + submaster;
- return master_name;
+ if (submaster.empty()) {
+ return master->name();
+ } else {
+ // Get the full master name by appending the submaster name to
+ // the root SimObject master name
+ return master->name() + "." + submaster;
+ }
}
std::string
--
To view, visit https://gem5-review.googlesource.com/10301
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I0e67900f6fdd36a61900453b55219fc7007d1b05
Gerrit-Change-Number: 10301
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev