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/FileHandling/SubtopologyTopologyDefs.hpp"
//ComCcsds Enum Includes
#include "Svc/Subtopologies/ComCcsds/Ports_ComPacketQueueEnumAc.hpp"
// ComCcsds Enum Includes
#include "Svc/Subtopologies/ComCcsds/Ports_ComBufferQueueEnumAc.hpp"
#include "Svc/Subtopologies/ComCcsds/Ports_ComPacketQueueEnumAc.hpp"
/**
* \brief required ping constants
@ -50,34 +50,46 @@
* ```
*/
namespace PingEntries {
namespace Ref_blockDrv {enum { WARN = 3, FATAL = 5 };}
namespace Ref_pingRcvr {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 Ref_blockDrv {
enum { WARN = 3, FATAL = 5 };
}
namespace Ref_pingRcvr {
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
// Definitions are placed within a namespace named after the deployment
namespace Ref {
/**
* \brief required type definition to carry state
*
* 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
* 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.
*/
struct TopologyState {
const char* hostname; //!< Hostname for TCP communication
U16 port; //!< Port for TCP communication
CdhCore::SubtopologyState cdhCore; //!< Subtopology state for CdhCore
ComCcsds::SubtopologyState comCcsds; //!< Subtopology state for ComCcsds
DataProducts::SubtopologyState dataProducts; //!< Subtopology state for DataProducts
FileHandling::SubtopologyState fileHandling; //!< Subtopology state for FileHandling
};
/**
* \brief required type definition to carry state
*
* 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
* 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.
*/
struct TopologyState {
const char* hostname; //!< Hostname for TCP communication
U16 port; //!< Port for TCP communication
CdhCore::SubtopologyState cdhCore; //!< Subtopology state for CdhCore
ComCcsds::SubtopologyState comCcsds; //!< Subtopology state for ComCcsds
DataProducts::SubtopologyState dataProducts; //!< Subtopology state for DataProducts
FileHandling::SubtopologyState fileHandling; //!< Subtopology state for FileHandling
};
namespace PingEntries = ::PingEntries;
namespace PingEntries = ::PingEntries;
} // namespace Ref
#endif

View File

@ -99,6 +99,6 @@ module Ref {
instance linuxTimer: Svc.LinuxTimer base id 0x10024000
instance comDriver: Drv.TcpClient base id 0x10025000
instance comDriver: Drv.TcpClient base id 0x10025000
}

View File

@ -20,7 +20,7 @@ module Ref {
import ComCcsds.Subtopology
import FileHandling.Subtopology
import DataProducts.Subtopology
# ----------------------------------------------------------------------
# Instances used in the topology
# ----------------------------------------------------------------------

View File

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

View File

@ -19,4 +19,4 @@ add_custom_target(
Svc_Subtopologies_DataProducts
Svc_Subtopologies_DataProducts_DataProductsConfig
Svc_Subtopologies_ComLoggerTee
)
)

View File

@ -90,21 +90,35 @@ module ComCcsds {
"""
}
instance fprimeRouter: Svc.FprimeRouter base id ComCcsdsConfig.BASE_ID + 0x03000 \
instance comStub: Svc.ComStub base id ComCcsdsConfig.BASE_ID + 0x04000 \
instance fprimeRouter: Svc.FprimeRouter base id ComCcsdsConfig.BASE_ID + 0x03000
instance tcDeframer: Svc.Ccsds.TcDeframer base id ComCcsdsConfig.BASE_ID + 0x05000 \
instance tcDeframer: Svc.Ccsds.TcDeframer base id ComCcsdsConfig.BASE_ID + 0x04000
instance spacePacketDeframer: Svc.Ccsds.SpacePacketDeframer base id ComCcsdsConfig.BASE_ID + 0x06000 \
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 tmFramer: Svc.Ccsds.TmFramer base id ComCcsdsConfig.BASE_ID + 0x07000 \
instance spacePacketFramer: Svc.Ccsds.SpacePacketFramer base id ComCcsdsConfig.BASE_ID + 0x07000
instance spacePacketFramer: Svc.Ccsds.SpacePacketFramer base id ComCcsdsConfig.BASE_ID + 0x08000 \
instance apidManager: Svc.Ccsds.ApidManager 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
instance comQueue
@ -112,16 +126,13 @@ module ComCcsds {
instance commsBufferManager
instance frameAccumulator
instance fprimeRouter
instance comStub
instance tcDeframer
instance spacePacketDeframer
instance tmFramer
instance framer
instance spacePacketFramer
instance apidManager
connections Downlink {
# ComQueue <-> SpacePacketFramer
comQueue.dataOut -> spacePacketFramer.dataIn
spacePacketFramer.dataReturnOut -> comQueue.dataReturnIn
@ -130,27 +141,22 @@ module ComCcsds {
spacePacketFramer.bufferDeallocate -> commsBufferManager.bufferSendIn
spacePacketFramer.getApidSeqCount -> apidManager.getApidSeqCountIn
# SpacePacketFramer <-> TmFramer
spacePacketFramer.dataOut -> tmFramer.dataIn
tmFramer.dataReturnOut -> spacePacketFramer.dataReturnIn
# Framer <-> ComStub
tmFramer.dataOut -> comStub.dataIn
comStub.dataReturnOut -> tmFramer.dataReturnIn
spacePacketFramer.dataOut -> framer.dataIn
framer.dataReturnOut -> spacePacketFramer.dataReturnIn
# ComStatus
comStub.comStatusOut -> tmFramer.comStatusIn
tmFramer.comStatusOut -> spacePacketFramer.comStatusIn
spacePacketFramer.comStatusOut -> comQueue.comStatusIn
framer.comStatusOut -> spacePacketFramer.comStatusIn
spacePacketFramer.comStatusOut -> comQueue.comStatusIn
# (Outgoing) Framer <-> ComInterface connections shall be established by the user
}
connections Uplink {
# ComStub <-> FrameAccumulator
comStub.dataOut -> frameAccumulator.dataIn
frameAccumulator.dataReturnOut -> comStub.dataReturnIn
# (Incoming) ComInterface <-> FrameAccumulator connections shall be established by the user
# FrameAccumulator buffer allocations
frameAccumulator.bufferDeallocate -> commsBufferManager.bufferSendIn
frameAccumulator.bufferAllocate -> commsBufferManager.bufferGetCallee
# FrameAccumulator <-> Deframer
frameAccumulator.dataOut -> tcDeframer.dataIn
tcDeframer.dataReturnOut -> frameAccumulator.dataReturnIn
# FrameAccumulator <-> TcDeframer
frameAccumulator.dataOut -> tcDeframer.dataIn
tcDeframer.dataReturnOut -> frameAccumulator.dataReturnIn
# TcDeframer <-> SpacePacketDeframer
tcDeframer.dataOut -> spacePacketDeframer.dataIn
spacePacketDeframer.dataReturnOut -> tcDeframer.dataReturnIn
@ -162,8 +168,25 @@ module ComCcsds {
# Router buffer allocations
fprimeRouter.bufferAllocate -> commsBufferManager.bufferGetCallee
fprimeRouter.bufferDeallocate -> commsBufferManager.bufferSendIn
}
} # end FramingSubtopology
} # end topology
} # end ComCcsds Subtopology
# This subtopology uses FramingSubtopology with a ComStub component for Com Interface
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 comStub: Svc.ComStub base id ComFprimeConfig.BASE_ID + 0x06000 \
instance fprimeRouter: Svc.FprimeRouter base id ComFprimeConfig.BASE_ID + 0x05000
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
instance comQueue
@ -102,31 +115,23 @@ module ComFprime {
instance commsBufferManager
instance frameAccumulator
instance deframer
instance fprimeFramer
instance framer
instance fprimeRouter
instance comStub
connections Downlink {
# Inputs to ComQueue (events, telemetry)
# ComQueue <-> Framer
comQueue.dataOut -> fprimeFramer.dataIn
fprimeFramer.dataReturnOut -> comQueue.dataReturnIn
comQueue.dataOut -> framer.dataIn
framer.dataReturnOut -> comQueue.dataReturnIn
# Buffer Management for Framer
fprimeFramer.bufferAllocate -> commsBufferManager.bufferGetCallee
fprimeFramer.bufferDeallocate -> commsBufferManager.bufferSendIn
# Framer <-> ComStub
fprimeFramer.dataOut -> comStub.dataIn
comStub.dataReturnOut -> fprimeFramer.dataReturnIn
# ComStatus
comStub.comStatusOut -> fprimeFramer.comStatusIn
fprimeFramer.comStatusOut -> comQueue.comStatusIn
framer.bufferAllocate -> commsBufferManager.bufferGetCallee
framer.bufferDeallocate -> commsBufferManager.bufferSendIn
# ComStatus passback
framer.comStatusOut -> comQueue.comStatusIn
# (Outgoing) Framer <-> ComInterface connections shall be established by the user
}
connections Uplink {
# ComStub <-> FrameAccumulator
comStub.dataOut -> frameAccumulator.dataIn
frameAccumulator.dataReturnOut -> comStub.dataReturnIn
# (Incoming) ComInterface <-> FrameAccumulator connections shall be established by the user
# FrameAccumulator buffer allocations
frameAccumulator.bufferDeallocate -> commsBufferManager.bufferSendIn
frameAccumulator.bufferAllocate -> commsBufferManager.bufferGetCallee
@ -140,7 +145,25 @@ module ComFprime {
fprimeRouter.bufferAllocate -> commsBufferManager.bufferGetCallee
fprimeRouter.bufferDeallocate -> commsBufferManager.bufferSendIn
}
} # end FramingSubtopology
} # end topology
} # end ComFprime Subtopology
# This subtopology uses FramingSubtopology with a ComStub component for Com Interface
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