mirror of
https://github.com/nasa/fprime.git
synced 2025-12-10 00:44:37 -06:00
Add Core Subtopologies: ComFprime, ComCcsds, DataProducts, FileHandling (#3768)
* Added led-blinker workflow for aarch64-linux platform * Update runner label * Added Tags to RPI self hosted workflows, sparse-checkout-cone-mode false * Add subtopologies to Svc/ restructing of Ref to include CDH subtopology * CDHCore Subtopology added under Svc and integrated into Ref * Health instance within CDHCore references CDHCoreConfig for queue size * Update metadata check-spelling run (push) for add-subtopologies Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com> on-behalf-of: @check-spelling <check-spelling-bot@check-spelling.dev> * Added AssertFatalAdapter Version PassiveTextLogger to Subtopology, config clarity improvements * Comms subtopology without cmdSeq created, integrated in Ref * Added cmdSeq to Comms Subtopology, integrated into Ref * Add FileHandling Subtopology, initial structure * Fixed Spelling, Flie -> File * Update metadata check-spelling run (push) for add-subtopologies Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com> on-behalf-of: @check-spelling <check-spelling-bot@check-spelling.dev> * Added working FileHandling, DataProducts subtopology, integrated into Ref * prmDb part of FileHandling, fatalHandler part of CDHCore * Update metadata check-spelling run (push) for add-subtopologies Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com> on-behalf-of: @check-spelling <check-spelling-bot@check-spelling.dev> * Update comment for clarity * Initial move to phasing components * Fixing Phasing: Adding initial Phasing for CDHCore, DataProducts, FileHandling * Renaming topologydefs.hpp, phasing fully working on all four subtopologies, needs cleaning up * Cleanup with Ports_ComPacketQueue, definition only in Comms.fpp now * Base project with all 4 subtopologies, integrated into Ref, and passing CI * Initial Commit with all Subtopologies in Svc/Subtopologies * Added posixtime back in to Ref Deployment (Accidentally Deleted) * Updates to match new subtopology structure, integrate CCSDS into Ref * Changes to CommCCSDS that go with last changes * Standardize subtopology structure and naming to PascalCase * Namespace fixe for ComFprime * CDHCore->Cdhcore for consistency * Rename CDHCore to CdhCore for consistency * Update metadata check-spelling run (pull_request_target) for add-subtopologies Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com> on-behalf-of: @check-spelling <check-spelling-bot@check-spelling.dev> * Reorder on teardown phases for Com Subtopolgies * Cpp check style fix * Fix: Add missing tearDownComponents cleanup for DataProducts dpBufferManager * Delete old comments, test using same mallocator for all subtopologies * fix: Deallocated DataProducts BufferMgr * Fix DataProducts subtopology memory cleanup * Fix: Dataproducts subtopology teardown order * Added tearDownComponents(state) * Consolidate all cleanup to teardowncomponents * Fix memory leaks: restore teardown phases * Removal of redundant teardowncomponents() * Revert "Removal of redundant teardowncomponents()" This reverts commit 29d4ff8242574f1afc1bb6aacdf5cfef4d79987d. * Fix formatting, remove commented out code * Swap hardcoded numbers to config constants in subtopologies * register_fprime_config() in config modules, isolated ComDriver into a separate config fpp file * Added explicit CMake Module Names and Depends between Subtopologies and their Configs * Fixed CCSDS case, more config constants * Added explicit depends for each subtopology config * added mallocator config, subtopology state structure * Update subtopology config names for clarity, fixes #3571 * Fix reference to dpBuffer config Constants --------- Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com> Co-authored-by: Moises Mata <moisesmata@users.noreply.github.com>
This commit is contained in:
parent
c602046f4b
commit
d69b7a10d1
13
.github/actions/spelling/expect.txt
vendored
13
.github/actions/spelling/expect.txt
vendored
@ -68,7 +68,7 @@ CCB
|
||||
CComponent
|
||||
ccsds
|
||||
ccsparc
|
||||
CDH
|
||||
cdh
|
||||
CDHCORE
|
||||
cerrno
|
||||
CFDP
|
||||
@ -95,6 +95,10 @@ CODEFILE
|
||||
COLORSTYLE
|
||||
colorwheel
|
||||
COMBUFFER
|
||||
COMCCSDS
|
||||
COMCCSDSSUBTOPOLOGY
|
||||
COMFPRIME
|
||||
COMFPRIMESUBTOPOLOGY
|
||||
comlogger
|
||||
COMMANDDISPATCHERIMPL
|
||||
COMMANDDISPATCHERIMPLCFG
|
||||
@ -133,6 +137,8 @@ ctu
|
||||
culates
|
||||
cuz
|
||||
CYCLEOUT
|
||||
DATAPRODUCTS
|
||||
DATAPRODUCTSSUBTOPOLOGY
|
||||
DATAROOTDIR
|
||||
DDDTHH
|
||||
Debian
|
||||
@ -213,11 +219,12 @@ ffff
|
||||
Ffs
|
||||
FILEDOWNLINK
|
||||
FILEDOWNLINKCFG
|
||||
FILEHANDLING
|
||||
FILEHANDLINGSUBTOPOLOGY
|
||||
FILEID
|
||||
FILEOPENERROR
|
||||
FILEWRITEERROR
|
||||
fio
|
||||
FLDP
|
||||
FNDELAY
|
||||
FONTPATH
|
||||
foodoodie
|
||||
@ -390,7 +397,6 @@ multitool
|
||||
mutexattr
|
||||
Mutexed
|
||||
mycompany
|
||||
NACI
|
||||
nasafprime
|
||||
nbits
|
||||
ncsl
|
||||
@ -451,7 +457,6 @@ PASSIVERATEGROUP
|
||||
PASSIVERATEGROUPIMPLTESTER
|
||||
patsubst
|
||||
pdflatex
|
||||
PEB
|
||||
penv
|
||||
PERLMOD
|
||||
PINGENTRIES
|
||||
|
||||
@ -82,8 +82,8 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
// Object for communicating state to the reference topology
|
||||
Ref::TopologyState inputs;
|
||||
inputs.hostname = hostname;
|
||||
inputs.port = port_number;
|
||||
inputs.comCcsds.hostname = hostname;
|
||||
inputs.comCcsds.port = port_number;
|
||||
|
||||
// Setup program shutdown via Ctrl-C
|
||||
signal(SIGINT, signalHandler);
|
||||
|
||||
@ -1,39 +1,44 @@
|
||||
telemetry packets RefPackets {
|
||||
|
||||
packet CDH id 1 group 1 {
|
||||
CDHCore.cmdDisp.CommandsDispatched
|
||||
CdhCore.cmdDisp.CommandsDispatched
|
||||
|
||||
FileHandling.fileUplink.FilesReceived
|
||||
FileHandling.fileUplink.PacketsReceived
|
||||
FileHandling.fileDownlink.FilesSent
|
||||
FileHandling.fileDownlink.PacketsSent
|
||||
FileHandling.fileManager.CommandsExecuted
|
||||
|
||||
ComCcsds.cmdSeq.CS_LoadCommands
|
||||
ComCcsds.cmdSeq.CS_CancelCommands
|
||||
ComCcsds.cmdSeq.CS_CommandsExecuted
|
||||
ComCcsds.cmdSeq.CS_SequencesCompleted
|
||||
ComCcsds.comQueue.comQueueDepth
|
||||
ComCcsds.comQueue.buffQueueDepth
|
||||
ComCcsds.commsBufferManager.TotalBuffs
|
||||
ComCcsds.commsBufferManager.CurrBuffs
|
||||
ComCcsds.commsBufferManager.HiBuffs
|
||||
#ComCcsds.tlmSend.SendLevel
|
||||
|
||||
Ref.rateGroup1Comp.RgMaxTime
|
||||
Ref.rateGroup2Comp.RgMaxTime
|
||||
Ref.rateGroup3Comp.RgMaxTime
|
||||
Ref.cmdSeq.CS_LoadCommands
|
||||
Ref.cmdSeq.CS_CancelCommands
|
||||
Ref.cmdSeq.CS_CommandsExecuted
|
||||
Ref.cmdSeq.CS_SequencesCompleted
|
||||
Ref.fileUplink.FilesReceived
|
||||
Ref.fileUplink.PacketsReceived
|
||||
Ref.commsBufferManager.TotalBuffs
|
||||
Ref.commsBufferManager.CurrBuffs
|
||||
Ref.commsBufferManager.HiBuffs
|
||||
Ref.fileDownlink.FilesSent
|
||||
Ref.fileDownlink.PacketsSent
|
||||
Ref.fileManager.CommandsExecuted
|
||||
Ref.comQueue.comQueueDepth
|
||||
Ref.comQueue.buffQueueDepth
|
||||
#CDHCore.tlmSend.SendLevel
|
||||
}
|
||||
|
||||
packet CDHErrors id 2 group 1 {
|
||||
CdhCore.$health.PingLateWarnings
|
||||
|
||||
FileHandling.fileUplink.Warnings
|
||||
FileHandling.fileDownlink.Warnings
|
||||
FileHandling.fileManager.Errors
|
||||
|
||||
ComCcsds.cmdSeq.CS_Errors
|
||||
ComCcsds.commsBufferManager.NoBuffs
|
||||
ComCcsds.commsBufferManager.EmptyBuffs
|
||||
|
||||
Ref.rateGroup1Comp.RgCycleSlips
|
||||
Ref.rateGroup2Comp.RgCycleSlips
|
||||
Ref.rateGroup3Comp.RgCycleSlips
|
||||
Ref.cmdSeq.CS_Errors
|
||||
Ref.fileUplink.Warnings
|
||||
Ref.fileDownlink.Warnings
|
||||
CDHCore.$health.PingLateWarnings
|
||||
Ref.fileManager.Errors
|
||||
Ref.commsBufferManager.NoBuffs
|
||||
Ref.commsBufferManager.EmptyBuffs
|
||||
Ref.fileManager.Errors
|
||||
}
|
||||
|
||||
packet DriveTlm id 3 group 1 {
|
||||
@ -175,94 +180,97 @@ telemetry packets RefPackets {
|
||||
}
|
||||
|
||||
packet DataProducts id 21 group 3 {
|
||||
Ref.dpCat.CatalogDps
|
||||
Ref.dpCat.DpsSent
|
||||
Ref.dpMgr.NumSuccessfulAllocations
|
||||
Ref.dpMgr.NumFailedAllocations
|
||||
Ref.dpMgr.NumDataProducts
|
||||
Ref.dpMgr.NumBytes
|
||||
Ref.dpWriter.NumBuffersReceived
|
||||
Ref.dpWriter.NumBytesWritten
|
||||
Ref.dpWriter.NumSuccessfulWrites
|
||||
Ref.dpWriter.NumFailedWrites
|
||||
Ref.dpWriter.NumErrors
|
||||
Ref.dpBufferManager.TotalBuffs
|
||||
Ref.dpBufferManager.CurrBuffs
|
||||
Ref.dpBufferManager.HiBuffs
|
||||
Ref.dpBufferManager.NoBuffs
|
||||
Ref.dpBufferManager.EmptyBuffs
|
||||
DataProducts.dpCat.CatalogDps
|
||||
DataProducts.dpCat.DpsSent
|
||||
|
||||
DataProducts.dpMgr.NumSuccessfulAllocations
|
||||
DataProducts.dpMgr.NumFailedAllocations
|
||||
DataProducts.dpMgr.NumDataProducts
|
||||
DataProducts.dpMgr.NumBytes
|
||||
|
||||
DataProducts.dpWriter.NumBuffersReceived
|
||||
DataProducts.dpWriter.NumBytesWritten
|
||||
DataProducts.dpWriter.NumSuccessfulWrites
|
||||
DataProducts.dpWriter.NumFailedWrites
|
||||
DataProducts.dpWriter.NumErrors
|
||||
|
||||
DataProducts.dpBufferManager.TotalBuffs
|
||||
DataProducts.dpBufferManager.CurrBuffs
|
||||
DataProducts.dpBufferManager.HiBuffs
|
||||
DataProducts.dpBufferManager.NoBuffs
|
||||
DataProducts.dpBufferManager.EmptyBuffs
|
||||
}
|
||||
|
||||
packet Version1 id 22 group 2 {
|
||||
CDHCore.version.FrameworkVersion
|
||||
CDHCore.version.ProjectVersion
|
||||
CdhCore.version.FrameworkVersion
|
||||
CdhCore.version.ProjectVersion
|
||||
}
|
||||
|
||||
packet Version_Library1 id 23 group 2 {
|
||||
CDHCore.version.LibraryVersion01
|
||||
CDHCore.version.LibraryVersion02
|
||||
CdhCore.version.LibraryVersion01
|
||||
CdhCore.version.LibraryVersion02
|
||||
}
|
||||
|
||||
packet Version_Library2 id 24 group 2 {
|
||||
CDHCore.version.LibraryVersion03
|
||||
CDHCore.version.LibraryVersion04
|
||||
CdhCore.version.LibraryVersion03
|
||||
CdhCore.version.LibraryVersion04
|
||||
}
|
||||
|
||||
packet Version_Library3 id 25 group 2 {
|
||||
CDHCore.version.LibraryVersion05
|
||||
CDHCore.version.LibraryVersion06
|
||||
CdhCore.version.LibraryVersion05
|
||||
CdhCore.version.LibraryVersion06
|
||||
}
|
||||
|
||||
packet Version_Library4 id 26 group 2 {
|
||||
CDHCore.version.LibraryVersion07
|
||||
CDHCore.version.LibraryVersion08
|
||||
CdhCore.version.LibraryVersion07
|
||||
CdhCore.version.LibraryVersion08
|
||||
}
|
||||
|
||||
packet Version_Library5 id 27 group 2 {
|
||||
CDHCore.version.LibraryVersion09
|
||||
CDHCore.version.LibraryVersion10
|
||||
CdhCore.version.LibraryVersion09
|
||||
CdhCore.version.LibraryVersion10
|
||||
}
|
||||
|
||||
packet Version_Custom1 id 28 group 2 {
|
||||
CDHCore.version.CustomVersion01
|
||||
CdhCore.version.CustomVersion01
|
||||
}
|
||||
|
||||
packet Version_Custom2 id 29 group 2 {
|
||||
CDHCore.version.CustomVersion02
|
||||
CdhCore.version.CustomVersion02
|
||||
}
|
||||
|
||||
packet Version_Custom3 id 30 group 2 {
|
||||
CDHCore.version.CustomVersion03
|
||||
CdhCore.version.CustomVersion03
|
||||
}
|
||||
|
||||
packet Version_Custom4 id 31 group 2 {
|
||||
CDHCore.version.CustomVersion04
|
||||
CdhCore.version.CustomVersion04
|
||||
}
|
||||
|
||||
packet Version_Custom5 id 32 group 2 {
|
||||
CDHCore.version.CustomVersion05
|
||||
CdhCore.version.CustomVersion05
|
||||
}
|
||||
|
||||
packet Version_Custom6 id 33 group 2 {
|
||||
CDHCore.version.CustomVersion06
|
||||
CdhCore.version.CustomVersion06
|
||||
}
|
||||
|
||||
packet Version_Custom7 id 34 group 2 {
|
||||
CDHCore.version.CustomVersion07
|
||||
CdhCore.version.CustomVersion07
|
||||
}
|
||||
|
||||
packet Version_Custom8 id 35 group 2 {
|
||||
CDHCore.version.CustomVersion08
|
||||
CdhCore.version.CustomVersion08
|
||||
}
|
||||
|
||||
packet Version_Custom9 id 36 group 2 {
|
||||
CDHCore.version.CustomVersion09
|
||||
CdhCore.version.CustomVersion09
|
||||
}
|
||||
|
||||
packet Version_Custom10 id 37 group 2 {
|
||||
CDHCore.version.CustomVersion10
|
||||
CdhCore.version.CustomVersion10
|
||||
}
|
||||
|
||||
} omit {
|
||||
CDHCore.cmdDisp.CommandErrors
|
||||
}
|
||||
CdhCore.cmdDisp.CommandErrors
|
||||
}
|
||||
|
||||
@ -14,8 +14,6 @@
|
||||
// Necessary project-specified types
|
||||
#include <Fw/Types/MallocAllocator.hpp>
|
||||
#include <Os/Console.hpp>
|
||||
#include <Svc/FrameAccumulator/FrameDetector/CcsdsTcFrameDetector.hpp>
|
||||
#include <Ref/Top/Ports_ComPacketQueueEnumAc.hpp>
|
||||
|
||||
// Used for 1Hz synthetic cycling
|
||||
#include <Os/Mutex.hpp>
|
||||
@ -26,14 +24,6 @@ using namespace Ref;
|
||||
// Instantiate a system logger that will handle Fw::Logger::log calls
|
||||
Os::Console logger;
|
||||
|
||||
// The reference topology uses a malloc-based allocator for components that need to allocate memory during the
|
||||
// initialization phase.
|
||||
Fw::MallocAllocator mallocator;
|
||||
|
||||
// The reference topology uses the F´ packet protocol when communicating with the ground and therefore uses the F´
|
||||
// framing and deframing implementations.
|
||||
Svc::FrameDetectors::CcsdsTcFrameDetector frameDetector;
|
||||
|
||||
// The reference topology divides the incoming clock signal (1Hz) into sub-signals: 1Hz, 1/2Hz, and 1/4Hz and
|
||||
// zero offset for all the dividers
|
||||
Svc::RateGroupDriver::DividerSet rateGroupDivisorsSet{{{1, 0}, {2, 0}, {4, 0}}};
|
||||
@ -44,28 +34,6 @@ U32 rateGroup1Context[Svc::ActiveRateGroup::CONNECTION_COUNT_MAX] = {};
|
||||
U32 rateGroup2Context[Svc::ActiveRateGroup::CONNECTION_COUNT_MAX] = {};
|
||||
U32 rateGroup3Context[Svc::ActiveRateGroup::CONNECTION_COUNT_MAX] = {};
|
||||
|
||||
Svc::ComQueue::QueueConfigurationTable configurationTable;
|
||||
|
||||
// A number of constants are needed for construction of the topology. These are specified here.
|
||||
enum TopologyConstants {
|
||||
CMD_SEQ_BUFFER_SIZE = 5 * 1024,
|
||||
FILE_DOWNLINK_TIMEOUT = 1000,
|
||||
FILE_DOWNLINK_COOLDOWN = 1000,
|
||||
FILE_DOWNLINK_CYCLE_TIME = 1000,
|
||||
FILE_DOWNLINK_FILE_QUEUE_DEPTH = 10,
|
||||
COMM_PRIORITY = 100,
|
||||
// Buffer manager for Uplink/Downlink
|
||||
COMMS_BUFFER_MANAGER_STORE_SIZE = 2048,
|
||||
COMMS_BUFFER_MANAGER_STORE_COUNT = 20,
|
||||
COMMS_BUFFER_MANAGER_FILE_STORE_SIZE = 3000,
|
||||
COMMS_BUFFER_MANAGER_FILE_QUEUE_SIZE = 30,
|
||||
COMMS_BUFFER_MANAGER_ID = 200,
|
||||
// Buffer manager for Data Products
|
||||
DP_BUFFER_MANAGER_STORE_SIZE = 10000,
|
||||
DP_BUFFER_MANAGER_STORE_COUNT = 10,
|
||||
DP_BUFFER_MANAGER_ID = 300,
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief configure/setup components in project-specific way
|
||||
*
|
||||
@ -74,9 +42,6 @@ enum TopologyConstants {
|
||||
* desired, but is extracted here for clarity.
|
||||
*/
|
||||
void configureTopology() {
|
||||
// Command sequencer needs to allocate memory to hold contents of command sequences
|
||||
cmdSeq.allocateBuffer(0, mallocator, CMD_SEQ_BUFFER_SIZE);
|
||||
|
||||
// Rate group driver needs a divisor list
|
||||
rateGroupDriverComp.configure(rateGroupDivisorsSet);
|
||||
|
||||
@ -84,53 +49,6 @@ void configureTopology() {
|
||||
rateGroup1Comp.configure(rateGroup1Context, FW_NUM_ARRAY_ELEMENTS(rateGroup1Context));
|
||||
rateGroup2Comp.configure(rateGroup2Context, FW_NUM_ARRAY_ELEMENTS(rateGroup2Context));
|
||||
rateGroup3Comp.configure(rateGroup3Context, FW_NUM_ARRAY_ELEMENTS(rateGroup3Context));
|
||||
|
||||
// File downlink requires some project-derived properties.
|
||||
fileDownlink.configure(FILE_DOWNLINK_TIMEOUT, FILE_DOWNLINK_COOLDOWN, FILE_DOWNLINK_CYCLE_TIME,
|
||||
FILE_DOWNLINK_FILE_QUEUE_DEPTH);
|
||||
|
||||
// Parameter database is configured with a database file name, and that file must be initially read.
|
||||
prmDb.configure("PrmDb.dat");
|
||||
prmDb.readParamFile();
|
||||
|
||||
// Buffer managers need a configured set of buckets and an allocator used to allocate memory for those buckets.
|
||||
Svc::BufferManager::BufferBins commsBuffMgrBins;
|
||||
memset(&commsBuffMgrBins, 0, sizeof(commsBuffMgrBins));
|
||||
commsBuffMgrBins.bins[0].bufferSize = COMMS_BUFFER_MANAGER_STORE_SIZE;
|
||||
commsBuffMgrBins.bins[0].numBuffers = COMMS_BUFFER_MANAGER_STORE_COUNT;
|
||||
commsBuffMgrBins.bins[1].bufferSize = COMMS_BUFFER_MANAGER_FILE_STORE_SIZE;
|
||||
commsBuffMgrBins.bins[1].numBuffers = COMMS_BUFFER_MANAGER_FILE_QUEUE_SIZE;
|
||||
commsBufferManager.setup(COMMS_BUFFER_MANAGER_ID, 0, mallocator, commsBuffMgrBins);
|
||||
|
||||
Svc::BufferManager::BufferBins dpBuffMgrBins;
|
||||
memset(&dpBuffMgrBins, 0, sizeof(dpBuffMgrBins));
|
||||
dpBuffMgrBins.bins[0].bufferSize = DP_BUFFER_MANAGER_STORE_SIZE;
|
||||
dpBuffMgrBins.bins[0].numBuffers = DP_BUFFER_MANAGER_STORE_COUNT;
|
||||
dpBufferManager.setup(DP_BUFFER_MANAGER_ID, 0, mallocator, dpBuffMgrBins);
|
||||
|
||||
frameAccumulator.configure(frameDetector, 1, mallocator, 2048);
|
||||
|
||||
Fw::FileNameString dpDir("./DpCat");
|
||||
Fw::FileNameString dpState("./DpCat/DpState.dat");
|
||||
|
||||
// create the DP directory if it doesn't exist
|
||||
Os::FileSystem::createDirectory(dpDir.toChar());
|
||||
|
||||
dpCat.configure(&dpDir,1,dpState,0,mallocator);
|
||||
dpWriter.configure(dpDir);
|
||||
|
||||
// ComQueue configuration
|
||||
// Events (highest-priority)
|
||||
configurationTable.entries[Ref::Ports_ComPacketQueue::EVENTS].depth = 100;
|
||||
configurationTable.entries[Ref::Ports_ComPacketQueue::EVENTS].priority = 0;
|
||||
// Telemetry
|
||||
configurationTable.entries[Ref::Ports_ComPacketQueue::TELEMETRY].depth = 500;
|
||||
configurationTable.entries[Ref::Ports_ComPacketQueue::TELEMETRY].priority = 2;
|
||||
// File Downlink (first entry after the ComPacket queues = NUM_CONSTANTS)
|
||||
configurationTable.entries[Ref::Ports_ComPacketQueue::NUM_CONSTANTS].depth = 100;
|
||||
configurationTable.entries[Ref::Ports_ComPacketQueue::NUM_CONSTANTS].priority = 1;
|
||||
// Allocation identifier is 0 as the MallocAllocator discards it
|
||||
comQueue.configure(configurationTable, 0, mallocator);
|
||||
}
|
||||
|
||||
// Public functions for use in main program are namespaced with deployment name Ref
|
||||
@ -146,21 +64,12 @@ void setupTopology(const TopologyState& state) {
|
||||
regCommands();
|
||||
// Autocoded configuration. Function provided by autocoder.
|
||||
configComponents(state);
|
||||
if (state.hostname != nullptr && state.port != 0) {
|
||||
comDriver.configure(state.hostname, state.port);
|
||||
}
|
||||
// Project-specific component configuration. Function provided above. May be inlined, if desired.
|
||||
configureTopology();
|
||||
// Autocoded parameter loading. Function provided by autocoder.
|
||||
loadParameters();
|
||||
// Autocoded task kick-off (active components). Function provided by autocoder.
|
||||
startTasks(state);
|
||||
// Initialize socket client communication if and only if there is a valid specification
|
||||
if (state.hostname != nullptr && state.port != 0) {
|
||||
Os::TaskString name("ReceiveTask");
|
||||
// Uplink is configured for receive so a socket task is started
|
||||
comDriver.start(name, COMM_PRIORITY, Default::STACK_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
void startRateGroups(Fw::TimeInterval interval) {
|
||||
@ -179,14 +88,6 @@ void teardownTopology(const TopologyState& state) {
|
||||
// Autocoded (active component) task clean-up. Functions provided by topology autocoder.
|
||||
stopTasks(state);
|
||||
freeThreads(state);
|
||||
|
||||
// Other task clean-up.
|
||||
comDriver.stop();
|
||||
(void)comDriver.join();
|
||||
|
||||
// Resource deallocation
|
||||
cmdSeq.deallocateBuffer(mallocator);
|
||||
commsBufferManager.cleanup();
|
||||
frameAccumulator.cleanup();
|
||||
tearDownComponents(state);
|
||||
}
|
||||
} // namespace Ref
|
||||
|
||||
@ -16,9 +16,24 @@
|
||||
#include "Ref/Top/FppConstantsAc.hpp"
|
||||
#include "Svc/Health/Health.hpp"
|
||||
|
||||
// Subtopology PingEntries includes
|
||||
#include "Svc/Subtopologies/CDHCore/PingEntries.hpp"
|
||||
// Subtopology PingEntries includes
|
||||
#include "Svc/Subtopologies/CdhCore/PingEntries.hpp"
|
||||
#include "Svc/Subtopologies/ComCcsds/PingEntries.hpp"
|
||||
#include "Svc/Subtopologies/DataProducts/PingEntries.hpp"
|
||||
#include "Svc/Subtopologies/FileHandling/PingEntries.hpp"
|
||||
|
||||
// SubtopologyTopologyDefs includes
|
||||
#include "Svc/Subtopologies/ComCcsds/SubtopologyTopologyDefs.hpp"
|
||||
#include "Svc/Subtopologies/DataProducts/SubtopologyTopologyDefs.hpp"
|
||||
#include "Svc/Subtopologies/FileHandling/SubtopologyTopologyDefs.hpp"
|
||||
|
||||
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 PingEntries
|
||||
/**
|
||||
* \brief required ping constants
|
||||
*
|
||||
@ -38,19 +53,6 @@
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
namespace PingEntries {
|
||||
namespace Ref_blockDrv {enum { WARN = 3, FATAL = 5 };}
|
||||
namespace Ref_cmdSeq {enum { WARN = 3, FATAL = 5 };}
|
||||
namespace Ref_fileDownlink {enum { WARN = 3, FATAL = 5 };}
|
||||
namespace Ref_fileManager {enum { WARN = 3, FATAL = 5 };}
|
||||
namespace Ref_fileUplink {enum { WARN = 3, FATAL = 5 };}
|
||||
namespace Ref_pingRcvr {enum { WARN = 3, FATAL = 5 };}
|
||||
namespace Ref_prmDb {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_dpCat {enum { WARN = 3, FATAL = 5 };}
|
||||
} // namespace PingEntries
|
||||
|
||||
// Definitions are placed within a namespace named after the deployment
|
||||
namespace Ref {
|
||||
@ -64,8 +66,7 @@ namespace Ref {
|
||||
* fields, which are derived by command line inputs.
|
||||
*/
|
||||
struct TopologyState {
|
||||
const char* hostname;
|
||||
U16 port;
|
||||
ComCcsds::SubtopologyState comCcsds; //!< Subtopology state for ComCcsds
|
||||
};
|
||||
|
||||
namespace PingEntries = ::PingEntries;
|
||||
|
||||
@ -33,58 +33,12 @@ module Ref {
|
||||
stack size Default.STACK_SIZE \
|
||||
priority 118
|
||||
|
||||
instance cmdSeq: Svc.CmdSequencer base id 0x0500 \
|
||||
instance pingRcvr: Ref.PingReceiver base id 0x0A00 \
|
||||
queue size Default.QUEUE_SIZE \
|
||||
stack size Default.STACK_SIZE \
|
||||
priority 100
|
||||
|
||||
instance fileDownlink: Svc.FileDownlink base id 0x0600 \
|
||||
queue size 30 \
|
||||
stack size Default.STACK_SIZE \
|
||||
priority 100
|
||||
|
||||
instance fileManager: Svc.FileManager base id 0x0700 \
|
||||
queue size 30 \
|
||||
stack size Default.STACK_SIZE \
|
||||
priority 100
|
||||
|
||||
instance fileUplink: Svc.FileUplink base id 0x0800 \
|
||||
queue size 30 \
|
||||
stack size Default.STACK_SIZE \
|
||||
priority 100
|
||||
|
||||
instance pingRcvr: Ref.PingReceiver base id 0x0900 \
|
||||
queue size Default.QUEUE_SIZE \
|
||||
stack size Default.STACK_SIZE \
|
||||
priority 100
|
||||
|
||||
instance prmDb: Svc.PrmDb base id 0x0A00 \
|
||||
queue size Default.QUEUE_SIZE \
|
||||
stack size Default.STACK_SIZE \
|
||||
priority 96
|
||||
|
||||
instance dpCat: Svc.DpCatalog base id 0x0B00 \
|
||||
queue size Default.QUEUE_SIZE \
|
||||
stack size Default.STACK_SIZE \
|
||||
priority 96
|
||||
|
||||
instance dpMgr: Svc.DpManager base id 0x0C00 \
|
||||
queue size Default.QUEUE_SIZE \
|
||||
stack size Default.STACK_SIZE \
|
||||
priority 96
|
||||
|
||||
instance dpWriter: Svc.DpWriter base id 0x0D00 \
|
||||
queue size Default.QUEUE_SIZE \
|
||||
stack size Default.STACK_SIZE \
|
||||
priority 96
|
||||
|
||||
# ComQueue has a deeper queue to be resilient to spikes in com throughput
|
||||
instance comQueue: Svc.ComQueue base id 0x0E00 \
|
||||
queue size 50 \
|
||||
stack size Default.STACK_SIZE \
|
||||
priority 100
|
||||
|
||||
instance typeDemo: Ref.TypeDemo base id 0x0F00
|
||||
instance typeDemo: Ref.TypeDemo base id 0x1200
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Queued component instances
|
||||
@ -112,11 +66,6 @@ module Ref {
|
||||
# Passive component instances
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
@ Communications driver. May be swapped with other comm drivers like UART
|
||||
instance comDriver: Drv.TcpClient base id 0x4100
|
||||
|
||||
instance commsBufferManager: Svc.BufferManager base id 0x4200
|
||||
|
||||
instance posixTime: Svc.PosixTime base id 0x4300
|
||||
|
||||
instance rateGroupDriverComp: Svc.RateGroupDriver base id 0x4400
|
||||
@ -125,25 +74,6 @@ module Ref {
|
||||
|
||||
instance systemResources: Svc.SystemResources base id 0x4600
|
||||
|
||||
instance dpBufferManager: Svc.BufferManager base id 0x4700
|
||||
|
||||
instance frameAccumulator: Svc.FrameAccumulator base id 0x4800
|
||||
|
||||
instance tcDeframer: Svc.Ccsds.TcDeframer base id 0x4900
|
||||
|
||||
instance spacePacketDeframer: Svc.Ccsds.SpacePacketDeframer base id 0x4A00
|
||||
|
||||
instance tmFramer: Svc.Ccsds.TmFramer base id 0x4B00
|
||||
|
||||
instance spacePacketFramer: Svc.Ccsds.SpacePacketFramer base id 0x4C00
|
||||
|
||||
instance fprimeRouter: Svc.FprimeRouter base id 0x4D00
|
||||
|
||||
instance apidManager: Svc.Ccsds.ApidManager base id 0x4E00
|
||||
|
||||
instance comStub: Svc.ComStub base id 0x4F00
|
||||
|
||||
instance linuxTimer: Svc.LinuxTimer base id 0x5000
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -10,21 +10,17 @@ module Ref {
|
||||
rateGroup3
|
||||
}
|
||||
|
||||
enum Ports_ComPacketQueue {
|
||||
EVENTS,
|
||||
TELEMETRY
|
||||
}
|
||||
|
||||
enum Ports_ComBufferQueue {
|
||||
FILE_DOWNLINK
|
||||
}
|
||||
|
||||
topology Ref {
|
||||
# ----------------------------------------------------------------------
|
||||
# Subtopology imports
|
||||
# ----------------------------------------------------------------------
|
||||
import CDHCore.Subtopology
|
||||
|
||||
import CdhCore.Subtopology
|
||||
import ComCcsds.Subtopology
|
||||
import FileHandling.Subtopology
|
||||
import DataProducts.Subtopology
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Instances used in the topology
|
||||
# ----------------------------------------------------------------------
|
||||
@ -35,53 +31,33 @@ module Ref {
|
||||
instance SG4
|
||||
instance SG5
|
||||
instance blockDrv
|
||||
instance cmdSeq
|
||||
instance comDriver
|
||||
instance comStub
|
||||
instance comQueue
|
||||
instance tcDeframer
|
||||
instance spacePacketDeframer
|
||||
instance tmFramer
|
||||
instance spacePacketFramer
|
||||
instance fileDownlink
|
||||
instance fileManager
|
||||
instance fileUplink
|
||||
instance commsBufferManager
|
||||
instance frameAccumulator
|
||||
instance apidManager
|
||||
instance posixTime
|
||||
instance pingRcvr
|
||||
instance prmDb
|
||||
instance rateGroup1Comp
|
||||
instance rateGroup2Comp
|
||||
instance rateGroup3Comp
|
||||
instance rateGroupDriverComp
|
||||
instance recvBuffComp
|
||||
instance fprimeRouter
|
||||
instance sendBuffComp
|
||||
instance typeDemo
|
||||
instance systemResources
|
||||
instance dpCat
|
||||
instance dpMgr
|
||||
instance dpWriter
|
||||
instance dpBufferManager
|
||||
instance linuxTimer
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Pattern graph specifiers
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
command connections instance CDHCore.cmdDisp
|
||||
command connections instance CdhCore.cmdDisp
|
||||
|
||||
event connections instance CDHCore.events
|
||||
event connections instance CdhCore.events
|
||||
|
||||
telemetry connections instance CDHCore.tlmSend
|
||||
telemetry connections instance CdhCore.tlmSend
|
||||
|
||||
health connections instance CDHCore.$health
|
||||
text event connections instance CdhCore.textLogger
|
||||
|
||||
text event connections instance CDHCore.textLogger
|
||||
health connections instance CdhCore.$health
|
||||
|
||||
param connections instance prmDb
|
||||
param connections instance FileHandling.prmDb
|
||||
|
||||
time connections instance posixTime
|
||||
|
||||
@ -95,38 +71,6 @@ module Ref {
|
||||
# Direct graph specifiers
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
connections Downlink {
|
||||
# Data Products
|
||||
dpCat.fileOut -> fileDownlink.SendFile
|
||||
fileDownlink.FileComplete -> dpCat.fileDone
|
||||
# Inputs to ComQueue (events, telemetry, file)
|
||||
CDHCore.events.PktSend -> comQueue.comPacketQueueIn[Ports_ComPacketQueue.EVENTS]
|
||||
CDHCore.tlmSend.PktSend -> comQueue.comPacketQueueIn[Ports_ComPacketQueue.TELEMETRY]
|
||||
fileDownlink.bufferSendOut -> comQueue.bufferQueueIn[Ports_ComBufferQueue.FILE_DOWNLINK]
|
||||
comQueue.bufferReturnOut[Ports_ComBufferQueue.FILE_DOWNLINK] -> fileDownlink.bufferReturn
|
||||
# ComQueue <-> SpacePacketFramer
|
||||
comQueue.dataOut -> spacePacketFramer.dataIn
|
||||
spacePacketFramer.dataReturnOut -> comQueue.dataReturnIn
|
||||
# SpacePacketFramer buffer and APID management
|
||||
spacePacketFramer.bufferAllocate -> commsBufferManager.bufferGetCallee
|
||||
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
|
||||
# ComStub <-> ComDriver
|
||||
comStub.drvSendOut -> comDriver.$send
|
||||
comDriver.sendReturnOut -> comStub.drvSendReturnIn
|
||||
comDriver.ready -> comStub.drvConnected
|
||||
# ComStatus
|
||||
comStub.comStatusOut -> tmFramer.comStatusIn
|
||||
tmFramer.comStatusOut -> spacePacketFramer.comStatusIn
|
||||
spacePacketFramer.comStatusOut -> comQueue.comStatusIn
|
||||
}
|
||||
|
||||
connections RateGroups {
|
||||
|
||||
# Linux timer to drive cycle
|
||||
@ -136,91 +80,72 @@ module Ref {
|
||||
rateGroupDriverComp.CycleOut[Ports_RateGroups.rateGroup1] -> rateGroup1Comp.CycleIn
|
||||
rateGroup1Comp.RateGroupMemberOut[0] -> SG1.schedIn
|
||||
rateGroup1Comp.RateGroupMemberOut[1] -> SG2.schedIn
|
||||
rateGroup1Comp.RateGroupMemberOut[2] -> CDHCore.tlmSend.Run
|
||||
rateGroup1Comp.RateGroupMemberOut[3] -> fileDownlink.Run
|
||||
rateGroup1Comp.RateGroupMemberOut[2] -> CdhCore.tlmSend.Run
|
||||
rateGroup1Comp.RateGroupMemberOut[3] -> FileHandling.fileDownlink.Run
|
||||
rateGroup1Comp.RateGroupMemberOut[4] -> systemResources.run
|
||||
rateGroup1Comp.RateGroupMemberOut[5] -> comQueue.run
|
||||
rateGroup1Comp.RateGroupMemberOut[5] -> ComCcsds.comQueue.run
|
||||
|
||||
# Rate group 2
|
||||
rateGroupDriverComp.CycleOut[Ports_RateGroups.rateGroup2] -> rateGroup2Comp.CycleIn
|
||||
rateGroup2Comp.RateGroupMemberOut[0] -> cmdSeq.schedIn
|
||||
rateGroup2Comp.RateGroupMemberOut[0] -> ComCcsds.cmdSeq.schedIn
|
||||
rateGroup2Comp.RateGroupMemberOut[1] -> sendBuffComp.SchedIn
|
||||
rateGroup2Comp.RateGroupMemberOut[2] -> SG3.schedIn
|
||||
rateGroup2Comp.RateGroupMemberOut[3] -> SG4.schedIn
|
||||
|
||||
# Rate group 3
|
||||
rateGroupDriverComp.CycleOut[Ports_RateGroups.rateGroup3] -> rateGroup3Comp.CycleIn
|
||||
rateGroup3Comp.RateGroupMemberOut[0] -> CDHCore.$health.Run
|
||||
rateGroup3Comp.RateGroupMemberOut[0] -> CdhCore.$health.Run
|
||||
rateGroup3Comp.RateGroupMemberOut[1] -> SG5.schedIn
|
||||
rateGroup3Comp.RateGroupMemberOut[2] -> blockDrv.Sched
|
||||
rateGroup3Comp.RateGroupMemberOut[3] -> commsBufferManager.schedIn
|
||||
rateGroup3Comp.RateGroupMemberOut[4] -> dpBufferManager.schedIn
|
||||
rateGroup3Comp.RateGroupMemberOut[5] -> dpWriter.schedIn
|
||||
rateGroup3Comp.RateGroupMemberOut[6] -> dpMgr.schedIn
|
||||
rateGroup3Comp.RateGroupMemberOut[3] -> ComCcsds.commsBufferManager.schedIn
|
||||
rateGroup3Comp.RateGroupMemberOut[4] -> DataProducts.dpBufferManager.schedIn
|
||||
rateGroup3Comp.RateGroupMemberOut[5] -> DataProducts.dpWriter.schedIn
|
||||
rateGroup3Comp.RateGroupMemberOut[6] -> DataProducts.dpMgr.schedIn
|
||||
}
|
||||
|
||||
connections Ref {
|
||||
sendBuffComp.Data -> blockDrv.BufferIn
|
||||
blockDrv.BufferOut -> recvBuffComp.Data
|
||||
}
|
||||
|
||||
connections Sequencer {
|
||||
cmdSeq.comCmdOut -> CDHCore.cmdDisp.seqCmdBuff
|
||||
CDHCore.cmdDisp.seqCmdStatus -> cmdSeq.cmdResponseIn
|
||||
}
|
||||
|
||||
connections Uplink {
|
||||
# ComDriver buffer allocations
|
||||
comDriver.allocate -> commsBufferManager.bufferGetCallee
|
||||
comDriver.deallocate -> commsBufferManager.bufferSendIn
|
||||
# ComDriver <-> ComStub
|
||||
comDriver.$recv -> comStub.drvReceiveIn
|
||||
comStub.drvReceiveReturnOut -> comDriver.recvReturnIn
|
||||
# ComStub <-> FrameAccumulator
|
||||
comStub.dataOut -> frameAccumulator.dataIn
|
||||
frameAccumulator.dataReturnOut -> comStub.dataReturnIn
|
||||
# FrameAccumulator buffer allocations
|
||||
frameAccumulator.bufferDeallocate -> commsBufferManager.bufferSendIn
|
||||
frameAccumulator.bufferAllocate -> commsBufferManager.bufferGetCallee
|
||||
# FrameAccumulator <-> Deframer
|
||||
frameAccumulator.dataOut -> tcDeframer.dataIn
|
||||
tcDeframer.dataReturnOut -> frameAccumulator.dataReturnIn
|
||||
# TcDeframer <-> SpacePacketDeframer
|
||||
tcDeframer.dataOut -> spacePacketDeframer.dataIn
|
||||
spacePacketDeframer.dataReturnOut -> tcDeframer.dataReturnIn
|
||||
# SpacePacketDeframer APID validation
|
||||
spacePacketDeframer.validateApidSeqCount -> apidManager.validateApidSeqCountIn
|
||||
# SpacePacketDeframer <-> Router
|
||||
spacePacketDeframer.dataOut -> fprimeRouter.dataIn
|
||||
fprimeRouter.dataReturnOut -> spacePacketDeframer.dataReturnIn
|
||||
# Router buffer allocations
|
||||
fprimeRouter.bufferAllocate -> commsBufferManager.bufferGetCallee
|
||||
fprimeRouter.bufferDeallocate -> commsBufferManager.bufferSendIn
|
||||
# Router <-> CmdDispatcher/FileUplink
|
||||
fprimeRouter.commandOut -> CDHCore.cmdDisp.seqCmdBuff
|
||||
CDHCore.cmdDisp.seqCmdStatus -> fprimeRouter.cmdResponseIn
|
||||
fprimeRouter.fileOut -> fileUplink.bufferSendIn
|
||||
fileUplink.bufferSendOut -> fprimeRouter.fileBufferReturnIn
|
||||
}
|
||||
|
||||
connections DataProducts {
|
||||
# DpMgr and DpWriter connections. Have explicit port indexes for demo
|
||||
dpMgr.bufferGetOut[0] -> dpBufferManager.bufferGetCallee
|
||||
dpMgr.productSendOut[0] -> dpWriter.bufferSendIn
|
||||
dpWriter.deallocBufferSendOut -> dpBufferManager.bufferSendIn
|
||||
|
||||
# Component DP connections
|
||||
|
||||
### Moved this out of DataProducts Subtopology --> anything specific to deployment should live in Ref connections
|
||||
# Synchronous request. Will have both request kinds for demo purposes, not typical
|
||||
SG1.productGetOut -> dpMgr.productGetIn[0]
|
||||
SG1.productGetOut -> DataProducts.dpMgr.productGetIn
|
||||
# Asynchronous request
|
||||
SG1.productRequestOut -> dpMgr.productRequestIn[0]
|
||||
dpMgr.productResponseOut[0] -> SG1.productRecvIn
|
||||
SG1.productRequestOut -> DataProducts.dpMgr.productRequestIn
|
||||
DataProducts.dpMgr.productResponseOut -> SG1.productRecvIn
|
||||
# Send filled DP
|
||||
SG1.productSendOut -> dpMgr.productSendIn[0]
|
||||
SG1.productSendOut -> DataProducts.dpMgr.productSendIn
|
||||
|
||||
}
|
||||
|
||||
connections ComCcsds_CdhCore{
|
||||
# events and telemetry to comQueue
|
||||
CdhCore.events.PktSend -> ComCcsds.comQueue.comPacketQueueIn[ComCcsds.Ports_ComPacketQueue.EVENTS]
|
||||
CdhCore.tlmSend.PktSend -> ComCcsds.comQueue.comPacketQueueIn[ComCcsds.Ports_ComPacketQueue.TELEMETRY]
|
||||
|
||||
# Router <-> CmdDispatcher
|
||||
ComCcsds.fprimeRouter.commandOut -> CdhCore.cmdDisp.seqCmdBuff
|
||||
CdhCore.cmdDisp.seqCmdStatus -> ComCcsds.fprimeRouter.cmdResponseIn
|
||||
ComCcsds.cmdSeq.comCmdOut -> CdhCore.cmdDisp.seqCmdBuff
|
||||
CdhCore.cmdDisp.seqCmdStatus -> ComCcsds.cmdSeq.cmdResponseIn
|
||||
}
|
||||
|
||||
connections ComCcsds_FileHandling {
|
||||
# File Downlink <-> ComQueue
|
||||
FileHandling.fileDownlink.bufferSendOut -> ComCcsds.comQueue.bufferQueueIn[FileHandling.Ports_ComBufferQueue.FILE_DOWNLINK]
|
||||
ComCcsds.comQueue.bufferReturnOut[FileHandling.Ports_ComBufferQueue.FILE_DOWNLINK] -> FileHandling.fileDownlink.bufferReturn
|
||||
|
||||
# Router <-> FileUplink
|
||||
ComCcsds.fprimeRouter.fileOut -> FileHandling.fileUplink.bufferSendIn
|
||||
FileHandling.fileUplink.bufferSendOut -> ComCcsds.fprimeRouter.fileBufferReturnIn
|
||||
}
|
||||
|
||||
connections FileHandling_DataProducts{
|
||||
# Data Products
|
||||
DataProducts.dpCat.fileOut -> FileHandling.fileDownlink.SendFile
|
||||
FileHandling.fileDownlink.FileComplete -> DataProducts.dpCat.fileDone
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -57,7 +57,7 @@ def set_event_filter(fprime_test_api, severity, enabled):
|
||||
severity = FilterSeverity[severity].name
|
||||
try:
|
||||
fprime_test_api.send_command(
|
||||
"CDHCore.events.SET_EVENT_FILTER",
|
||||
"CdhCore.events.SET_EVENT_FILTER",
|
||||
[severity, enabled],
|
||||
)
|
||||
return True
|
||||
@ -80,9 +80,9 @@ def test_send_command(fprime_test_api):
|
||||
|
||||
Tests command send, dispatch, and receipt using send_and_assert command with a pair of NO-OP commands.
|
||||
"""
|
||||
fprime_test_api.send_and_assert_command("CDHCore.cmdDisp.CMD_NO_OP", max_delay=0.1)
|
||||
fprime_test_api.send_and_assert_command("CdhCore.cmdDisp.CMD_NO_OP", max_delay=0.1)
|
||||
assert fprime_test_api.get_command_test_history().size() == 1
|
||||
fprime_test_api.send_and_assert_command("CDHCore.cmdDisp.CMD_NO_OP", max_delay=0.1)
|
||||
fprime_test_api.send_and_assert_command("CdhCore.cmdDisp.CMD_NO_OP", max_delay=0.1)
|
||||
assert fprime_test_api.get_command_test_history().size() == 2
|
||||
|
||||
|
||||
@ -94,11 +94,11 @@ def test_send_command_args(fprime_test_api):
|
||||
for count, value in enumerate(["Test String 1", "Some other string"], 1):
|
||||
events = [
|
||||
fprime_test_api.get_event_pred(
|
||||
"CDHCore.cmdDisp.NoOpStringReceived", [value]
|
||||
"CdhCore.cmdDisp.NoOpStringReceived", [value]
|
||||
)
|
||||
]
|
||||
fprime_test_api.send_and_assert_command(
|
||||
"CDHCore.cmdDisp.CMD_NO_OP_STRING",
|
||||
"CdhCore.cmdDisp.CMD_NO_OP_STRING",
|
||||
[
|
||||
value,
|
||||
],
|
||||
@ -117,15 +117,15 @@ def test_send_and_assert_no_op(fprime_test_api):
|
||||
length = 100
|
||||
failed = 0
|
||||
evr_seq = [
|
||||
"CDHCore.cmdDisp.OpCodeDispatched",
|
||||
"CDHCore.cmdDisp.NoOpReceived",
|
||||
"CDHCore.cmdDisp.OpCodeCompleted",
|
||||
"CdhCore.cmdDisp.OpCodeDispatched",
|
||||
"CdhCore.cmdDisp.NoOpReceived",
|
||||
"CdhCore.cmdDisp.OpCodeCompleted",
|
||||
]
|
||||
any_reordered = False
|
||||
dropped = False
|
||||
for i in range(0, length):
|
||||
results = fprime_test_api.send_and_await_event(
|
||||
"CDHCore.cmdDisp.CMD_NO_OP", events=evr_seq, timeout=25
|
||||
"CdhCore.cmdDisp.CMD_NO_OP", events=evr_seq, timeout=25
|
||||
)
|
||||
msg = "Send and assert NO_OP Trial #{}".format(i)
|
||||
if not fprime_test_api.test_assert(len(results) == 3, msg, True):
|
||||
@ -232,8 +232,8 @@ def test_active_logger_filter(fprime_test_api):
|
||||
# Drain time for dispatch events
|
||||
time.sleep(10)
|
||||
|
||||
fprime_test_api.send_and_assert_command("CDHCore.cmdDisp.CMD_NO_OP")
|
||||
fprime_test_api.send_and_assert_command("CDHCore.cmdDisp.CMD_NO_OP")
|
||||
fprime_test_api.send_and_assert_command("CdhCore.cmdDisp.CMD_NO_OP")
|
||||
fprime_test_api.send_and_assert_command("CdhCore.cmdDisp.CMD_NO_OP")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
@ -244,8 +244,8 @@ def test_active_logger_filter(fprime_test_api):
|
||||
# Drain time for dispatch events
|
||||
time.sleep(10)
|
||||
fprime_test_api.clear_histories()
|
||||
fprime_test_api.send_command("CDHCore.cmdDisp.CMD_NO_OP")
|
||||
fprime_test_api.send_command("CDHCore.cmdDisp.CMD_NO_OP")
|
||||
fprime_test_api.send_command("CdhCore.cmdDisp.CMD_NO_OP")
|
||||
fprime_test_api.send_command("CdhCore.cmdDisp.CMD_NO_OP")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
@ -285,5 +285,5 @@ def test_seqgen(fprime_test_api):
|
||||
== 0
|
||||
), "Failed to run fprime-seqgen"
|
||||
fprime_test_api.send_and_assert_command(
|
||||
"Ref.cmdSeq.CS_RUN", args=["/tmp/ref_test_int.bin", "BLOCK"], max_delay=5
|
||||
"ComCcsds.cmdSeq.CS_RUN", args=["/tmp/ref_test_int.bin", "BLOCK"], max_delay=5
|
||||
)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
; A test sequence
|
||||
;
|
||||
R00:00:00 CDHCore.cmdDisp.CMD_NO_OP
|
||||
R00:00:00 CdhCore.cmdDisp.CMD_NO_OP
|
||||
|
||||
; Let's try out some commands with arguments
|
||||
R00:00:01.050 CDHCore.cmdDisp.CMD_NO_OP_STRING "Awesome string!";
|
||||
R00:00:01.050 CdhCore.cmdDisp.CMD_NO_OP_STRING "Awesome string!";
|
||||
|
||||
@ -1,56 +0,0 @@
|
||||
module CDHCoreConfig {
|
||||
#Base ID for the CDHCore Subtopology, all components are offsets from this base ID
|
||||
constant BASE_ID = 0x3000
|
||||
|
||||
module QueueSizes {
|
||||
constant cmdDisp = 10
|
||||
constant events = 10
|
||||
constant tlmSend = 10
|
||||
constant $health = 25
|
||||
}
|
||||
|
||||
|
||||
module StackSizes {
|
||||
constant cmdDisp = 64 * 1024
|
||||
constant events = 64 * 1024
|
||||
constant tlmSend = 64 * 1024
|
||||
}
|
||||
|
||||
module Priorities {
|
||||
constant cmdDisp = 102
|
||||
constant $health = 101
|
||||
constant events = 100
|
||||
constant tlmSend = 99
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module CDHCore {
|
||||
|
||||
instance tlmSend: Svc.TlmChan base id CDHCoreConfig.BASE_ID + 0x0700 \
|
||||
queue size CDHCoreConfig.QueueSizes.tlmSend \
|
||||
stack size CDHCoreConfig.StackSizes.tlmSend \
|
||||
priority CDHCoreConfig.Priorities.tlmSend \
|
||||
|
||||
# Uncomment the following block and comment the above block to use TlmPacketizer instead of TlmChan
|
||||
#instance tlmSend: Svc.TlmPacketizer base id CDHCoreConfig.BASE_ID + 0x0700 \
|
||||
# queue size CDHCoreConfig.QueueSizes.tlmSend \
|
||||
# stack size CDHCoreConfig.StackSizes.tlmSend \
|
||||
# priority CDHCoreConfig.Priorities.tlmSend \
|
||||
#{
|
||||
# # NOTE: The Name Ref is specific to the Reference deployment, Ref
|
||||
# # This name will need to be updated if wishing to use this in a custom deployment
|
||||
# phase Fpp.ToCpp.Phases.configComponents """
|
||||
# CDHCore::tlmSend.setPacketList(
|
||||
# Ref::Ref_RefPacketsTlmPackets::packetList,
|
||||
# Ref::Ref_RefPacketsTlmPackets::omittedChannels,
|
||||
# 1
|
||||
# );
|
||||
# """
|
||||
#}
|
||||
|
||||
# Update this as a custom fatal handler if needed
|
||||
instance fatalHandler: Svc.FatalHandler base id CDHCoreConfig.BASE_ID + 0x0800
|
||||
|
||||
}
|
||||
@ -1,5 +0,0 @@
|
||||
register_fprime_module(
|
||||
AUTOCODER_INPUTS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/CDHCoreConfig.fpp"
|
||||
INTERFACE
|
||||
)
|
||||
@ -1,9 +0,0 @@
|
||||
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/CDHCoreConfig/")
|
||||
|
||||
register_fprime_module(
|
||||
AUTOCODER_INPUTS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/CDHCore.fpp"
|
||||
HEADERS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/PingEntries.hpp"
|
||||
INTERFACE
|
||||
)
|
||||
@ -1,10 +0,0 @@
|
||||
#ifndef CDHCORE_PINGENTRIES_HPP
|
||||
#define CDHCORE_PINGENTRIES_HPP
|
||||
|
||||
namespace PingEntries {
|
||||
struct CDHCore_cmdDisp { enum { WARN=3, FATAL=5 }; };
|
||||
struct CDHCore_events { enum { WARN=3, FATAL=5 }; };
|
||||
struct CDHCore_tlmSend { enum { WARN=3, FATAL=5 }; };
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -1,2 +1,5 @@
|
||||
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/CDHCore/")
|
||||
|
||||
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/CdhCore/")
|
||||
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ComCcsds/")
|
||||
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ComFprime/")
|
||||
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/FileHandling/")
|
||||
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/DataProducts/")
|
||||
|
||||
11
Svc/Subtopologies/CdhCore/CMakeLists.txt
Normal file
11
Svc/Subtopologies/CdhCore/CMakeLists.txt
Normal file
@ -0,0 +1,11 @@
|
||||
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/CdhCoreConfig/")
|
||||
|
||||
register_fprime_module(
|
||||
AUTOCODER_INPUTS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/CdhCore.fpp"
|
||||
HEADERS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/PingEntries.hpp"
|
||||
INTERFACE
|
||||
DEPENDS
|
||||
Svc_Subtopologies_CdhCore_CdhCoreConfig
|
||||
)
|
||||
@ -1,22 +1,22 @@
|
||||
module CDHCore {
|
||||
module CdhCore {
|
||||
# ----------------------------------------------------------------------
|
||||
# Active Components
|
||||
# ----------------------------------------------------------------------
|
||||
instance cmdDisp: Svc.CommandDispatcher base id CDHCoreConfig.BASE_ID + 0x0100 \
|
||||
queue size CDHCoreConfig.QueueSizes.cmdDisp \
|
||||
stack size CDHCoreConfig.StackSizes.cmdDisp \
|
||||
priority CDHCoreConfig.Priorities.cmdDisp
|
||||
instance cmdDisp: Svc.CommandDispatcher base id CdhCoreConfig.BASE_ID + 0x0100 \
|
||||
queue size CdhCoreConfig.QueueSizes.cmdDisp \
|
||||
stack size CdhCoreConfig.StackSizes.cmdDisp \
|
||||
priority CdhCoreConfig.Priorities.cmdDisp
|
||||
|
||||
instance events: Svc.ActiveLogger base id CDHCoreConfig.BASE_ID + 0x0200 \
|
||||
queue size CDHCoreConfig.QueueSizes.events \
|
||||
stack size CDHCoreConfig.StackSizes.events \
|
||||
priority CDHCoreConfig.Priorities.events
|
||||
instance events: Svc.ActiveLogger base id CdhCoreConfig.BASE_ID + 0x0200 \
|
||||
queue size CdhCoreConfig.QueueSizes.events \
|
||||
stack size CdhCoreConfig.StackSizes.events \
|
||||
priority CdhCoreConfig.Priorities.events
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Queued Components
|
||||
# ----------------------------------------------------------------------
|
||||
instance $health: Svc.Health base id CDHCoreConfig.BASE_ID + 0x0300 \
|
||||
queue size CDHCoreConfig.QueueSizes.$health \
|
||||
instance $health: Svc.Health base id CdhCoreConfig.BASE_ID + 0x0300 \
|
||||
queue size CdhCoreConfig.QueueSizes.$health \
|
||||
{
|
||||
phase Fpp.ToCpp.Phases.configConstants """
|
||||
enum {
|
||||
@ -25,10 +25,10 @@ module CDHCore {
|
||||
"""
|
||||
phase Fpp.ToCpp.Phases.configComponents """
|
||||
// Health is supplied a set of ping entires.
|
||||
CDHCore::health.setPingEntries(
|
||||
ConfigObjects::CDHCore_health::pingEntries,
|
||||
FW_NUM_ARRAY_ELEMENTS(ConfigObjects::CDHCore_health::pingEntries),
|
||||
ConfigConstants::CDHCore_health::HEALTH_WATCHDOG_CODE
|
||||
CdhCore::health.setPingEntries(
|
||||
ConfigObjects::CdhCore_health::pingEntries,
|
||||
FW_NUM_ARRAY_ELEMENTS(ConfigObjects::CdhCore_health::pingEntries),
|
||||
ConfigConstants::CdhCore_health::HEALTH_WATCHDOG_CODE
|
||||
);
|
||||
"""
|
||||
}
|
||||
@ -36,17 +36,17 @@ module CDHCore {
|
||||
# ----------------------------------------------------------------------
|
||||
# Passive Components
|
||||
# ----------------------------------------------------------------------
|
||||
instance version: Svc.Version base id CDHCoreConfig.BASE_ID + 0x0400 \
|
||||
instance version: Svc.Version base id CdhCoreConfig.BASE_ID + 0x0400 \
|
||||
{
|
||||
phase Fpp.ToCpp.Phases.configComponents """
|
||||
// Startup TLM and Config verbosity for Versions
|
||||
CDHCore::version.config(true);
|
||||
CdhCore::version.config(true);
|
||||
"""
|
||||
}
|
||||
|
||||
instance textLogger: Svc.PassiveTextLogger base id CDHCoreConfig.BASE_ID + 0x0500
|
||||
instance textLogger: Svc.PassiveTextLogger base id CdhCoreConfig.BASE_ID + 0x0500
|
||||
|
||||
instance fatalAdapter: Svc.AssertFatalAdapter base id CDHCoreConfig.BASE_ID + 0x0600
|
||||
instance fatalAdapter: Svc.AssertFatalAdapter base id CdhCoreConfig.BASE_ID + 0x0600
|
||||
|
||||
topology Subtopology {
|
||||
#Active Components
|
||||
@ -68,4 +68,4 @@ module CDHCore {
|
||||
}
|
||||
|
||||
} # end topology
|
||||
} # end CDHCore Subtopology
|
||||
} # end CdhCore Subtopology
|
||||
7
Svc/Subtopologies/CdhCore/CdhCoreConfig/CMakeLists.txt
Normal file
7
Svc/Subtopologies/CdhCore/CdhCoreConfig/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
||||
register_fprime_config(
|
||||
AUTOCODER_INPUTS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/CdhCoreConfig.fpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/CdhCoreFatalHandlerConfig.fpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/CdhCoreTlmConfig.fpp"
|
||||
INTERFACE
|
||||
)
|
||||
26
Svc/Subtopologies/CdhCore/CdhCoreConfig/CdhCoreConfig.fpp
Normal file
26
Svc/Subtopologies/CdhCore/CdhCoreConfig/CdhCoreConfig.fpp
Normal file
@ -0,0 +1,26 @@
|
||||
module CdhCoreConfig {
|
||||
#Base ID for the CdhCore Subtopology, all components are offsets from this base ID
|
||||
constant BASE_ID = 0x6000
|
||||
|
||||
module QueueSizes {
|
||||
constant cmdDisp = 10
|
||||
constant events = 10
|
||||
constant tlmSend = 10
|
||||
constant $health = 25
|
||||
}
|
||||
|
||||
|
||||
module StackSizes {
|
||||
constant cmdDisp = 64 * 1024
|
||||
constant events = 64 * 1024
|
||||
constant tlmSend = 64 * 1024
|
||||
}
|
||||
|
||||
module Priorities {
|
||||
constant cmdDisp = 102
|
||||
constant $health = 101
|
||||
constant events = 100
|
||||
constant tlmSend = 99
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
module CdhCore {
|
||||
|
||||
# Update this as a custom fatal handler if needed
|
||||
instance fatalHandler: Svc.FatalHandler base id CdhCoreConfig.BASE_ID + 0x0800
|
||||
|
||||
}
|
||||
24
Svc/Subtopologies/CdhCore/CdhCoreConfig/CdhCoreTlmConfig.fpp
Normal file
24
Svc/Subtopologies/CdhCore/CdhCoreConfig/CdhCoreTlmConfig.fpp
Normal file
@ -0,0 +1,24 @@
|
||||
module CdhCore{
|
||||
|
||||
instance tlmSend: Svc.TlmChan base id CdhCoreConfig.BASE_ID + 0x0700 \
|
||||
queue size CdhCoreConfig.QueueSizes.tlmSend \
|
||||
stack size CdhCoreConfig.StackSizes.tlmSend \
|
||||
priority CdhCoreConfig.Priorities.tlmSend \
|
||||
|
||||
# Uncomment the following block and comment the above block to use TlmPacketizer instead of TlmChan
|
||||
#instance tlmSend: Svc.TlmPacketizer base id CdhCoreConfig.BASE_ID + 0x0700 \
|
||||
# queue size CdhCoreConfig.QueueSizes.tlmSend \
|
||||
# stack size CdhCoreConfig.StackSizes.tlmSend \
|
||||
# priority CdhCoreConfig.Priorities.tlmSend \
|
||||
#{
|
||||
# # NOTE: The Name Ref is specific to the Reference deployment, Ref
|
||||
# # This name will need to be updated if wishing to use this in a custom deployment
|
||||
# phase Fpp.ToCpp.Phases.configComponents """
|
||||
# CdhCore::tlmSend.setPacketList(
|
||||
# Ref::Ref_RefPacketsTlmPackets::packetList,
|
||||
# Ref::Ref_RefPacketsTlmPackets::omittedChannels,
|
||||
# 1
|
||||
# );
|
||||
# """
|
||||
#}
|
||||
}
|
||||
10
Svc/Subtopologies/CdhCore/PingEntries.hpp
Normal file
10
Svc/Subtopologies/CdhCore/PingEntries.hpp
Normal file
@ -0,0 +1,10 @@
|
||||
#ifndef CDHCORE_PINGENTRIES_HPP
|
||||
#define CDHCORE_PINGENTRIES_HPP
|
||||
|
||||
namespace PingEntries {
|
||||
struct CdhCore_cmdDisp { enum { WARN=3, FATAL=5 }; };
|
||||
struct CdhCore_events { enum { WARN=3, FATAL=5 }; };
|
||||
struct CdhCore_tlmSend { enum { WARN=3, FATAL=5 }; };
|
||||
}
|
||||
|
||||
#endif
|
||||
12
Svc/Subtopologies/ComCcsds/CMakeLists.txt
Normal file
12
Svc/Subtopologies/ComCcsds/CMakeLists.txt
Normal file
@ -0,0 +1,12 @@
|
||||
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ComCcsdsConfig/")
|
||||
|
||||
register_fprime_module(
|
||||
AUTOCODER_INPUTS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ComCcsds.fpp"
|
||||
HEADERS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/SubtopologyTopologyDefs.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/PingEntries.hpp"
|
||||
DEPENDS
|
||||
Svc_Subtopologies_ComCcsds_ComCcsdsConfig
|
||||
INTERFACE
|
||||
)
|
||||
198
Svc/Subtopologies/ComCcsds/ComCcsds.fpp
Normal file
198
Svc/Subtopologies/ComCcsds/ComCcsds.fpp
Normal file
@ -0,0 +1,198 @@
|
||||
module ComCcsds {
|
||||
|
||||
# ComPacket Queue enum for queue types
|
||||
enum Ports_ComPacketQueue {
|
||||
EVENTS,
|
||||
TELEMETRY,
|
||||
FILE_QUEUE
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Active Components
|
||||
# ----------------------------------------------------------------------
|
||||
instance comQueue: Svc.ComQueue base id ComCcsdsConfig.BASE_ID + 0x0100 \
|
||||
queue size ComCcsdsConfig.QueueSizes.comQueue \
|
||||
stack size ComCcsdsConfig.StackSizes.comQueue \
|
||||
priority ComCcsdsConfig.Priorities.comQueue \
|
||||
{
|
||||
phase Fpp.ToCpp.Phases.configConstants """
|
||||
enum {
|
||||
EVENTS,
|
||||
TELEMETRY,
|
||||
FILE_QUEUE
|
||||
};
|
||||
"""
|
||||
phase Fpp.ToCpp.Phases.configComponents """
|
||||
Svc::ComQueue::QueueConfigurationTable configurationTable;
|
||||
|
||||
// Events (highest-priority)
|
||||
configurationTable.entries[ConfigConstants::ComCcsds_comQueue::EVENTS].depth = ComCcsdsConfig::QueueDepths::events;
|
||||
configurationTable.entries[ConfigConstants::ComCcsds_comQueue::EVENTS].priority = ComCcsdsConfig::QueuePriorities::events;
|
||||
|
||||
// Telemetry
|
||||
configurationTable.entries[ConfigConstants::ComCcsds_comQueue::TELEMETRY].depth = ComCcsdsConfig::QueueDepths::tlm;
|
||||
configurationTable.entries[ConfigConstants::ComCcsds_comQueue::TELEMETRY].priority = ComCcsdsConfig::QueuePriorities::tlm;
|
||||
|
||||
// File Downlink Queue
|
||||
configurationTable.entries[ConfigConstants::ComCcsds_comQueue::FILE_QUEUE].depth = ComCcsdsConfig::QueueDepths::file;
|
||||
configurationTable.entries[ConfigConstants::ComCcsds_comQueue::FILE_QUEUE].priority = ComCcsdsConfig::QueuePriorities::file;
|
||||
|
||||
// Allocation identifier is 0 as the MallocAllocator discards it
|
||||
ComCcsds::comQueue.configure(configurationTable, 0, ComCcsds::Allocation::memAllocator);
|
||||
"""
|
||||
phase Fpp.ToCpp.Phases.tearDownComponents """
|
||||
ComCcsds::comQueue.cleanup();
|
||||
"""
|
||||
}
|
||||
|
||||
instance cmdSeq: Svc.CmdSequencer base id ComCcsdsConfig.BASE_ID + 0x0200 \
|
||||
queue size ComCcsdsConfig.QueueSizes.cmdSeq \
|
||||
stack size ComCcsdsConfig.StackSizes.cmdSeq \
|
||||
priority ComCcsdsConfig.Priorities.cmdSeq \
|
||||
{
|
||||
phase Fpp.ToCpp.Phases.configComponents """
|
||||
ComCcsds::cmdSeq.allocateBuffer(0, ComCcsds::Allocation::memAllocator, ComCcsdsConfig::BuffMgr::cmdSeqBuffSize);
|
||||
"""
|
||||
|
||||
phase Fpp.ToCpp.Phases.tearDownComponents """
|
||||
ComCcsds::cmdSeq.deallocateBuffer(ComCcsds::Allocation::memAllocator);
|
||||
"""
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Passive Components
|
||||
# ----------------------------------------------------------------------
|
||||
instance frameAccumulator: Svc.FrameAccumulator base id ComCcsdsConfig.BASE_ID + 0x0500 \
|
||||
{
|
||||
|
||||
phase Fpp.ToCpp.Phases.configObjects """
|
||||
Svc::FrameDetectors::CcsdsTcFrameDetector frameDetector;
|
||||
"""
|
||||
phase Fpp.ToCpp.Phases.configComponents """
|
||||
ComCcsds::frameAccumulator.configure(
|
||||
ConfigObjects::ComCcsds_frameAccumulator::frameDetector,
|
||||
1,
|
||||
ComCcsds::Allocation::memAllocator,
|
||||
ComCcsdsConfig::BuffMgr::frameAccumulatorSize
|
||||
);
|
||||
"""
|
||||
|
||||
phase Fpp.ToCpp.Phases.tearDownComponents """
|
||||
ComCcsds::frameAccumulator.cleanup();
|
||||
"""
|
||||
}
|
||||
|
||||
instance commsBufferManager: Svc.BufferManager base id ComCcsdsConfig.BASE_ID + 0x0600 \
|
||||
{
|
||||
phase Fpp.ToCpp.Phases.configObjects """
|
||||
Svc::BufferManager::BufferBins bins;
|
||||
"""
|
||||
|
||||
phase Fpp.ToCpp.Phases.configComponents """
|
||||
memset(&ConfigObjects::ComCcsds_commsBufferManager::bins, 0, sizeof(ConfigObjects::ComCcsds_commsBufferManager::bins));
|
||||
ConfigObjects::ComCcsds_commsBufferManager::bins.bins[0].bufferSize = ComCcsdsConfig::BuffMgr::commsBuffSize;
|
||||
ConfigObjects::ComCcsds_commsBufferManager::bins.bins[0].numBuffers = ComCcsdsConfig::BuffMgr::commsBuffCount;
|
||||
ConfigObjects::ComCcsds_commsBufferManager::bins.bins[1].bufferSize = ComCcsdsConfig::BuffMgr::commsFileBuffSize;
|
||||
ConfigObjects::ComCcsds_commsBufferManager::bins.bins[1].numBuffers = ComCcsdsConfig::BuffMgr::commsFileBuffCount;
|
||||
ComCcsds::commsBufferManager.setup(
|
||||
ComCcsdsConfig::BuffMgr::commsBuffMgrId,
|
||||
0,
|
||||
ComCcsds::Allocation::memAllocator,
|
||||
ConfigObjects::ComCcsds_commsBufferManager::bins
|
||||
);
|
||||
"""
|
||||
|
||||
phase Fpp.ToCpp.Phases.tearDownComponents """
|
||||
ComCcsds::commsBufferManager.cleanup();
|
||||
"""
|
||||
}
|
||||
|
||||
instance fprimeRouter: Svc.FprimeRouter base id ComCcsdsConfig.BASE_ID + 0x0700 \
|
||||
|
||||
instance comStub: Svc.ComStub base id ComCcsdsConfig.BASE_ID + 0x0800 \
|
||||
|
||||
instance tcDeframer: Svc.Ccsds.TcDeframer base id ComCcsdsConfig.BASE_ID + 0x0900 \
|
||||
|
||||
instance spacePacketDeframer: Svc.Ccsds.SpacePacketDeframer base id ComCcsdsConfig.BASE_ID + 0x0A00 \
|
||||
|
||||
instance tmFramer: Svc.Ccsds.TmFramer base id ComCcsdsConfig.BASE_ID + 0x0B00 \
|
||||
|
||||
instance spacePacketFramer: Svc.Ccsds.SpacePacketFramer base id ComCcsdsConfig.BASE_ID + 0x0C00 \
|
||||
|
||||
instance apidManager: Svc.Ccsds.ApidManager base id ComCcsdsConfig.BASE_ID + 0x0D00 \
|
||||
|
||||
topology Subtopology {
|
||||
# Active Components
|
||||
instance comQueue
|
||||
instance cmdSeq
|
||||
|
||||
# Passive Components
|
||||
instance commsBufferManager
|
||||
instance frameAccumulator
|
||||
instance fprimeRouter
|
||||
instance comStub
|
||||
instance comDriver
|
||||
instance tcDeframer
|
||||
instance spacePacketDeframer
|
||||
instance tmFramer
|
||||
instance spacePacketFramer
|
||||
instance apidManager
|
||||
|
||||
connections Downlink {
|
||||
|
||||
|
||||
# ComQueue <-> SpacePacketFramer
|
||||
comQueue.dataOut -> spacePacketFramer.dataIn
|
||||
spacePacketFramer.dataReturnOut -> comQueue.dataReturnIn
|
||||
# SpacePacketFramer buffer and APID management
|
||||
spacePacketFramer.bufferAllocate -> commsBufferManager.bufferGetCallee
|
||||
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
|
||||
# ComStub <-> ComDriver
|
||||
comStub.drvSendOut -> comDriver.$send
|
||||
comDriver.sendReturnOut -> comStub.drvSendReturnIn
|
||||
comDriver.ready -> comStub.drvConnected
|
||||
# ComStatus
|
||||
comStub.comStatusOut -> tmFramer.comStatusIn
|
||||
tmFramer.comStatusOut -> spacePacketFramer.comStatusIn
|
||||
spacePacketFramer.comStatusOut -> comQueue.comStatusIn
|
||||
}
|
||||
|
||||
connections Uplink {
|
||||
# ComDriver buffer allocations
|
||||
comDriver.allocate -> commsBufferManager.bufferGetCallee
|
||||
comDriver.deallocate -> commsBufferManager.bufferSendIn
|
||||
# ComDriver <-> ComStub
|
||||
comDriver.$recv -> comStub.drvReceiveIn
|
||||
comStub.drvReceiveReturnOut -> comDriver.recvReturnIn
|
||||
# ComStub <-> FrameAccumulator
|
||||
comStub.dataOut -> frameAccumulator.dataIn
|
||||
frameAccumulator.dataReturnOut -> comStub.dataReturnIn
|
||||
# FrameAccumulator buffer allocations
|
||||
frameAccumulator.bufferDeallocate -> commsBufferManager.bufferSendIn
|
||||
frameAccumulator.bufferAllocate -> commsBufferManager.bufferGetCallee
|
||||
# FrameAccumulator <-> Deframer
|
||||
frameAccumulator.dataOut -> tcDeframer.dataIn
|
||||
tcDeframer.dataReturnOut -> frameAccumulator.dataReturnIn
|
||||
# TcDeframer <-> SpacePacketDeframer
|
||||
tcDeframer.dataOut -> spacePacketDeframer.dataIn
|
||||
spacePacketDeframer.dataReturnOut -> tcDeframer.dataReturnIn
|
||||
# SpacePacketDeframer APID validation
|
||||
spacePacketDeframer.validateApidSeqCount -> apidManager.validateApidSeqCountIn
|
||||
# SpacePacketDeframer <-> Router
|
||||
spacePacketDeframer.dataOut -> fprimeRouter.dataIn
|
||||
fprimeRouter.dataReturnOut -> spacePacketDeframer.dataReturnIn
|
||||
# Router buffer allocations
|
||||
fprimeRouter.bufferAllocate -> commsBufferManager.bufferGetCallee
|
||||
fprimeRouter.bufferDeallocate -> commsBufferManager.bufferSendIn
|
||||
|
||||
}
|
||||
|
||||
} # end topology
|
||||
} # end ComCcsds Subtopology
|
||||
11
Svc/Subtopologies/ComCcsds/ComCcsdsConfig/CMakeLists.txt
Normal file
11
Svc/Subtopologies/ComCcsds/ComCcsdsConfig/CMakeLists.txt
Normal file
@ -0,0 +1,11 @@
|
||||
register_fprime_config(
|
||||
SOURCES
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ComCcsdsSubtopologyConfig.cpp"
|
||||
HEADERS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ComCcsdsSubtopologyConfig.hpp"
|
||||
AUTOCODER_INPUTS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ComCcsdsConfig.fpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ComCcsdsComDriverConfig.fpp"
|
||||
DEPENDS
|
||||
Fw_Types
|
||||
)
|
||||
@ -0,0 +1,28 @@
|
||||
module ComCcsds {
|
||||
# Communications driver. May be swapped out with other comm drivers like UART in this file
|
||||
# to use another driver in the Comms Subtopology
|
||||
instance comDriver: Drv.TcpClient base id ComCcsdsConfig.BASE_ID + 0x0B00 \
|
||||
{
|
||||
phase Fpp.ToCpp.Phases.configComponents """
|
||||
if (state.comCcsds.hostname != nullptr && state.comCcsds.port != 0) {
|
||||
ComCcsds::comDriver.configure(state.comCcsds.hostname, state.comCcsds.port);
|
||||
}
|
||||
"""
|
||||
|
||||
phase Fpp.ToCpp.Phases.startTasks """
|
||||
// Initialize socket client communication if and only if there is a valid specification
|
||||
if (state.comCcsds.hostname != nullptr && state.comCcsds.port != 0) {
|
||||
Os::TaskString name("ReceiveTask");
|
||||
ComCcsds::comDriver.start(name, ComCcsdsConfig::Priorities::comDriver, ComCcsdsConfig::StackSizes::comDriver);
|
||||
}
|
||||
"""
|
||||
|
||||
phase Fpp.ToCpp.Phases.stopTasks """
|
||||
ComCcsds::comDriver.stop();
|
||||
"""
|
||||
|
||||
phase Fpp.ToCpp.Phases.freeThreads """
|
||||
(void)ComCcsds::comDriver.join();
|
||||
"""
|
||||
}
|
||||
}
|
||||
45
Svc/Subtopologies/ComCcsds/ComCcsdsConfig/ComCcsdsConfig.fpp
Normal file
45
Svc/Subtopologies/ComCcsds/ComCcsdsConfig/ComCcsdsConfig.fpp
Normal file
@ -0,0 +1,45 @@
|
||||
module ComCcsdsConfig {
|
||||
#Base ID for the ComCcsds Subtopology, all components are offsets from this base ID
|
||||
constant BASE_ID = 0x8000
|
||||
|
||||
module QueueSizes {
|
||||
constant comQueue = 10
|
||||
constant cmdSeq = 10
|
||||
}
|
||||
|
||||
module StackSizes {
|
||||
constant comQueue = 64 * 1024
|
||||
constant cmdSeq = 64 * 1024
|
||||
constant comDriver = 100
|
||||
}
|
||||
|
||||
module Priorities {
|
||||
constant comQueue = 101
|
||||
constant cmdSeq = 100
|
||||
constant comDriver = 100
|
||||
}
|
||||
|
||||
# Queue configuration constants
|
||||
module QueueDepths {
|
||||
constant events = 100
|
||||
constant tlm = 500
|
||||
constant file = 100
|
||||
}
|
||||
|
||||
module QueuePriorities {
|
||||
constant events = 0
|
||||
constant tlm = 2
|
||||
constant file = 1
|
||||
}
|
||||
|
||||
# Buffer management constants
|
||||
module BuffMgr {
|
||||
constant cmdSeqBuffSize = 5 * 1024
|
||||
constant frameAccumulatorSize = 2048
|
||||
constant commsBuffSize = 2048
|
||||
constant commsFileBuffSize = 3000
|
||||
constant commsBuffCount = 20
|
||||
constant commsFileBuffCount = 30
|
||||
constant commsBuffMgrId = 200
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
#include "ComCcsdsSubtopologyConfig.hpp"
|
||||
|
||||
namespace ComCcsds{
|
||||
namespace Allocation{
|
||||
//This instance can be changed to use a different allocator in the ComCcsds Subtopology
|
||||
Fw::MallocAllocator mallocatorInstance;
|
||||
Fw::MemAllocator& memAllocator = mallocatorInstance;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
#ifndef COMCCSDSSUBTOPOLOGY_CONFIG_HPP
|
||||
#define COMCCSDSSUBTOPOLOGY_CONFIG_HPP
|
||||
|
||||
#include "Fw/Types/MallocAllocator.hpp"
|
||||
|
||||
namespace ComCcsds {
|
||||
namespace Allocation {
|
||||
extern Fw::MemAllocator& memAllocator;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
9
Svc/Subtopologies/ComCcsds/PingEntries.hpp
Normal file
9
Svc/Subtopologies/ComCcsds/PingEntries.hpp
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
#ifndef COMCCSDS_PINGENTRIES_HPP
|
||||
#define COMCCSDS_PINGENTRIES_HPP
|
||||
|
||||
namespace PingEntries {
|
||||
namespace ComCcsds_cmdSeq {enum { WARN = 3, FATAL = 5 };}
|
||||
}
|
||||
|
||||
#endif
|
||||
21
Svc/Subtopologies/ComCcsds/SubtopologyTopologyDefs.hpp
Normal file
21
Svc/Subtopologies/ComCcsds/SubtopologyTopologyDefs.hpp
Normal file
@ -0,0 +1,21 @@
|
||||
#ifndef COMCCSDSSUBTOPOLOGY_DEFS_HPP
|
||||
#define COMCCSDSSUBTOPOLOGY_DEFS_HPP
|
||||
|
||||
#include <Svc/FrameAccumulator/FrameDetector/CcsdsTcFrameDetector.hpp>
|
||||
#include <Fw/Types/MallocAllocator.hpp>
|
||||
#include <Svc/BufferManager/BufferManager.hpp>
|
||||
#include "Svc/Subtopologies/ComCcsds/ComCcsdsConfig/FppConstantsAc.hpp"
|
||||
#include "ComCcsdsConfig/ComCcsdsSubtopologyConfig.hpp"
|
||||
|
||||
namespace ComCcsds {
|
||||
struct SubtopologyState {
|
||||
const char* hostname;
|
||||
U16 port;
|
||||
};
|
||||
|
||||
struct TopologyState {
|
||||
SubtopologyState comCcsds;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
12
Svc/Subtopologies/ComFprime/CMakeLists.txt
Normal file
12
Svc/Subtopologies/ComFprime/CMakeLists.txt
Normal file
@ -0,0 +1,12 @@
|
||||
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ComFprimeConfig/")
|
||||
|
||||
register_fprime_module(
|
||||
AUTOCODER_INPUTS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ComFprime.fpp"
|
||||
HEADERS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/SubtopologyTopologyDefs.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/PingEntries.hpp"
|
||||
DEPENDS
|
||||
Svc_Subtopologies_ComFprime_ComFprimeConfig
|
||||
INTERFACE
|
||||
)
|
||||
164
Svc/Subtopologies/ComFprime/ComFprime.fpp
Normal file
164
Svc/Subtopologies/ComFprime/ComFprime.fpp
Normal file
@ -0,0 +1,164 @@
|
||||
module ComFprime {
|
||||
|
||||
enum Ports_ComPacketQueue {
|
||||
EVENTS,
|
||||
TELEMETRY,
|
||||
FILE_QUEUE
|
||||
};
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Active Components
|
||||
# ----------------------------------------------------------------------
|
||||
instance comQueue: Svc.ComQueue base id ComFprimeConfig.BASE_ID + 0x0100 \
|
||||
queue size ComFprimeConfig.QueueSizes.comQueue \
|
||||
stack size ComFprimeConfig.StackSizes.comQueue \
|
||||
priority ComFprimeConfig.Priorities.comQueue \
|
||||
{
|
||||
phase Fpp.ToCpp.Phases.configConstants """
|
||||
enum{
|
||||
EVENTS,
|
||||
TELEMETRY,
|
||||
FILE_QUEUE
|
||||
};
|
||||
"""
|
||||
phase Fpp.ToCpp.Phases.configComponents """
|
||||
Svc::ComQueue::QueueConfigurationTable configurationTable;
|
||||
// Events (highest-priority)
|
||||
configurationTable.entries[ConfigConstants::ComFprime_comQueue::EVENTS].depth = ComFprimeConfig::QueueDepths::events;
|
||||
configurationTable.entries[ConfigConstants::ComFprime_comQueue::EVENTS].priority = ComFprimeConfig::QueuePriorities::events;
|
||||
// Telemetry
|
||||
configurationTable.entries[ConfigConstants::ComFprime_comQueue::TELEMETRY].depth = ComFprimeConfig::QueueDepths::tlm;
|
||||
configurationTable.entries[ConfigConstants::ComFprime_comQueue::TELEMETRY].priority = ComFprimeConfig::QueuePriorities::tlm;
|
||||
// File Downlink Queue
|
||||
configurationTable.entries[ConfigConstants::ComFprime_comQueue::FILE_QUEUE].depth = ComFprimeConfig::QueueDepths::file;
|
||||
configurationTable.entries[ConfigConstants::ComFprime_comQueue::FILE_QUEUE].priority = ComFprimeConfig::QueuePriorities::file;
|
||||
// Allocation identifier is 0 as the MallocAllocator discards it
|
||||
ComFprime::comQueue.configure(configurationTable, 0, ComFprime::Allocation::memAllocator);
|
||||
"""
|
||||
}
|
||||
|
||||
instance cmdSeq: Svc.CmdSequencer base id ComFprimeConfig.BASE_ID + 0x0200 \
|
||||
queue size ComFprimeConfig.QueueSizes.cmdSeq \
|
||||
stack size ComFprimeConfig.StackSizes.cmdSeq \
|
||||
priority ComFprimeConfig.Priorities.cmdSeq \
|
||||
{
|
||||
phase Fpp.ToCpp.Phases.configComponents """
|
||||
ComFprime::cmdSeq.allocateBuffer(0, ComFprime::Allocation::memAllocator, ComFprimeConfig::BuffMgr::cmdSeqBuffSize);
|
||||
"""
|
||||
|
||||
phase Fpp.ToCpp.Phases.tearDownComponents """
|
||||
ComFprime::cmdSeq.deallocateBuffer(ComFprime::Allocation::memAllocator);
|
||||
"""
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Passive Components
|
||||
# ----------------------------------------------------------------------
|
||||
instance frameAccumulator: Svc.FrameAccumulator base id ComFprimeConfig.BASE_ID + 0x0500 \
|
||||
{
|
||||
|
||||
phase Fpp.ToCpp.Phases.configComponents """
|
||||
ComFprime::frameAccumulator.configure(
|
||||
ComFprime::Detector::frameDetector,
|
||||
1,
|
||||
ComFprime::Allocation::memAllocator,
|
||||
ComFprimeConfig::BuffMgr::frameAccumulatorSize
|
||||
);
|
||||
"""
|
||||
|
||||
phase Fpp.ToCpp.Phases.tearDownComponents """
|
||||
ComFprime::frameAccumulator.cleanup();
|
||||
"""
|
||||
}
|
||||
|
||||
instance commsBufferManager: Svc.BufferManager base id ComFprimeConfig.BASE_ID + 0x0600 \
|
||||
{
|
||||
phase Fpp.ToCpp.Phases.configComponents """
|
||||
memset(&ComFprime::BufferManagerBins::bins, 0, sizeof(ComFprime::BufferManagerBins::bins));
|
||||
ComFprime::BufferManagerBins::bins.bins[0].bufferSize = ComFprimeConfig::BuffMgr::commsBuffSize;
|
||||
ComFprime::BufferManagerBins::bins.bins[0].numBuffers = ComFprimeConfig::BuffMgr::commsBuffCount;
|
||||
ComFprime::BufferManagerBins::bins.bins[1].bufferSize = ComFprimeConfig::BuffMgr::commsFileBuffSize;
|
||||
ComFprime::BufferManagerBins::bins.bins[1].numBuffers = ComFprimeConfig::BuffMgr::commsFileBuffCount;
|
||||
ComFprime::commsBufferManager.setup(
|
||||
ComFprimeConfig::BuffMgr::commsBuffMgrId,
|
||||
0,
|
||||
ComFprime::Allocation::memAllocator,
|
||||
ComFprime::BufferManagerBins::bins
|
||||
);
|
||||
"""
|
||||
|
||||
phase Fpp.ToCpp.Phases.tearDownComponents """
|
||||
ComFprime::commsBufferManager.cleanup();
|
||||
"""
|
||||
}
|
||||
|
||||
instance deframer: Svc.FprimeDeframer base id ComFprimeConfig.BASE_ID + 0x0700 \
|
||||
|
||||
instance fprimeFramer: Svc.FprimeFramer base id ComFprimeConfig.BASE_ID + 0x0800 \
|
||||
|
||||
instance fprimeRouter: Svc.FprimeRouter base id ComFprimeConfig.BASE_ID + 0x0900 \
|
||||
|
||||
instance comStub: Svc.ComStub base id ComFprimeConfig.BASE_ID + 0x0A00 \
|
||||
|
||||
topology Subtopology {
|
||||
# Active Components
|
||||
instance comQueue
|
||||
instance cmdSeq
|
||||
|
||||
# Passive Components
|
||||
instance commsBufferManager
|
||||
instance frameAccumulator
|
||||
instance deframer
|
||||
instance fprimeFramer
|
||||
instance fprimeRouter
|
||||
instance comStub
|
||||
instance comDriver
|
||||
|
||||
|
||||
connections Downlink {
|
||||
# Inputs to ComQueue (events, telemetry)
|
||||
# ComQueue <-> Framer
|
||||
comQueue.dataOut -> fprimeFramer.dataIn
|
||||
fprimeFramer.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
|
||||
# ComStub <-> ComDriver
|
||||
comStub.drvSendOut -> comDriver.$send
|
||||
comDriver.sendReturnOut -> comStub.drvSendReturnIn
|
||||
comDriver.ready -> comStub.drvConnected
|
||||
# ComStatus
|
||||
comStub.comStatusOut -> fprimeFramer.comStatusIn
|
||||
fprimeFramer.comStatusOut -> comQueue.comStatusIn
|
||||
}
|
||||
|
||||
connections Uplink {
|
||||
# ComDriver buffer allocations
|
||||
comDriver.allocate -> commsBufferManager.bufferGetCallee
|
||||
comDriver.deallocate -> commsBufferManager.bufferSendIn
|
||||
# ComDriver <-> ComStub
|
||||
comDriver.$recv -> comStub.drvReceiveIn
|
||||
comStub.drvReceiveReturnOut -> comDriver.recvReturnIn
|
||||
# ComStub <-> FrameAccumulator
|
||||
comStub.dataOut -> frameAccumulator.dataIn
|
||||
frameAccumulator.dataReturnOut -> comStub.dataReturnIn
|
||||
# FrameAccumulator buffer allocations
|
||||
frameAccumulator.bufferDeallocate -> commsBufferManager.bufferSendIn
|
||||
frameAccumulator.bufferAllocate -> commsBufferManager.bufferGetCallee
|
||||
# FrameAccumulator <-> Deframer
|
||||
frameAccumulator.dataOut -> deframer.dataIn
|
||||
deframer.dataReturnOut -> frameAccumulator.dataReturnIn
|
||||
# Deframer <-> Router
|
||||
deframer.dataOut -> fprimeRouter.dataIn
|
||||
fprimeRouter.dataReturnOut -> deframer.dataReturnIn
|
||||
# Router buffer allocations
|
||||
fprimeRouter.bufferAllocate -> commsBufferManager.bufferGetCallee
|
||||
fprimeRouter.bufferDeallocate -> commsBufferManager.bufferSendIn
|
||||
}
|
||||
|
||||
|
||||
} # end topology
|
||||
} # end ComFprime Subtopology
|
||||
@ -0,0 +1,9 @@
|
||||
register_fprime_config(
|
||||
SOURCES
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ComFprimeSubtopologyConfig.cpp"
|
||||
HEADERS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ComFprimeSubtopologyConfig.hpp"
|
||||
AUTOCODER_INPUTS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ComFprimeConfig.fpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ComFprimeComDriverConfig.fpp"
|
||||
)
|
||||
@ -0,0 +1,28 @@
|
||||
module ComFprime {
|
||||
# Communications driver. May be swapped out with other comm drivers like UART in this file
|
||||
# to use another driver in the Comms Subtopology
|
||||
instance comDriver: Drv.TcpClient base id ComFprimeConfig.BASE_ID + 0x0B00 \
|
||||
{
|
||||
phase Fpp.ToCpp.Phases.configComponents """
|
||||
if (state.hostname != nullptr && state.port != 0) {
|
||||
ComFprime::comDriver.configure(state.hostname, state.port);
|
||||
}
|
||||
"""
|
||||
|
||||
phase Fpp.ToCpp.Phases.startTasks """
|
||||
// Initialize socket client communication if and only if there is a valid specification
|
||||
if (state.hostname != nullptr && state.port != 0) {
|
||||
Os::TaskString name("ReceiveTask");
|
||||
ComFprime::comDriver.start(name, ComFprimeConfig::Priorities::comDriver, ComFprimeConfig::StackSizes::comDriver);
|
||||
}
|
||||
"""
|
||||
|
||||
phase Fpp.ToCpp.Phases.stopTasks """
|
||||
ComFprime::comDriver.stop();
|
||||
"""
|
||||
|
||||
phase Fpp.ToCpp.Phases.freeThreads """
|
||||
(void)ComFprime::comDriver.join();
|
||||
"""
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
module ComFprimeConfig {
|
||||
#Base ID for the ComFprime Subtopology, all components are offsets from this base ID
|
||||
constant BASE_ID = 0x7000
|
||||
|
||||
module QueueSizes {
|
||||
constant comQueue = 10
|
||||
constant cmdSeq = 10
|
||||
}
|
||||
|
||||
module StackSizes {
|
||||
constant comQueue = 64 * 1024
|
||||
constant cmdSeq = 64 * 1024
|
||||
constant comDriver = 100
|
||||
}
|
||||
|
||||
module Priorities {
|
||||
constant comQueue = 101
|
||||
constant cmdSeq = 100
|
||||
constant comDriver = 100
|
||||
}
|
||||
|
||||
# Queue configuration constants
|
||||
module QueueDepths {
|
||||
constant events = 100
|
||||
constant tlm = 500
|
||||
constant file = 100
|
||||
}
|
||||
|
||||
module QueuePriorities {
|
||||
constant events = 0
|
||||
constant tlm = 2
|
||||
constant file = 1
|
||||
}
|
||||
|
||||
# Buffer management constants
|
||||
module BuffMgr {
|
||||
constant cmdSeqBuffSize = 5 * 1024
|
||||
constant frameAccumulatorSize = 2048
|
||||
constant commsBuffSize = 2048
|
||||
constant commsFileBuffSize = 3000
|
||||
constant commsBuffCount = 20
|
||||
constant commsFileBuffCount = 30
|
||||
constant commsBuffMgrId = 200
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
#include "ComFprimeSubtopologyConfig.hpp"
|
||||
|
||||
namespace ComFprime {
|
||||
namespace Allocation{
|
||||
//This instance can be changed to use a different allocator in the ComFprime Subtopology
|
||||
Fw::MallocAllocator mallocatorInstance;
|
||||
Fw::MemAllocator& memAllocator = mallocatorInstance;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
#ifndef COMFPRIMESUBTOPOLOGY_CONFIG_HPP
|
||||
#define COMFPRIMESUBTOPOLOGY_CONFIG_HPP
|
||||
|
||||
#include "Fw/Types/MallocAllocator.hpp"
|
||||
|
||||
namespace ComFprime {
|
||||
namespace Allocation {
|
||||
extern Fw::MemAllocator& memAllocator;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
8
Svc/Subtopologies/ComFprime/PingEntries.hpp
Normal file
8
Svc/Subtopologies/ComFprime/PingEntries.hpp
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef COMFPRIME_PINGENTRIES_HPP
|
||||
#define COMFPRIME_PINGENTRIES_HPP
|
||||
|
||||
namespace PingEntries {
|
||||
namespace ComFprime_cmdSeq {enum { WARN = 3, FATAL = 5 };}
|
||||
}
|
||||
|
||||
#endif
|
||||
20
Svc/Subtopologies/ComFprime/SubtopologyTopologyDefs.hpp
Normal file
20
Svc/Subtopologies/ComFprime/SubtopologyTopologyDefs.hpp
Normal file
@ -0,0 +1,20 @@
|
||||
#ifndef COMFPRIMESUBTOPOLOGY_DEFS_HPP
|
||||
#define COMFPRIMESUBTOPOLOGY_DEFS_HPP
|
||||
|
||||
#include <Svc/FrameAccumulator/FrameDetector/FprimeFrameDetector.hpp>
|
||||
#include <Fw/Types/MallocAllocator.hpp>
|
||||
#include <Svc/BufferManager/BufferManager.hpp>
|
||||
#include "Svc/Subtopologies/ComFprime/ComFprimeConfig/FppConstantsAc.hpp"
|
||||
#include "ComFprimeConfig/ComFprimeSubtopologyConfig.hpp"
|
||||
|
||||
namespace ComFprime {
|
||||
struct SubtopologyState {
|
||||
const char* hostname;
|
||||
U16 port;
|
||||
};
|
||||
|
||||
struct TopologyState {
|
||||
SubtopologyState comFprime;
|
||||
};
|
||||
}
|
||||
#endif
|
||||
12
Svc/Subtopologies/DataProducts/CMakeLists.txt
Normal file
12
Svc/Subtopologies/DataProducts/CMakeLists.txt
Normal file
@ -0,0 +1,12 @@
|
||||
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/DataProductsConfig/")
|
||||
|
||||
register_fprime_module(
|
||||
AUTOCODER_INPUTS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/DataProducts.fpp"
|
||||
HEADERS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/SubtopologyTopologyDefs.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/PingEntries.hpp"
|
||||
DEPENDS
|
||||
Svc_Subtopologies_DataProducts_DataProductsConfig
|
||||
INTERFACE
|
||||
)
|
||||
76
Svc/Subtopologies/DataProducts/DataProducts.fpp
Normal file
76
Svc/Subtopologies/DataProducts/DataProducts.fpp
Normal file
@ -0,0 +1,76 @@
|
||||
module DataProducts{
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Active Components
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
instance dpCat: Svc.DpCatalog base id DataProductsConfig.BASE_ID + 0x0100 \
|
||||
queue size DataProductsConfig.QueueSizes.dpCat \
|
||||
stack size DataProductsConfig.StackSizes.dpCat \
|
||||
priority DataProductsConfig.Priorities.dpCat \
|
||||
{
|
||||
phase Fpp.ToCpp.Phases.configComponents """
|
||||
Fw::FileNameString dpDir(DataProductsConfig::Paths::dpDir);
|
||||
Fw::FileNameString dpState(DataProductsConfig::Paths::dpState);
|
||||
Os::FileSystem::createDirectory(dpDir.toChar());
|
||||
DataProducts::dpCat.configure(&dpDir,1,dpState,0, DataProducts::Allocation::memAllocator);
|
||||
"""
|
||||
}
|
||||
|
||||
instance dpMgr: Svc.DpManager base id DataProductsConfig.BASE_ID + 0x0200 \
|
||||
queue size DataProductsConfig.QueueSizes.dpMgr \
|
||||
stack size DataProductsConfig.StackSizes.dpMgr \
|
||||
priority DataProductsConfig.Priorities.dpMgr
|
||||
|
||||
instance dpWriter: Svc.DpWriter base id DataProductsConfig.BASE_ID + 0x0300 \
|
||||
queue size DataProductsConfig.QueueSizes.dpWriter \
|
||||
stack size DataProductsConfig.StackSizes.dpWriter \
|
||||
priority DataProductsConfig.Priorities.dpWriter \
|
||||
{
|
||||
phase Fpp.ToCpp.Phases.configComponents """
|
||||
DataProducts::dpWriter.configure(dpDir);
|
||||
"""
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Passive Components
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
instance dpBufferManager: Svc.BufferManager base id DataProductsConfig.BASE_ID + 0x0400 \
|
||||
{
|
||||
phase Fpp.ToCpp.Phases.configObjects """
|
||||
Svc::BufferManager::BufferBins bins;
|
||||
"""
|
||||
phase Fpp.ToCpp.Phases.configComponents """
|
||||
memset(&ConfigObjects::DataProducts_dpBufferManager::bins, 0, sizeof(ConfigObjects::DataProducts_dpBufferManager::bins));
|
||||
ConfigObjects::DataProducts_dpBufferManager::bins.bins[0].bufferSize = DataProductsConfig::BuffMgr::dpBufferStoreSize;
|
||||
ConfigObjects::DataProducts_dpBufferManager::bins.bins[0].numBuffers = DataProductsConfig::BuffMgr::dpBufferStoreCount;
|
||||
DataProducts::dpBufferManager.setup(
|
||||
DataProductsConfig::BuffMgr::dpBufferManagerId,
|
||||
0,
|
||||
DataProducts::Allocation::memAllocator,
|
||||
ConfigObjects::DataProducts_dpBufferManager::bins
|
||||
);
|
||||
"""
|
||||
phase Fpp.ToCpp.Phases.tearDownComponents """
|
||||
DataProducts::dpCat.shutdown();
|
||||
DataProducts::dpBufferManager.cleanup();
|
||||
"""
|
||||
}
|
||||
topology Subtopology {
|
||||
#Active Components
|
||||
instance dpCat
|
||||
instance dpMgr
|
||||
instance dpWriter
|
||||
|
||||
#Passive Components
|
||||
instance dpBufferManager
|
||||
|
||||
connections DataProducts {
|
||||
# DpMgr and DpWriter connections. Have explicit port indexes for demo
|
||||
dpMgr.bufferGetOut[0] -> dpBufferManager.bufferGetCallee
|
||||
dpMgr.productSendOut[0] -> dpWriter.bufferSendIn
|
||||
dpWriter.deallocBufferSendOut -> dpBufferManager.bufferSendIn
|
||||
}
|
||||
} # end topology
|
||||
} # end DataProducts Subtopology
|
||||
@ -0,0 +1,10 @@
|
||||
register_fprime_config(
|
||||
SOURCES
|
||||
"${CMAKE_CURRENT_LIST_DIR}/DataProductsSubtopologyConfig.cpp"
|
||||
HEADERS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/DataProductsSubtopologyConfig.hpp"
|
||||
AUTOCODER_INPUTS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/DataProductsConfig.fpp"
|
||||
DEPENDS
|
||||
Fw_Types
|
||||
)
|
||||
@ -0,0 +1,39 @@
|
||||
module DataProductsConfig {
|
||||
#Base ID for the DataProducts Subtopology, all components are offsets from this base ID
|
||||
constant BASE_ID = 0x9000
|
||||
|
||||
module QueueSizes {
|
||||
constant dpCat = 10
|
||||
constant dpMgr = 10
|
||||
constant dpWriter = 10
|
||||
constant dpBufferManager = 10
|
||||
}
|
||||
|
||||
|
||||
module StackSizes {
|
||||
constant dpCat = 64 * 1024
|
||||
constant dpMgr = 64 * 1024
|
||||
constant dpWriter = 64 * 1024
|
||||
constant dpBufferManager = 64 * 1024
|
||||
}
|
||||
|
||||
module Priorities {
|
||||
constant dpCat = 101
|
||||
constant dpMgr = 100
|
||||
constant dpWriter = 99
|
||||
constant dpBufferManager = 98
|
||||
}
|
||||
|
||||
# Buffer management constants
|
||||
module BuffMgr {
|
||||
constant dpBufferStoreSize = 10000
|
||||
constant dpBufferStoreCount = 10
|
||||
constant dpBufferManagerId = 300
|
||||
}
|
||||
|
||||
# Directory and file paths
|
||||
module Paths {
|
||||
constant dpDir = "./DpCat"
|
||||
constant dpState = "./DpCat/DpState.dat"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
#include "DataProductsSubtopologyConfig.hpp"
|
||||
|
||||
namespace DataProducts {
|
||||
namespace Allocation{
|
||||
//This instance can be changed to use a different allocator in the DataProducts Subtopology
|
||||
Fw::MallocAllocator mallocatorInstance;
|
||||
Fw::MemAllocator& memAllocator = mallocatorInstance;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
#ifndef DATAPRODUCTSSUBTOPOLOGY_CONFIG_HPP
|
||||
#define DATAPRODUCTSSUBTOPOLOGY_CONFIG_HPP
|
||||
|
||||
#include "Fw/Types/MallocAllocator.hpp"
|
||||
|
||||
namespace DataProducts {
|
||||
namespace Allocation {
|
||||
extern Fw::MemAllocator& memAllocator;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
8
Svc/Subtopologies/DataProducts/PingEntries.hpp
Normal file
8
Svc/Subtopologies/DataProducts/PingEntries.hpp
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef DATAPRODUCTS_PINGENTRIES_HPP
|
||||
#define DATAPRODUCTS_PINGENTRIES_HPP
|
||||
|
||||
namespace PingEntries {
|
||||
namespace DataProducts_dpCat {enum { WARN = 3, FATAL = 5 };}
|
||||
}
|
||||
|
||||
#endif
|
||||
16
Svc/Subtopologies/DataProducts/SubtopologyTopologyDefs.hpp
Normal file
16
Svc/Subtopologies/DataProducts/SubtopologyTopologyDefs.hpp
Normal file
@ -0,0 +1,16 @@
|
||||
#ifndef DATAPRODUCTSSUBTOPOLOGY_DEFS_HPP
|
||||
#define DATAPRODUCTSSUBTOPOLOGY_DEFS_HPP
|
||||
|
||||
#include <Fw/Types/MallocAllocator.hpp>
|
||||
#include <Svc/BufferManager/BufferManager.hpp>
|
||||
#include <Os/FileSystem.hpp>
|
||||
#include "Svc/Subtopologies/DataProducts/DataProductsConfig/FppConstantsAc.hpp"
|
||||
#include "DataProductsConfig/DataProductsSubtopologyConfig.hpp"
|
||||
|
||||
namespace DataProducts {
|
||||
// State for topology construction
|
||||
struct TopologyState {
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
12
Svc/Subtopologies/FileHandling/CMakeLists.txt
Normal file
12
Svc/Subtopologies/FileHandling/CMakeLists.txt
Normal file
@ -0,0 +1,12 @@
|
||||
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/FileHandlingConfig/")
|
||||
|
||||
register_fprime_module(
|
||||
AUTOCODER_INPUTS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/FileHandling.fpp"
|
||||
HEADERS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/SubtopologyTopologyDefs.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/PingEntries.hpp"
|
||||
INTERFACE
|
||||
DEPENDS
|
||||
Svc_Subtopologies_FileHandling_FileHandlingConfig
|
||||
)
|
||||
56
Svc/Subtopologies/FileHandling/FileHandling.fpp
Normal file
56
Svc/Subtopologies/FileHandling/FileHandling.fpp
Normal file
@ -0,0 +1,56 @@
|
||||
module FileHandling {
|
||||
|
||||
enum Ports_ComBufferQueue {
|
||||
FILE_DOWNLINK
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Active Components
|
||||
# ----------------------------------------------------------------------
|
||||
instance fileUplink: Svc.FileUplink base id FileHandlingConfig.BASE_ID + 0x0100 \
|
||||
queue size FileHandlingConfig.QueueSizes.fileUplink \
|
||||
stack size FileHandlingConfig.StackSizes.fileUplink \
|
||||
priority FileHandlingConfig.Priorities.fileUplink
|
||||
|
||||
instance fileDownlink: Svc.FileDownlink base id FileHandlingConfig.BASE_ID + 0x0200 \
|
||||
queue size FileHandlingConfig.QueueSizes.fileDownlink \
|
||||
stack size FileHandlingConfig.StackSizes.fileDownlink \
|
||||
priority FileHandlingConfig.Priorities.fileDownlink \
|
||||
{
|
||||
phase Fpp.ToCpp.Phases.configComponents """
|
||||
FileHandling::fileDownlink.configure(
|
||||
FileHandlingConfig::DownlinkConfig::timeout,
|
||||
FileHandlingConfig::DownlinkConfig::cooldown,
|
||||
FileHandlingConfig::DownlinkConfig::cycleTime,
|
||||
FileHandlingConfig::DownlinkConfig::fileQueueDepth
|
||||
);
|
||||
"""
|
||||
}
|
||||
|
||||
instance fileManager: Svc.FileManager base id FileHandlingConfig.BASE_ID + 0x0300 \
|
||||
queue size FileHandlingConfig.QueueSizes.fileManager \
|
||||
stack size FileHandlingConfig.StackSizes.fileManager \
|
||||
priority FileHandlingConfig.Priorities.fileManager
|
||||
|
||||
instance prmDb: Svc.PrmDb base id FileHandlingConfig.BASE_ID + 0x0400 \
|
||||
queue size FileHandlingConfig.QueueSizes.prmDb \
|
||||
stack size FileHandlingConfig.StackSizes.prmDb \
|
||||
priority FileHandlingConfig.Priorities.prmDb \
|
||||
{
|
||||
phase Fpp.ToCpp.Phases.configComponents """
|
||||
FileHandling::prmDb.configure("PrmDb.dat");
|
||||
"""
|
||||
phase Fpp.ToCpp.Phases.readParameters """
|
||||
FileHandling::prmDb.readParamFile();
|
||||
"""
|
||||
}
|
||||
|
||||
topology Subtopology {
|
||||
#Active Components
|
||||
instance fileUplink
|
||||
instance fileDownlink
|
||||
instance fileManager
|
||||
instance prmDb
|
||||
|
||||
} # end topology
|
||||
} # end FileHandling Subtopology
|
||||
@ -0,0 +1,5 @@
|
||||
register_fprime_config(
|
||||
AUTOCODER_INPUTS
|
||||
"${CMAKE_CURRENT_LIST_DIR}/FileHandlingConfig.fpp"
|
||||
INTERFACE
|
||||
)
|
||||
@ -0,0 +1,33 @@
|
||||
module FileHandlingConfig {
|
||||
#Base ID for the FileHandling Subtopology, all components are offsets from this base ID
|
||||
constant BASE_ID = 0xA000
|
||||
|
||||
module QueueSizes {
|
||||
constant fileUplink = 10
|
||||
constant fileDownlink = 10
|
||||
constant fileManager = 10
|
||||
constant prmDb = 10
|
||||
}
|
||||
|
||||
module StackSizes {
|
||||
constant fileUplink = 64 * 1024
|
||||
constant fileDownlink = 64 * 1024
|
||||
constant fileManager = 64 * 1024
|
||||
constant prmDb = 64 * 1024
|
||||
}
|
||||
|
||||
module Priorities {
|
||||
constant fileUplink = 101
|
||||
constant fileDownlink = 100
|
||||
constant fileManager = 99
|
||||
constant prmDb = 98
|
||||
}
|
||||
|
||||
# File downlink configuration constants
|
||||
module DownlinkConfig {
|
||||
constant timeout = 1000 # File downlink timeout in ms
|
||||
constant cooldown = 1000 # File downlink cooldown in ms
|
||||
constant cycleTime = 1000 # File downlink cycle time in ms
|
||||
constant fileQueueDepth = 10 # File downlink queue depth
|
||||
}
|
||||
}
|
||||
11
Svc/Subtopologies/FileHandling/PingEntries.hpp
Normal file
11
Svc/Subtopologies/FileHandling/PingEntries.hpp
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef FILEHANDLING_PINGENTRIES_HPP
|
||||
#define FILEHANDLING_PINGENTRIES_HPP
|
||||
|
||||
namespace PingEntries {
|
||||
namespace FileHandling_fileDownlink {enum { WARN = 3, FATAL = 5 };}
|
||||
namespace FileHandling_fileManager {enum { WARN = 3, FATAL = 5 };}
|
||||
namespace FileHandling_fileUplink {enum { WARN = 3, FATAL = 5 };}
|
||||
namespace FileHandling_prmDb {enum { WARN = 3, FATAL = 5 };}
|
||||
}
|
||||
|
||||
#endif
|
||||
11
Svc/Subtopologies/FileHandling/SubtopologyTopologyDefs.hpp
Normal file
11
Svc/Subtopologies/FileHandling/SubtopologyTopologyDefs.hpp
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef FILEHANDLINGSUBTOPOLOGY_DEFS_HPP
|
||||
#define FILEHANDLINGSUBTOPOLOGY_DEFS_HPP
|
||||
|
||||
#include "Svc/Subtopologies/FileHandling/FileHandlingConfig/FppConstantsAc.hpp"
|
||||
namespace FileHandling {
|
||||
// State for topology construction
|
||||
struct TopologyState {
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -31,4 +31,4 @@ add_fprime_subdirectory(./TestRelative)
|
||||
|
||||
set(SOURCE_FILES "${CMAKE_CURRENT_LIST_DIR}/Main.cpp")
|
||||
set(MOD_DEPS Svc_CmdDispatcher TestLibrary_TestComponent TestLibrary2_TestComponent)
|
||||
register_fprime_deployment()
|
||||
register_fprime_deployment()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user