Add Framing subtopologies and use them within Com subtopologies (#4113)

* Update ComX subtopologies to not include ComStub and update Ref

* Cosmetic updates

* Working FramingCcsds subtopology used in ComCcsds

* Revert Ref to use ComCcsds

* Move FramingSubtopology into ComCcsds build module

* Working ComFprime subtopology

* Cosmetic updates

* formatting
This commit is contained in:
Thomas Boyer-Chammard 2025-09-03 18:04:37 -07:00 committed by GitHub
parent 77f286f3ed
commit d014f30a96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 177 additions and 120 deletions

View File

@ -26,9 +26,9 @@
#include "Svc/Subtopologies/DataProducts/SubtopologyTopologyDefs.hpp" #include "Svc/Subtopologies/DataProducts/SubtopologyTopologyDefs.hpp"
#include "Svc/Subtopologies/FileHandling/SubtopologyTopologyDefs.hpp" #include "Svc/Subtopologies/FileHandling/SubtopologyTopologyDefs.hpp"
//ComCcsds Enum Includes // ComCcsds Enum Includes
#include "Svc/Subtopologies/ComCcsds/Ports_ComPacketQueueEnumAc.hpp"
#include "Svc/Subtopologies/ComCcsds/Ports_ComBufferQueueEnumAc.hpp" #include "Svc/Subtopologies/ComCcsds/Ports_ComBufferQueueEnumAc.hpp"
#include "Svc/Subtopologies/ComCcsds/Ports_ComPacketQueueEnumAc.hpp"
/** /**
* \brief required ping constants * \brief required ping constants
@ -50,34 +50,46 @@
* ``` * ```
*/ */
namespace PingEntries { namespace PingEntries {
namespace Ref_blockDrv {enum { WARN = 3, FATAL = 5 };} namespace Ref_blockDrv {
namespace Ref_pingRcvr {enum { WARN = 3, FATAL = 5 };} enum { WARN = 3, FATAL = 5 };
namespace Ref_rateGroup1Comp {enum { WARN = 3, FATAL = 5 };} }
namespace Ref_rateGroup2Comp {enum { WARN = 3, FATAL = 5 };} namespace Ref_pingRcvr {
namespace Ref_rateGroup3Comp {enum { WARN = 3, FATAL = 5 };} enum { WARN = 3, FATAL = 5 };
namespace Ref_cmdSeq {enum { WARN = 3, FATAL = 5 };} }
namespace Ref_rateGroup1Comp {
enum { WARN = 3, FATAL = 5 };
}
namespace Ref_rateGroup2Comp {
enum { WARN = 3, FATAL = 5 };
}
namespace Ref_rateGroup3Comp {
enum { WARN = 3, FATAL = 5 };
}
namespace Ref_cmdSeq {
enum { WARN = 3, FATAL = 5 };
}
} // namespace PingEntries } // namespace PingEntries
// Definitions are placed within a namespace named after the deployment // Definitions are placed within a namespace named after the deployment
namespace Ref { namespace Ref {
/** /**
* \brief required type definition to carry state * \brief required type definition to carry state
* *
* The topology autocoder requires an object that carries state with the name `Ref::TopologyState`. Only the type * The topology autocoder requires an object that carries state with the name `Ref::TopologyState`. Only the type
* definition is required by the autocoder and the contents of this object are otherwise opaque to the autocoder. The * definition is required by the autocoder and the contents of this object are otherwise opaque to the autocoder. The
* contents are entirely up to the definition of the project. This reference application specifies hostname and port * contents are entirely up to the definition of the project. This reference application specifies hostname and port
* fields, which are derived by command line inputs. * fields, which are derived by command line inputs.
*/ */
struct TopologyState { struct TopologyState {
const char* hostname; //!< Hostname for TCP communication const char* hostname; //!< Hostname for TCP communication
U16 port; //!< Port for TCP communication U16 port; //!< Port for TCP communication
CdhCore::SubtopologyState cdhCore; //!< Subtopology state for CdhCore CdhCore::SubtopologyState cdhCore; //!< Subtopology state for CdhCore
ComCcsds::SubtopologyState comCcsds; //!< Subtopology state for ComCcsds ComCcsds::SubtopologyState comCcsds; //!< Subtopology state for ComCcsds
DataProducts::SubtopologyState dataProducts; //!< Subtopology state for DataProducts DataProducts::SubtopologyState dataProducts; //!< Subtopology state for DataProducts
FileHandling::SubtopologyState fileHandling; //!< Subtopology state for FileHandling FileHandling::SubtopologyState fileHandling; //!< Subtopology state for FileHandling
}; };
namespace PingEntries = ::PingEntries; namespace PingEntries = ::PingEntries;
} // namespace Ref } // namespace Ref
#endif #endif

View File

@ -1,38 +1,37 @@
{ {
"Svc.ActiveRateGroup" : "Ref.rateGroup1Comp", "Svc.ActiveRateGroup": "Ref.rateGroup1Comp",
"Svc.CommandDispatcher" : "CdhCore.cmdDisp", "Svc.CommandDispatcher": "CdhCore.cmdDisp",
"Svc.CmdSequencer" : "Ref.cmdSeq", "Svc.CmdSequencer": "Ref.cmdSeq",
"Svc.FileDownlink" : "FileHandling.fileDownlink", "Svc.FileDownlink": "FileHandling.fileDownlink",
"Svc.FileManager" : "FileHandling.fileManager", "Svc.FileManager": "FileHandling.fileManager",
"Svc.FileUplink" : "Ref.fileUplink", "Svc.FileUplink": "Ref.fileUplink",
"Ref.PingReceiver" : "Ref.pingRcvr", "Ref.PingReceiver": "Ref.pingRcvr",
"Svc.EventManager" : "CdhCore.events", "Svc.EventManager": "CdhCore.events",
"Svc.TlmChan" : "Ref.tlmSend", "Svc.TlmChan": "Ref.tlmSend",
"Svc.PrmDb" : "FileHandling.prmDb", "Svc.PrmDb": "FileHandling.prmDb",
"Svc.PrmDb.filename" : "/tmp/PrmDb.dat", "Svc.PrmDb.filename": "/tmp/PrmDb.dat",
"Svc.DpCatalog" : "DataProducts.dpCat", "Svc.DpCatalog": "DataProducts.dpCat",
"Svc.DpManager" : "DataProducts.dpMgr", "Svc.DpManager": "DataProducts.dpMgr",
"Svc.DpWriter" : "DataProducts.dpWriter", "Svc.DpWriter": "DataProducts.dpWriter",
"Svc.ComQueue" : "Ref.comQueue", "Svc.ComQueue": "Ref.comQueue",
"Ref.TypeDemo" : "Ref.typeDemo", "Ref.TypeDemo": "Ref.typeDemo",
"Svc.Health" : "CdhCore.health", "Svc.Health": "CdhCore.health",
"Ref.SignalGen" : "Ref.SG1", "Ref.SignalGen": "Ref.SG1",
"Ref.SendBuff" : "Ref.sendBuffComp", "Ref.SendBuff": "Ref.sendBuffComp",
"Drv.TcpClient" : "Ref.comDriver", "Drv.TcpClient": "Ref.comDriver",
"Svc.AssertFatalAdapter" : "Ref.fatalAdapter", "Svc.AssertFatalAdapter": "Ref.fatalAdapter",
"Svc.FatalHandler" : "Ref.fatalHandler", "Svc.FatalHandler": "Ref.fatalHandler",
"Svc.BufferManager" : "Ref.commsBufferManager", "Svc.BufferManager": "Ref.commsBufferManager",
"Svc.PosixTime" : "Ref.posixTime", "Svc.PosixTime": "Ref.posixTime",
"Svc.RateGroupDriver" : "Ref.rateGroupDriverComp", "Svc.RateGroupDriver": "Ref.rateGroupDriverComp",
"Ref.RecvBuff" : "Ref.recvBuffComp", "Ref.RecvBuff": "Ref.recvBuffComp",
"Svc.Version" : "CdhCore.version", "Svc.Version": "CdhCore.version",
"Svc.PassiveTextLogger" : "Ref.textLogger", "Svc.PassiveTextLogger": "Ref.textLogger",
"Svc.SystemResources" : "Ref.systemResources", "Svc.SystemResources": "Ref.systemResources",
"Svc.BufferManager" : "Ref.dpBufferManager", "Svc.BufferManager": "Ref.dpBufferManager",
"Svc.FrameAccumulator" : "Ref.frameAccumulator", "Svc.FrameAccumulator": "Ref.frameAccumulator",
"Svc.FprimeDeframer" : "Ref.deframer", "Svc.FprimeDeframer": "Ref.deframer",
"Svc.FprimeRouter" : "Ref.fprimeRouter", "Svc.FprimeRouter": "Ref.fprimeRouter",
"Svc.FprimeFramer" : "Ref.fprimeFramer", "Svc.FprimeFramer": "Ref.framer",
"Svc.ComStub" : "Ref.comStub" "Svc.ComStub": "Ref.comStub"
} }

View File

@ -90,21 +90,35 @@ module ComCcsds {
""" """
} }
instance fprimeRouter: Svc.FprimeRouter base id ComCcsdsConfig.BASE_ID + 0x03000 \ instance fprimeRouter: Svc.FprimeRouter base id ComCcsdsConfig.BASE_ID + 0x03000
instance comStub: Svc.ComStub base id ComCcsdsConfig.BASE_ID + 0x04000 \ instance tcDeframer: Svc.Ccsds.TcDeframer base id ComCcsdsConfig.BASE_ID + 0x04000
instance tcDeframer: Svc.Ccsds.TcDeframer base id ComCcsdsConfig.BASE_ID + 0x05000 \ instance spacePacketDeframer: Svc.Ccsds.SpacePacketDeframer base id ComCcsdsConfig.BASE_ID + 0x05000
# NOTE: name 'framer' is used for the framer that connects to the Com Adapter Interface for better subtopology interoperability
instance framer: Svc.Ccsds.TmFramer base id ComCcsdsConfig.BASE_ID + 0x06000
instance spacePacketDeframer: Svc.Ccsds.SpacePacketDeframer base id ComCcsdsConfig.BASE_ID + 0x06000 \ instance spacePacketFramer: Svc.Ccsds.SpacePacketFramer base id ComCcsdsConfig.BASE_ID + 0x07000
instance tmFramer: Svc.Ccsds.TmFramer base id ComCcsdsConfig.BASE_ID + 0x07000 \ instance apidManager: Svc.Ccsds.ApidManager base id ComCcsdsConfig.BASE_ID + 0x08000
instance spacePacketFramer: Svc.Ccsds.SpacePacketFramer base id ComCcsdsConfig.BASE_ID + 0x08000 \ instance comStub: Svc.ComStub base id ComCcsdsConfig.BASE_ID + 0x09000
topology FramingSubtopology {
# Usage Note:
#
# When importing this subtopology, users shall establish 5 port connections with a component implementing
# the Svc.Com (Svc/Interfaces/Com.fpp) interface. They are as follows:
#
# 1) Outputs:
# - ComCcsds.framer.dataOut -> [Svc.Com].dataIn
# - ComCcsds.frameAccumulator.dataReturnOut -> [Svc.Com].dataReturnIn
# 2) Inputs:
# - [Svc.Com].dataReturnOut -> ComCcsds.framer.dataReturnIn
# - [Svc.Com].comStatusOut -> ComCcsds.framer.comStatusIn
# - [Svc.Com].dataOut -> ComCcsds.frameAccumulator.dataIn
instance apidManager: Svc.Ccsds.ApidManager base id ComCcsdsConfig.BASE_ID + 0x09000 \
topology Subtopology {
# Active Components # Active Components
instance comQueue instance comQueue
@ -112,16 +126,13 @@ module ComCcsds {
instance commsBufferManager instance commsBufferManager
instance frameAccumulator instance frameAccumulator
instance fprimeRouter instance fprimeRouter
instance comStub
instance tcDeframer instance tcDeframer
instance spacePacketDeframer instance spacePacketDeframer
instance tmFramer instance framer
instance spacePacketFramer instance spacePacketFramer
instance apidManager instance apidManager
connections Downlink { connections Downlink {
# ComQueue <-> SpacePacketFramer # ComQueue <-> SpacePacketFramer
comQueue.dataOut -> spacePacketFramer.dataIn comQueue.dataOut -> spacePacketFramer.dataIn
spacePacketFramer.dataReturnOut -> comQueue.dataReturnIn spacePacketFramer.dataReturnOut -> comQueue.dataReturnIn
@ -130,27 +141,22 @@ module ComCcsds {
spacePacketFramer.bufferDeallocate -> commsBufferManager.bufferSendIn spacePacketFramer.bufferDeallocate -> commsBufferManager.bufferSendIn
spacePacketFramer.getApidSeqCount -> apidManager.getApidSeqCountIn spacePacketFramer.getApidSeqCount -> apidManager.getApidSeqCountIn
# SpacePacketFramer <-> TmFramer # SpacePacketFramer <-> TmFramer
spacePacketFramer.dataOut -> tmFramer.dataIn spacePacketFramer.dataOut -> framer.dataIn
tmFramer.dataReturnOut -> spacePacketFramer.dataReturnIn framer.dataReturnOut -> spacePacketFramer.dataReturnIn
# Framer <-> ComStub
tmFramer.dataOut -> comStub.dataIn
comStub.dataReturnOut -> tmFramer.dataReturnIn
# ComStatus # ComStatus
comStub.comStatusOut -> tmFramer.comStatusIn framer.comStatusOut -> spacePacketFramer.comStatusIn
tmFramer.comStatusOut -> spacePacketFramer.comStatusIn spacePacketFramer.comStatusOut -> comQueue.comStatusIn
spacePacketFramer.comStatusOut -> comQueue.comStatusIn # (Outgoing) Framer <-> ComInterface connections shall be established by the user
} }
connections Uplink { connections Uplink {
# ComStub <-> FrameAccumulator # (Incoming) ComInterface <-> FrameAccumulator connections shall be established by the user
comStub.dataOut -> frameAccumulator.dataIn
frameAccumulator.dataReturnOut -> comStub.dataReturnIn
# FrameAccumulator buffer allocations # FrameAccumulator buffer allocations
frameAccumulator.bufferDeallocate -> commsBufferManager.bufferSendIn frameAccumulator.bufferDeallocate -> commsBufferManager.bufferSendIn
frameAccumulator.bufferAllocate -> commsBufferManager.bufferGetCallee frameAccumulator.bufferAllocate -> commsBufferManager.bufferGetCallee
# FrameAccumulator <-> Deframer # FrameAccumulator <-> TcDeframer
frameAccumulator.dataOut -> tcDeframer.dataIn frameAccumulator.dataOut -> tcDeframer.dataIn
tcDeframer.dataReturnOut -> frameAccumulator.dataReturnIn tcDeframer.dataReturnOut -> frameAccumulator.dataReturnIn
# TcDeframer <-> SpacePacketDeframer # TcDeframer <-> SpacePacketDeframer
tcDeframer.dataOut -> spacePacketDeframer.dataIn tcDeframer.dataOut -> spacePacketDeframer.dataIn
spacePacketDeframer.dataReturnOut -> tcDeframer.dataReturnIn spacePacketDeframer.dataReturnOut -> tcDeframer.dataReturnIn
@ -162,8 +168,25 @@ module ComCcsds {
# Router buffer allocations # Router buffer allocations
fprimeRouter.bufferAllocate -> commsBufferManager.bufferGetCallee fprimeRouter.bufferAllocate -> commsBufferManager.bufferGetCallee
fprimeRouter.bufferDeallocate -> commsBufferManager.bufferSendIn fprimeRouter.bufferDeallocate -> commsBufferManager.bufferSendIn
} }
} # end FramingSubtopology
} # end topology # This subtopology uses FramingSubtopology with a ComStub component for Com Interface
} # end ComCcsds Subtopology topology Subtopology {
import FramingSubtopology
instance comStub
connections ComStub {
# Framer <-> ComStub (Downlink)
ComCcsds.framer.dataOut -> comStub.dataIn
comStub.dataReturnOut -> ComCcsds.framer.dataReturnIn
comStub.comStatusOut -> ComCcsds.framer.comStatusIn
# ComStub <-> FrameAccumulator (Uplink)
comStub.dataOut -> ComCcsds.frameAccumulator.dataIn
ComCcsds.frameAccumulator.dataReturnOut -> comStub.dataReturnIn
}
} # end Subtopology
} # end ComCcsds

View File

@ -86,15 +86,28 @@ module ComFprime {
""" """
} }
instance deframer: Svc.FprimeDeframer base id ComFprimeConfig.BASE_ID + 0x03000 \ instance deframer: Svc.FprimeDeframer base id ComFprimeConfig.BASE_ID + 0x03000
instance fprimeFramer: Svc.FprimeFramer base id ComFprimeConfig.BASE_ID + 0x04000 \ instance framer: Svc.FprimeFramer base id ComFprimeConfig.BASE_ID + 0x04000
instance fprimeRouter: Svc.FprimeRouter base id ComFprimeConfig.BASE_ID + 0x05000 \ instance fprimeRouter: Svc.FprimeRouter base id ComFprimeConfig.BASE_ID + 0x05000
instance comStub: Svc.ComStub base id ComFprimeConfig.BASE_ID + 0x06000 \ instance comStub: Svc.ComStub base id ComFprimeConfig.BASE_ID + 0x06000
topology FramingSubtopology {
# Usage Note:
#
# When importing this subtopology, users shall establish 5 port connections with a component implementing
# the Svc.Com (Svc/Interfaces/Com.fpp) interface. They are as follows:
#
# 1) Outputs:
# - ComFprime.framer.dataOut -> [Svc.Com].dataIn
# - ComFprime.frameAccumulator.dataReturnOut -> [Svc.Com].dataReturnIn
# 2) Inputs:
# - [Svc.Com].dataReturnOut -> ComFprime.framer.dataReturnIn
# - [Svc.Com].comStatusOut -> ComFprime.framer.comStatusIn
# - [Svc.Com].dataOut -> ComFprime.frameAccumulator.dataIn
topology Subtopology {
# Active Components # Active Components
instance comQueue instance comQueue
@ -102,31 +115,23 @@ module ComFprime {
instance commsBufferManager instance commsBufferManager
instance frameAccumulator instance frameAccumulator
instance deframer instance deframer
instance fprimeFramer instance framer
instance fprimeRouter instance fprimeRouter
instance comStub
connections Downlink { connections Downlink {
# Inputs to ComQueue (events, telemetry)
# ComQueue <-> Framer # ComQueue <-> Framer
comQueue.dataOut -> fprimeFramer.dataIn comQueue.dataOut -> framer.dataIn
fprimeFramer.dataReturnOut -> comQueue.dataReturnIn framer.dataReturnOut -> comQueue.dataReturnIn
# Buffer Management for Framer # Buffer Management for Framer
fprimeFramer.bufferAllocate -> commsBufferManager.bufferGetCallee framer.bufferAllocate -> commsBufferManager.bufferGetCallee
fprimeFramer.bufferDeallocate -> commsBufferManager.bufferSendIn framer.bufferDeallocate -> commsBufferManager.bufferSendIn
# Framer <-> ComStub # ComStatus passback
fprimeFramer.dataOut -> comStub.dataIn framer.comStatusOut -> comQueue.comStatusIn
comStub.dataReturnOut -> fprimeFramer.dataReturnIn # (Outgoing) Framer <-> ComInterface connections shall be established by the user
# ComStatus
comStub.comStatusOut -> fprimeFramer.comStatusIn
fprimeFramer.comStatusOut -> comQueue.comStatusIn
} }
connections Uplink { connections Uplink {
# ComStub <-> FrameAccumulator # (Incoming) ComInterface <-> FrameAccumulator connections shall be established by the user
comStub.dataOut -> frameAccumulator.dataIn
frameAccumulator.dataReturnOut -> comStub.dataReturnIn
# FrameAccumulator buffer allocations # FrameAccumulator buffer allocations
frameAccumulator.bufferDeallocate -> commsBufferManager.bufferSendIn frameAccumulator.bufferDeallocate -> commsBufferManager.bufferSendIn
frameAccumulator.bufferAllocate -> commsBufferManager.bufferGetCallee frameAccumulator.bufferAllocate -> commsBufferManager.bufferGetCallee
@ -140,7 +145,25 @@ module ComFprime {
fprimeRouter.bufferAllocate -> commsBufferManager.bufferGetCallee fprimeRouter.bufferAllocate -> commsBufferManager.bufferGetCallee
fprimeRouter.bufferDeallocate -> commsBufferManager.bufferSendIn fprimeRouter.bufferDeallocate -> commsBufferManager.bufferSendIn
} }
} # end FramingSubtopology
} # end topology # This subtopology uses FramingSubtopology with a ComStub component for Com Interface
} # end ComFprime Subtopology topology Subtopology {
import FramingSubtopology
instance comStub
connections ComStub {
# Framer <-> ComStub (Downlink)
ComFprime.framer.dataOut -> comStub.dataIn
comStub.dataReturnOut -> ComFprime.framer.dataReturnIn
comStub.comStatusOut -> ComFprime.framer.comStatusIn
# ComStub <-> FrameAccumulator (Uplink)
comStub.dataOut -> ComFprime.frameAccumulator.dataIn
ComFprime.frameAccumulator.dataReturnOut -> comStub.dataReturnIn
}
} # end Subtopology
} # end ComFprime