summaryrefslogtreecommitdiff
path: root/src/cpu/o3/lsq_unit_impl.hh
diff options
context:
space:
mode:
authorRekai Gonzalez-Alberquilla <rekai.gonzalezalberquilla@arm.com>2017-03-01 13:49:08 +0000
committerGiacomo Gabrielli <giacomo.gabrielli@arm.com>2018-12-03 14:23:56 +0000
commit9af1214ffe48178c0dadfb874fd62bd0ff2e0f31 (patch)
tree1b4dd7edf77791c81f40f6d919829495eb80db93 /src/cpu/o3/lsq_unit_impl.hh
parentb5cc34d767410e98f54f2955bb274f0f8c3708e4 (diff)
downloadgem5-9af1214ffe48178c0dadfb874fd62bd0ff2e0f31.tar.xz
cpu: Change raw pointers to STL Containers
This patch changes two members from being raw pointers to being STL containers. The reason behind, other than cleanlyness and arguable OO best practices is that containers have more intronspections capabilities than naked pointers do, as the size is known. Using STL containers adds little overhead and eases the automation of process during debugging (gdb). Change-Id: I4d9d3eedafa8b5e50ac512ea93b458a4200229f2 Signed-off-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/13126 Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/cpu/o3/lsq_unit_impl.hh')
-rw-r--r--src/cpu/o3/lsq_unit_impl.hh26
1 files changed, 8 insertions, 18 deletions
diff --git a/src/cpu/o3/lsq_unit_impl.hh b/src/cpu/o3/lsq_unit_impl.hh
index d8f1c39c6..5438c4d07 100644
--- a/src/cpu/o3/lsq_unit_impl.hh
+++ b/src/cpu/o3/lsq_unit_impl.hh
@@ -142,8 +142,10 @@ LSQUnit<Impl>::completeDataAccess(PacketPtr pkt)
}
template <class Impl>
-LSQUnit<Impl>::LSQUnit()
- : loads(0), stores(0), storesToWB(0), cacheBlockMask(0), stalled(false),
+LSQUnit<Impl>::LSQUnit(uint32_t lqEntries, uint32_t sqEntries)
+ : lsqID(-1), storeQueue(sqEntries+1), loadQueue(lqEntries+1),
+ LQEntries(lqEntries+1), SQEntries(lqEntries+1),
+ loads(0), stores(0), storesToWB(0), cacheBlockMask(0), stalled(false),
isStoreBlocked(false), storeInFlight(false), hasPendingPkt(false),
pendingPkt(nullptr)
{
@@ -152,28 +154,16 @@ LSQUnit<Impl>::LSQUnit()
template<class Impl>
void
LSQUnit<Impl>::init(O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params,
- LSQ *lsq_ptr, unsigned maxLQEntries, unsigned maxSQEntries,
- unsigned id)
+ LSQ *lsq_ptr, unsigned id)
{
+ lsqID = id;
+
cpu = cpu_ptr;
iewStage = iew_ptr;
lsq = lsq_ptr;
- lsqID = id;
-
- DPRINTF(LSQUnit, "Creating LSQUnit%i object.\n",id);
-
- // Add 1 for the sentinel entry (they are circular queues).
- LQEntries = maxLQEntries + 1;
- SQEntries = maxSQEntries + 1;
-
- //Due to uint8_t index in LSQSenderState
- assert(LQEntries <= 256);
- assert(SQEntries <= 256);
-
- loadQueue.resize(LQEntries);
- storeQueue.resize(SQEntries);
+ DPRINTF(LSQUnit, "Creating LSQUnit%i object.\n",lsqID);
depCheckShift = params->LSQDepCheckShift;
checkLoads = params->LSQCheckLoads;