18 #include <config/PassiveRateGroupCfg.hpp> 26 m_portCycleTimeHWMUsec{},
32 Os::RawTime PassiveRateGroup::createRawTime()
const {
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)];
46 this->m_rawTimeSource = rawTimeSource;
55 for (
FwIndexType entry = 0; entry < numContexts; entry++) {
56 contextArray[
static_cast<FwSizeType>(entry)] = static_cast<U32>(contexts[entry]);
68 PassiveRateGroup_CycleTime portTimes;
74 (void)portStart.
now();
83 portTimes[
static_cast<FwSizeType>(port)] = cycleTime;
86 this->m_portCycleTimeHWMUsec[
static_cast<FwSizeType>(port)].load(std::memory_order_relaxed);
87 while (cycleTime > currentHWM) {
88 if (this->m_portCycleTimeHWMUsec[static_cast<FwSizeType>(port)].compare_exchange_weak(
89 currentHWM, cycleTime, std::memory_order_relaxed)) {
107 U32 currentMax = this->m_maxTime.load(std::memory_order_relaxed);
108 while (cycleTime > currentMax) {
109 if (this->m_maxTime.compare_exchange_weak(currentMax, cycleTime, std::memory_order_relaxed)) {
114 U32 maxTime = this->m_maxTime.load(std::memory_order_relaxed);
115 U32 cycles = ++this->m_cycles;
119 PassiveRateGroup_CycleTime portCycleTimeHWM;
121 portCycleTimeHWM[
static_cast<FwSizeType>(port)] =
122 this->m_portCycleTimeHWMUsec[static_cast<FwSizeType>(port)].load(std::memory_order_relaxed);
133 void PassiveRateGroup::CLEAR_STATISTICS_cmdHandler(
FwOpcodeType opCode, U32 cmdSeq) {
135 this->m_maxTime.store(0, std::memory_order_relaxed);
140 this->m_portCycleTimeHWMUsec[
static_cast<FwSizeType>(port)].store(0, std::memory_order_relaxed);
RawTimeSource
Timer source selection for RawTime.
PassiveRateGroup(const char *compName)
PassiveRateGroupImpl constructor.
Platform's default timer (maintains current behavior)
FwIdType FwOpcodeType
The type of a command opcode.
PlatformSizeType FwSizeType
bool isConnected_RateGroupMemberOut_OutputPort(FwIndexType portNum) const
static constexpr FwIndexType getNum_RateGroupMemberOut_OutputPorts()
Status now() override
Get the current time.
void RateGroupMemberOut_out(FwIndexType portNum, U32 context) const
Invoke output port RateGroupMemberOut.
void tlmWrite_CycleTime(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
Fw::Array< U32, CONNECTION_COUNT_MAX > ContextArray
Array of context values for rate group members, indexed by output port number.
static constexpr FwIndexType CONNECTION_COUNT_MAX
Auto-generated base for PassiveRateGroup component.
void configure(const ContextArray &contexts, const Os::RawTimeSource rawTimeSource=Os::RAWTIME_DEFAULT)
PassiveRateGroupImpl initialization function.
Command successfully executed.
void tlmWrite_MaxCycleTime(U32 arg, Fw::Time _tlmTime=Fw::Time())
void tlmWrite_PortCycleTimeHWM(const Svc::PassiveRateGroup_CycleTime &arg, Fw::Time _tlmTime=Fw::Time())
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
void tlmWrite_CycleCount(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
constexpr bool PortCycleTime
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
~PassiveRateGroup()
PassiveRateGroupImpl destructor.
RateGroupDivider component implementation.
void tlmWrite_PortCycleTime(const Svc::PassiveRateGroup_CycleTime &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel PortCycleTime.