Andrea Mondelli has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/18948
Change subject: cpu: Added correct return type for ROB::countInsts
......................................................................
cpu: Added correct return type for ROB::countInsts
- return size_t (unsigned) according to the .size() return type
- fixed typo in doc (source of warning with some compilers)
Change-Id: I48ee2e317cf41011a6fcb5ca45aef67e75329bfa
---
M src/cpu/base.hh
M src/cpu/o3/rob.hh
M src/cpu/o3/rob_impl.hh
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/cpu/base.hh b/src/cpu/base.hh
index 3d679f1..1ca1ca1 100644
--- a/src/cpu/base.hh
+++ b/src/cpu/base.hh
@@ -287,7 +287,9 @@
virtual ThreadContext *getContext(int tn) { return threadContexts[tn]; }
/// Get the number of thread contexts available
- unsigned numContexts() { return threadContexts.size(); }
+ unsigned numContexts() {
+ return static_cast<unsigned>(threadContexts.size());
+ }
/// Convert ContextID to threadID
ThreadID contextToThread(ContextID cid)
@@ -399,7 +401,7 @@
* uniform data format for all CPU models and promotes better code
* reuse.
*
- * @param os The stream to serialize to.
+ * @param cp The stream to serialize to.
*/
void serialize(CheckpointOut &cp) const override;
@@ -412,14 +414,13 @@
* promotes better code reuse.
* @param cp The checkpoint use.
- * @param section The section name of this object.
*/
void unserialize(CheckpointIn &cp) override;
/**
* Serialize a single thread.
*
- * @param os The stream to serialize to.
+ * @param cp The stream to serialize to.
* @param tid ID of the current thread.
*/
virtual void serializeThread(CheckpointOut &cp, ThreadID tid) const {};
@@ -428,7 +429,6 @@
* Unserialize one thread.
*
* @param cp The checkpoint use.
- * @param section The section name of this thread.
* @param tid ID of the current thread.
*/
virtual void unserializeThread(CheckpointIn &cp, ThreadID tid) {};
diff --git a/src/cpu/o3/rob.hh b/src/cpu/o3/rob.hh
index ad7a6d6..0289d2c 100644
--- a/src/cpu/o3/rob.hh
+++ b/src/cpu/o3/rob.hh
@@ -258,7 +258,7 @@
* threadEntries to get the instructions in the ROB unless you are
* double checking that variable.
*/
- int countInsts(ThreadID tid);
+ size_t countInsts(ThreadID tid);
/** Registers statistics. */
void regStats();
diff --git a/src/cpu/o3/rob_impl.hh b/src/cpu/o3/rob_impl.hh
index 5d5d821..432d43f 100644
--- a/src/cpu/o3/rob_impl.hh
+++ b/src/cpu/o3/rob_impl.hh
@@ -153,7 +153,7 @@
ROB<Impl>::resetEntries()
{
if (robPolicy != SMTQueuePolicy::Dynamic || numThreads > 1) {
- int active_threads = activeThreads->size();
+ auto active_threads = activeThreads->size();
list<ThreadID>::iterator threads = activeThreads->begin();
list<ThreadID>::iterator end = activeThreads->end();
@@ -195,7 +195,7 @@
}
template <class Impl>
-int
+size_t
ROB<Impl>::countInsts(ThreadID tid)
{
return instList[tid].size();
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/18948
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: I48ee2e317cf41011a6fcb5ca45aef67e75329bfa
Gerrit-Change-Number: 18948
Gerrit-PatchSet: 1
Gerrit-Owner: Andrea Mondelli <andrea.monde...@ucf.edu>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev