19 #include <config/ActiveRateGroupCfg.hpp> 25 static_assert(ATOMIC_BOOL_LOCK_FREE == 2,
"std::atomic<bool> must be lock-free for the cycle-started flag");
31 m_cycleStarted(false),
38 "Context table size must match the number of rate group member output ports");
42 for (
FwIndexType entry = 0; entry < this->m_numContexts; entry++) {
43 this->m_contexts[entry] = contexts[
static_cast<FwSizeType>(entry)];
53 for (
FwIndexType entry = 0; entry < numContexts; entry++) {
54 contextArray[
static_cast<FwSizeType>(entry)] = contexts[entry];
61 void ActiveRateGroup::preamble() {
73 this->m_cycleStarted.store(
false, std::memory_order_relaxed);
76 for (
FwIndexType port = 0; port < this->m_numContexts; port++) {
95 if (cycleTime > this->m_maxTime) {
96 this->m_maxTime = cycleTime;
104 if (this->m_cycleStarted.load(std::memory_order_relaxed)) {
105 this->m_cycleSlips++;
108 this->m_overrunThrottle++;
113 if (this->m_overrunThrottle > 0) {
114 this->m_overrunThrottle--;
124 this->m_cycleStarted.store(
true, std::memory_order_relaxed);
127 void ActiveRateGroup::PingIn_handler(
FwIndexType portNum, U32 key) {
void configure(const ContextArray &contexts)
ActiveRateGroup configuration function.
void tlmWrite_RgCycleSlips(U32 arg, Fw::Time _tlmTime=Fw::Time())
ActiveRateGroup(const char *compName)
ActiveRateGroup constructor.
FPP shadow-enum representing Os::RawTime::Status.
PlatformSizeType FwSizeType
static constexpr FwIndexType getNum_RateGroupMemberOut_OutputPorts()
void log_WARNING_HI_RateGroupTimeGetError(const Os::RawTimeStatus &status)
Status now() override
Get the current time.
void PingOut_out(FwIndexType portNum, U32 key) const
Invoke output port PingOut.
~ActiveRateGroup()
ActiveRateGroup destructor.
void log_DIAGNOSTIC_RateGroupStarted() const
void tlmWrite_RgMaxTime(U32 arg, Fw::Time _tlmTime=Fw::Time())
void RateGroupMemberOut_out(FwIndexType portNum, U32 context) const
Invoke output port RateGroupMemberOut.
void log_WARNING_HI_RateGroupCycleSlip(U32 cycle) const
static constexpr FwIndexType CONNECTION_COUNT_MAX
Auto-generated base for ActiveRateGroup component.
PlatformIndexType FwIndexType
Status getDiffUsec(const RawTime &other, U32 &result) const override
Calculate the difference in microseconds between two RawTime objects.
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
RateGroupDivider component implementation.
Fw::Array< U32, CONNECTION_COUNT_MAX > ContextArray
Array of context values for rate group members, indexed by output port number.
bool isConnected_RateGroupMemberOut_OutputPort(FwIndexType portNum) const
Number of overruns allowed before overrun event is throttled.