summaryrefslogtreecommitdiff
path: root/src/ipa/libipa
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipa/libipa')
-rw-r--r--src/ipa/libipa/fc_queue.cpp10
-rw-r--r--src/ipa/libipa/fc_queue.h19
2 files changed, 20 insertions, 9 deletions
diff --git a/src/ipa/libipa/fc_queue.cpp b/src/ipa/libipa/fc_queue.cpp
index fa2454fd..56c7c75a 100644
--- a/src/ipa/libipa/fc_queue.cpp
+++ b/src/ipa/libipa/fc_queue.cpp
@@ -42,6 +42,7 @@ namespace ipa {
* \fn FrameContext::init()
* \brief Initialize a frame context
* \param[in] frameNum The frame number to assign to this FrameContext
+ * \param[in] activeState The IPA current active state
*
* This function initializes a frame context by assigning it a frame number.
* The single IPA modules are expected to override this function to initialize
@@ -117,9 +118,10 @@ namespace ipa {
*/
/**
- * \fn FCQueue::alloc(uint32_t frame)
+ * \fn FCQueue::alloc(uint32_t frame, const ActiveState &activeState)
* \brief Allocate and return a FrameContext for the \a frame
* \param[in] frame The frame context sequence number
+ * \param[in] activeState The IPA current active state
*
* The first call to obtain a FrameContext from the FCQueue should be handled
* through this function. The FrameContext will be initialised, if not
@@ -135,12 +137,14 @@ namespace ipa {
*/
/**
- * \fn FCQueue::get(uint32_t frame)
+ * \fn FCQueue::get(uint32_t frame, const ActiveState &activeState)
* \brief Obtain the FrameContext for the \a frame
* \param[in] frame The frame context sequence number
+ * \param[in] activeState The IPA current active state
*
* If the FrameContext is not correctly initialised for the \a frame, it will be
- * initialised.
+ * initialised using the most current state of IPA algorithm contained in
+ * \a activeState.
*
* \return A reference to the FrameContext for sequence \a frame
*/
diff --git a/src/ipa/libipa/fc_queue.h b/src/ipa/libipa/fc_queue.h
index bfcce5a8..48842e54 100644
--- a/src/ipa/libipa/fc_queue.h
+++ b/src/ipa/libipa/fc_queue.h
@@ -21,9 +21,16 @@ namespace ipa {
template<typename FrameContext>
class FCQueue;
+struct ActiveState {
+};
+
struct FrameContext {
+public:
+ virtual ~FrameContext() = default;
+
protected:
- virtual void init(const uint32_t frameNum)
+ virtual void init(const uint32_t frameNum,
+ [[maybe_unused]] const ActiveState &activeState)
{
frame = frameNum;
initialised = true;
@@ -52,7 +59,7 @@ public:
}
}
- FrameContext &alloc(const uint32_t frame)
+ FrameContext &alloc(const uint32_t frame, const ActiveState &activeState)
{
FrameContext &frameContext = contexts_[frame % contexts_.size()];
@@ -71,12 +78,12 @@ public:
LOG(FCQueue, Warning)
<< "Frame " << frame << " already initialised";
else
- frameContext.init(frame);
+ frameContext.init(frame, activeState);
return frameContext;
}
- FrameContext &get(uint32_t frame)
+ FrameContext &get(uint32_t frame, const ActiveState &activeState)
{
FrameContext &frameContext = contexts_[frame % contexts_.size()];
@@ -103,7 +110,7 @@ public:
* Make sure the FrameContext gets initialised if get()
* is called before alloc() by the IPA for frame#0.
*/
- frameContext.init(frame);
+ frameContext.init(frame, activeState);
return frameContext;
}
@@ -123,7 +130,7 @@ public:
LOG(FCQueue, Warning)
<< "Obtained an uninitialised FrameContext for " << frame;
- frameContext.init(frame);
+ frameContext.init(frame, activeState);
return frameContext;
}