diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index 00a65c8ec96..2e7cc6ad5b2 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -21,8 +21,6 @@ arduino ARef argcomplete ARGN -argname -argtype ARINC arpa ASize @@ -40,8 +38,6 @@ bfree bibtex Bies BINDIR -binrel -Bitfields bitmaps bocchino boolt @@ -70,6 +66,7 @@ CComponent ccsds ccsparc CDH +CDHCORE cerrno CFDP cff @@ -82,13 +79,11 @@ CHIPINFO CHK CHNG CIRCULARSTATE -classdiagram CLOSEFILE cloudbees CMDDISP CMDDISPATCHER CMDPACKET -CMDREG cmdresponse cmdseq cmdsequencer @@ -224,7 +219,6 @@ FONTPATH foodoodie foodoodiehoo FPCONFIG -FPL fpp fppi fpptest @@ -292,7 +286,6 @@ ieeetr iflag ifstr imple -importables inbool INCLUDEDIR initstate @@ -345,11 +338,6 @@ LINEEVENT LINEHANDLE linelength lineoffset -lineroo -linux -listdir -Listst -LJR lld llu LOCALSTATEDIR @@ -371,7 +359,6 @@ MCT MDFILE MEMALLOCATOR MEMB -membername memcheck MEMTEST mentations @@ -401,11 +388,7 @@ NACI nasafprime nbits ncsl -ndiffs -neascout netinet -newloc -newroot newtio nmsgs NOBLOCK @@ -465,6 +448,7 @@ pdflatex PEB penv PERLMOD +PINGENTRIES PINGSEND pkill PKTS @@ -538,14 +522,10 @@ RGD RHH Rizvi ROOTDIR -ror -rowspan -rpaetz rpi RPIDEMO RPIDEMOCOMPONENTIMPLCFG rptr -RSend RXD SAlias sanitizers @@ -612,7 +592,6 @@ subgrouping subhist subhistory subseconds -subtargets subtopology suppr suseconds @@ -662,11 +641,8 @@ TLMPACKET TLMPACKETIZER TLMPACKETIZERCOMPONENTIMPLCFG TLMPACKETIZERTYPES -tmpl -tmptree TODOLIST TOKENBUCKETTESTER -topologyapp topologydefs totalram tparam diff --git a/Ref/Top/RefPackets.fppi b/Ref/Top/RefPackets.fppi index 526400ffd76..13805b7b18c 100644 --- a/Ref/Top/RefPackets.fppi +++ b/Ref/Top/RefPackets.fppi @@ -1,7 +1,7 @@ telemetry packets RefPackets { packet CDH id 1 group 1 { - Ref.cmdDisp.CommandsDispatched + CDHCore.cmdDisp.CommandsDispatched Ref.rateGroup1Comp.RgMaxTime Ref.rateGroup2Comp.RgMaxTime Ref.rateGroup3Comp.RgMaxTime @@ -19,7 +19,7 @@ telemetry packets RefPackets { Ref.fileManager.CommandsExecuted Ref.comQueue.comQueueDepth Ref.comQueue.buffQueueDepth - # Ref.tlmSend.SendLevel + #CDHCore.tlmSend.SendLevel } packet CDHErrors id 2 group 1 { @@ -29,7 +29,7 @@ telemetry packets RefPackets { Ref.cmdSeq.CS_Errors Ref.fileUplink.Warnings Ref.fileDownlink.Warnings - Ref.$health.PingLateWarnings + CDHCore.$health.PingLateWarnings Ref.fileManager.Errors Ref.commsBufferManager.NoBuffs Ref.commsBufferManager.EmptyBuffs @@ -194,75 +194,75 @@ telemetry packets RefPackets { } packet Version1 id 22 group 2 { - Ref.version.FrameworkVersion - Ref.version.ProjectVersion + CDHCore.version.FrameworkVersion + CDHCore.version.ProjectVersion } packet Version_Library1 id 23 group 2 { - Ref.version.LibraryVersion01 - Ref.version.LibraryVersion02 + CDHCore.version.LibraryVersion01 + CDHCore.version.LibraryVersion02 } packet Version_Library2 id 24 group 2 { - Ref.version.LibraryVersion03 - Ref.version.LibraryVersion04 + CDHCore.version.LibraryVersion03 + CDHCore.version.LibraryVersion04 } packet Version_Library3 id 25 group 2 { - Ref.version.LibraryVersion05 - Ref.version.LibraryVersion06 + CDHCore.version.LibraryVersion05 + CDHCore.version.LibraryVersion06 } packet Version_Library4 id 26 group 2 { - Ref.version.LibraryVersion07 - Ref.version.LibraryVersion08 + CDHCore.version.LibraryVersion07 + CDHCore.version.LibraryVersion08 } packet Version_Library5 id 27 group 2 { - Ref.version.LibraryVersion09 - Ref.version.LibraryVersion10 + CDHCore.version.LibraryVersion09 + CDHCore.version.LibraryVersion10 } packet Version_Custom1 id 28 group 2 { - Ref.version.CustomVersion01 + CDHCore.version.CustomVersion01 } packet Version_Custom2 id 29 group 2 { - Ref.version.CustomVersion02 + CDHCore.version.CustomVersion02 } packet Version_Custom3 id 30 group 2 { - Ref.version.CustomVersion03 + CDHCore.version.CustomVersion03 } packet Version_Custom4 id 31 group 2 { - Ref.version.CustomVersion04 + CDHCore.version.CustomVersion04 } packet Version_Custom5 id 32 group 2 { - Ref.version.CustomVersion05 + CDHCore.version.CustomVersion05 } packet Version_Custom6 id 33 group 2 { - Ref.version.CustomVersion06 + CDHCore.version.CustomVersion06 } packet Version_Custom7 id 34 group 2 { - Ref.version.CustomVersion07 + CDHCore.version.CustomVersion07 } packet Version_Custom8 id 35 group 2 { - Ref.version.CustomVersion08 + CDHCore.version.CustomVersion08 } packet Version_Custom9 id 36 group 2 { - Ref.version.CustomVersion09 + CDHCore.version.CustomVersion09 } packet Version_Custom10 id 37 group 2 { - Ref.version.CustomVersion10 + CDHCore.version.CustomVersion10 } } omit { - Ref.cmdDisp.CommandErrors -} + CDHCore.cmdDisp.CommandErrors +} \ No newline at end of file diff --git a/Ref/Top/RefTopology.cpp b/Ref/Top/RefTopology.cpp index c248b99150a..01a640ab8f4 100644 --- a/Ref/Top/RefTopology.cpp +++ b/Ref/Top/RefTopology.cpp @@ -34,7 +34,6 @@ Fw::MallocAllocator mallocator; // 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}}}; @@ -54,7 +53,6 @@ enum TopologyConstants { FILE_DOWNLINK_COOLDOWN = 1000, FILE_DOWNLINK_CYCLE_TIME = 1000, FILE_DOWNLINK_FILE_QUEUE_DEPTH = 10, - HEALTH_WATCHDOG_CODE = 0x123, COMM_PRIORITY = 100, // Buffer manager for Uplink/Downlink COMMS_BUFFER_MANAGER_STORE_SIZE = 2048, @@ -95,10 +93,6 @@ void configureTopology() { prmDb.configure("PrmDb.dat"); prmDb.readParamFile(); - // Health is supplied a set of ping entires. - health.setPingEntries(ConfigObjects::Ref_health::pingEntries, - FW_NUM_ARRAY_ELEMENTS(ConfigObjects::Ref_health::pingEntries), HEALTH_WATCHDOG_CODE); - // 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)); @@ -137,9 +131,6 @@ void configureTopology() { configurationTable.entries[Ref::Ports_ComPacketQueue::NUM_CONSTANTS].priority = 1; // Allocation identifier is 0 as the MallocAllocator discards it comQueue.configure(configurationTable, 0, mallocator); - - // Note: Uncomment when using Svc:TlmPacketizer - // tlmSend.setPacketList(Ref::Ref_RefPacketsTlmPackets::packetList, Ref::Ref_RefPacketsTlmPackets::omittedChannels, 1); } // Public functions for use in main program are namespaced with deployment name Ref @@ -164,8 +155,6 @@ void setupTopology(const TopologyState& state) { loadParameters(); // Autocoded task kick-off (active components). Function provided by autocoder. startTasks(state); - // Startup TLM and Config verbosity for Versions - version.config(true); // Initialize socket client communication if and only if there is a valid specification if (state.hostname != nullptr && state.port != 0) { Os::TaskString name("ReceiveTask"); diff --git a/Ref/Top/RefTopologyDefs.hpp b/Ref/Top/RefTopologyDefs.hpp index 878f3201eee..2907f626048 100644 --- a/Ref/Top/RefTopologyDefs.hpp +++ b/Ref/Top/RefTopologyDefs.hpp @@ -16,21 +16,8 @@ #include "Ref/Top/FppConstantsAc.hpp" #include "Svc/Health/Health.hpp" -// 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; - U16 port; -}; +// Subtopology PingEntries includes +#include "Svc/Subtopologies/CDHCore/PingEntries.hpp" /** * \brief required ping constants @@ -52,48 +39,35 @@ struct TopologyState { * ``` */ namespace PingEntries { -namespace Ref_blockDrv { -enum { WARN = 3, FATAL = 5 }; -} -namespace Ref_tlmSend { -enum { WARN = 3, FATAL = 5 }; -} -namespace Ref_cmdDisp { -enum { WARN = 3, FATAL = 5 }; -} -namespace Ref_cmdSeq { -enum { WARN = 3, FATAL = 5 }; -} -namespace Ref_eventLogger { -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 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 { + + /** + * \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; + U16 port; + }; + + namespace PingEntries = ::PingEntries; } // namespace Ref #endif diff --git a/Ref/Top/instances.fpp b/Ref/Top/instances.fpp index e864230fea5..dc1ed382cfa 100644 --- a/Ref/Top/instances.fpp +++ b/Ref/Top/instances.fpp @@ -33,90 +33,65 @@ module Ref { stack size Default.STACK_SIZE \ priority 118 - instance cmdDisp: Svc.CommandDispatcher base id 0x0500 \ - queue size 20 \ - stack size Default.STACK_SIZE \ - priority 101 - - instance cmdSeq: Svc.CmdSequencer base id 0x0600 \ + instance cmdSeq: Svc.CmdSequencer base id 0x0500 \ queue size Default.QUEUE_SIZE \ stack size Default.STACK_SIZE \ priority 100 - instance fileDownlink: Svc.FileDownlink base id 0x0700 \ + instance fileDownlink: Svc.FileDownlink base id 0x0600 \ queue size 30 \ stack size Default.STACK_SIZE \ priority 100 - instance fileManager: Svc.FileManager base id 0x0800 \ + instance fileManager: Svc.FileManager base id 0x0700 \ queue size 30 \ stack size Default.STACK_SIZE \ priority 100 - instance fileUplink: Svc.FileUplink base id 0x0900 \ + instance fileUplink: Svc.FileUplink base id 0x0800 \ queue size 30 \ stack size Default.STACK_SIZE \ priority 100 - instance pingRcvr: Ref.PingReceiver base id 0x0A00 \ + instance pingRcvr: Ref.PingReceiver base id 0x0900 \ queue size Default.QUEUE_SIZE \ stack size Default.STACK_SIZE \ priority 100 - instance eventLogger: Svc.ActiveLogger base id 0x0B00 \ - queue size Default.QUEUE_SIZE \ - stack size Default.STACK_SIZE \ - priority 98 - - # comment in Svc.TlmChan or Svc.TlmPacketizer - # depending on which form of telemetry downlink - # you wish to use - - instance tlmSend: Svc.TlmChan base id 0x0C00 \ - queue size Default.QUEUE_SIZE \ - stack size Default.STACK_SIZE \ - priority 97 - -# instance tlmSend: Svc.TlmPacketizer base id 0x0C00 \ -# queue size Default.QUEUE_SIZE \ -# stack size Default.STACK_SIZE \ -# priority 97 - - instance prmDb: Svc.PrmDb base id 0x0D00 \ + 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 0x0E00 \ + 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 0x0F00 \ + 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 0x1000 \ + 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 0x1100 \ + instance comQueue: Svc.ComQueue base id 0x0E00 \ queue size 50 \ stack size Default.STACK_SIZE \ priority 100 - - instance typeDemo: Ref.TypeDemo base id 0x1200 + instance typeDemo: Ref.TypeDemo base id 0x0F00 # ---------------------------------------------------------------------- # Queued component instances # ---------------------------------------------------------------------- - instance $health: Svc.Health base id 0x2000 \ - queue size 25 + instance sendBuffComp: Ref.SendBuff base id 0x2000 \ + queue size Default.QUEUE_SIZE instance SG1: Ref.SignalGen base id 0x2100 \ queue size Default.QUEUE_SIZE @@ -133,11 +108,6 @@ module Ref { instance SG5: Ref.SignalGen base id 0x2500 \ queue size Default.QUEUE_SIZE - instance sendBuffComp: Ref.SendBuff base id 0x2600 \ - queue size Default.QUEUE_SIZE - - - # ---------------------------------------------------------------------- # Passive component instances # ---------------------------------------------------------------------- @@ -145,43 +115,37 @@ module Ref { @ Communications driver. May be swapped with other comm drivers like UART instance comDriver: Drv.TcpClient base id 0x4000 - instance fatalAdapter: Svc.AssertFatalAdapter base id 0x4100 - - instance fatalHandler: Svc.FatalHandler base id 0x4200 + instance fatalHandler: Svc.FatalHandler base id 0x4100 - instance commsBufferManager: Svc.BufferManager base id 0x4300 + instance commsBufferManager: Svc.BufferManager base id 0x4200 - instance posixTime: Svc.PosixTime base id 0x4400 + instance posixTime: Svc.PosixTime base id 0x4300 - instance rateGroupDriverComp: Svc.RateGroupDriver base id 0x4500 + instance rateGroupDriverComp: Svc.RateGroupDriver base id 0x4400 - instance recvBuffComp: Ref.RecvBuff base id 0x4600 + instance recvBuffComp: Ref.RecvBuff base id 0x4500 - instance version: Svc.Version base id 0x4700 + instance systemResources: Svc.SystemResources base id 0x4600 - instance textLogger: Svc.PassiveTextLogger base id 0x4800 + instance dpBufferManager: Svc.BufferManager base id 0x4700 - instance systemResources: Svc.SystemResources base id 0x4900 + instance frameAccumulator: Svc.FrameAccumulator base id 0x4800 - instance dpBufferManager: Svc.BufferManager base id 0x4A00 + instance tcDeframer: Svc.CCSDS.TcDeframer base id 0x4900 - instance frameAccumulator: Svc.FrameAccumulator base id 0x4B00 + instance spacePacketDeframer: Svc.CCSDS.SpacePacketDeframer base id 0x4A00 - instance tcDeframer: Svc.CCSDS.TcDeframer base id 0x4C00 + instance tmFramer: Svc.CCSDS.TmFramer base id 0x4B00 - instance spacePacketDeframer: Svc.CCSDS.SpacePacketDeframer base id 0x4D00 + instance spacePacketFramer: Svc.CCSDS.SpacePacketFramer base id 0x4C00 - instance tmFramer: Svc.CCSDS.TmFramer base id 0x4E00 + instance fprimeRouter: Svc.FprimeRouter base id 0x4D00 - instance spacePacketFramer: Svc.CCSDS.SpacePacketFramer base id 0x4F00 + instance apidManager: Svc.CCSDS.ApidManager base id 0x4E00 - instance fprimeRouter: Svc.FprimeRouter base id 0x5000 + instance comStub: Svc.ComStub base id 0x4F00 - instance apidManager: Svc.CCSDS.ApidManager base id 0x5100 + instance linuxTimer: Svc.LinuxTimer base id 0x5000 - instance comStub: Svc.ComStub base id 0x5200 - - instance linuxTimer: Svc.LinuxTimer base id 0x5300 } - diff --git a/Ref/Top/topology.fpp b/Ref/Top/topology.fpp index 14e04c966bb..c4d50933154 100644 --- a/Ref/Top/topology.fpp +++ b/Ref/Top/topology.fpp @@ -20,20 +20,21 @@ module Ref { } topology Ref { + # ---------------------------------------------------------------------- + # Subtopology imports + # ---------------------------------------------------------------------- + import CDHCore.Subtopology # ---------------------------------------------------------------------- # Instances used in the topology # ---------------------------------------------------------------------- - instance $health instance SG1 instance SG2 instance SG3 instance SG4 instance SG5 instance blockDrv - instance tlmSend - instance cmdDisp instance cmdSeq instance comDriver instance comStub @@ -42,9 +43,6 @@ module Ref { instance spacePacketDeframer instance tmFramer instance spacePacketFramer - instance eventLogger - instance fatalAdapter - instance fatalHandler instance fileDownlink instance fileManager instance fileUplink @@ -61,33 +59,32 @@ module Ref { instance recvBuffComp instance fprimeRouter instance sendBuffComp - instance textLogger instance typeDemo instance systemResources instance dpCat instance dpMgr instance dpWriter instance dpBufferManager - instance version instance linuxTimer + instance fatalHandler # ---------------------------------------------------------------------- # Pattern graph specifiers # ---------------------------------------------------------------------- - command connections instance cmdDisp + command connections instance CDHCore.cmdDisp - event connections instance eventLogger + event connections instance CDHCore.events - param connections instance prmDb + telemetry connections instance CDHCore.tlmSend - telemetry connections instance tlmSend + health connections instance CDHCore.$health - text event connections instance textLogger + text event connections instance CDHCore.textLogger - time connections instance posixTime + param connections instance prmDb - health connections instance $health + time connections instance posixTime # ---------------------------------------------------------------------- # Telemetry packets @@ -104,8 +101,8 @@ module Ref { dpCat.fileOut -> fileDownlink.SendFile fileDownlink.FileComplete -> dpCat.fileDone # Inputs to ComQueue (events, telemetry, file) - eventLogger.PktSend -> comQueue.comPacketQueueIn[Ports_ComPacketQueue.EVENTS] - tlmSend.PktSend -> comQueue.comPacketQueueIn[Ports_ComPacketQueue.TELEMETRY] + 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 @@ -131,10 +128,6 @@ module Ref { spacePacketFramer.comStatusOut -> comQueue.comStatusIn } - connections FaultProtection { - eventLogger.FatalAnnounce -> fatalHandler.FatalReceive - } - connections RateGroups { # Linux timer to drive cycle @@ -144,7 +137,7 @@ module Ref { rateGroupDriverComp.CycleOut[Ports_RateGroups.rateGroup1] -> rateGroup1Comp.CycleIn rateGroup1Comp.RateGroupMemberOut[0] -> SG1.schedIn rateGroup1Comp.RateGroupMemberOut[1] -> SG2.schedIn - rateGroup1Comp.RateGroupMemberOut[2] -> tlmSend.Run + rateGroup1Comp.RateGroupMemberOut[2] -> CDHCore.tlmSend.Run rateGroup1Comp.RateGroupMemberOut[3] -> fileDownlink.Run rateGroup1Comp.RateGroupMemberOut[4] -> systemResources.run rateGroup1Comp.RateGroupMemberOut[5] -> comQueue.run @@ -158,7 +151,7 @@ module Ref { # Rate group 3 rateGroupDriverComp.CycleOut[Ports_RateGroups.rateGroup3] -> rateGroup3Comp.CycleIn - rateGroup3Comp.RateGroupMemberOut[0] -> $health.Run + rateGroup3Comp.RateGroupMemberOut[0] -> CDHCore.$health.Run rateGroup3Comp.RateGroupMemberOut[1] -> SG5.schedIn rateGroup3Comp.RateGroupMemberOut[2] -> blockDrv.Sched rateGroup3Comp.RateGroupMemberOut[3] -> commsBufferManager.schedIn @@ -173,8 +166,8 @@ module Ref { } connections Sequencer { - cmdSeq.comCmdOut -> cmdDisp.seqCmdBuff - cmdDisp.seqCmdStatus -> cmdSeq.cmdResponseIn + cmdSeq.comCmdOut -> CDHCore.cmdDisp.seqCmdBuff + CDHCore.cmdDisp.seqCmdStatus -> cmdSeq.cmdResponseIn } connections Uplink { @@ -205,8 +198,8 @@ module Ref { fprimeRouter.bufferAllocate -> commsBufferManager.bufferGetCallee fprimeRouter.bufferDeallocate -> commsBufferManager.bufferSendIn # Router <-> CmdDispatcher/FileUplink - fprimeRouter.commandOut -> cmdDisp.seqCmdBuff - cmdDisp.seqCmdStatus -> fprimeRouter.cmdResponseIn + fprimeRouter.commandOut -> CDHCore.cmdDisp.seqCmdBuff + CDHCore.cmdDisp.seqCmdStatus -> fprimeRouter.cmdResponseIn fprimeRouter.fileOut -> fileUplink.bufferSendIn fileUplink.bufferSendOut -> fprimeRouter.fileBufferReturnIn } @@ -229,6 +222,10 @@ module Ref { } + connections FaultProtection { + CDHCore.events.FatalAnnounce -> fatalHandler.FatalReceive + } + } -} +} \ No newline at end of file diff --git a/Ref/test/int/ref_integration_test.py b/Ref/test/int/ref_integration_test.py index 3db982d670d..9827a46a0d0 100644 --- a/Ref/test/int/ref_integration_test.py +++ b/Ref/test/int/ref_integration_test.py @@ -1,4 +1,4 @@ -""" ref_integration_test.py: +"""ref_integration_test.py: A set of integration tests to apply to the Ref app. This is intended to be a reference of integration testing. """ @@ -57,7 +57,7 @@ def set_event_filter(fprime_test_api, severity, enabled): severity = FilterSeverity[severity].name try: fprime_test_api.send_command( - "Ref.eventLogger.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("Ref.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("Ref.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 @@ -93,10 +93,12 @@ 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("Ref.cmdDisp.NoOpStringReceived", [value]) + fprime_test_api.get_event_pred( + "CDHCore.cmdDisp.NoOpStringReceived", [value] + ) ] fprime_test_api.send_and_assert_command( - "Ref.cmdDisp.CMD_NO_OP_STRING", + "CDHCore.cmdDisp.CMD_NO_OP_STRING", [ value, ], @@ -115,15 +117,15 @@ def test_send_and_assert_no_op(fprime_test_api): length = 100 failed = 0 evr_seq = [ - "Ref.cmdDisp.OpCodeDispatched", - "Ref.cmdDisp.NoOpReceived", - "Ref.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( - "Ref.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): @@ -230,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("Ref.cmdDisp.CMD_NO_OP") - fprime_test_api.send_and_assert_command("Ref.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) @@ -242,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("Ref.cmdDisp.CMD_NO_OP") - fprime_test_api.send_command("Ref.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) diff --git a/Ref/test/int/test_seq.seq b/Ref/test/int/test_seq.seq index c80b1f5578d..bc45caf026e 100644 --- a/Ref/test/int/test_seq.seq +++ b/Ref/test/int/test_seq.seq @@ -1,6 +1,6 @@ ; A test sequence ; -R00:00:00 Ref.cmdDisp.CMD_NO_OP +R00:00:00 CDHCore.cmdDisp.CMD_NO_OP ; Let's try out some commands with arguments -R00:00:01.050 Ref.cmdDisp.CMD_NO_OP_STRING "Awesome string!"; \ No newline at end of file +R00:00:01.050 CDHCore.cmdDisp.CMD_NO_OP_STRING "Awesome string!"; diff --git a/Svc/CMakeLists.txt b/Svc/CMakeLists.txt index c07f023f863..eacfff3e97c 100644 --- a/Svc/CMakeLists.txt +++ b/Svc/CMakeLists.txt @@ -54,6 +54,9 @@ add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/TlmChan/") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/TlmPacketizer/") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/SystemResources/") +# Subtopologies +add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Subtopologies/") + # Text logger components included by default, # but can be disabled if FW_ENABLE_TEXT_LOGGING=0 is desired. if (FPRIME_ENABLE_TEXT_LOGGERS) diff --git a/Svc/Subtopologies/CDHCore/CDHCore.fpp b/Svc/Subtopologies/CDHCore/CDHCore.fpp new file mode 100644 index 00000000000..b362379b9ad --- /dev/null +++ b/Svc/Subtopologies/CDHCore/CDHCore.fpp @@ -0,0 +1,66 @@ +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 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 \ + { + phase Fpp.ToCpp.Phases.configConstants """ + enum { + HEALTH_WATCHDOG_CODE = 0x123 + }; + """ + 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 + ); + """ + } + + # ---------------------------------------------------------------------- + # Passive Components + # ---------------------------------------------------------------------- + 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); + """ + } + + instance textLogger: Svc.PassiveTextLogger base id CDHCoreConfig.BASE_ID + 0x0500 + + instance fatalAdapter: Svc.AssertFatalAdapter base id CDHCoreConfig.BASE_ID + 0x0600 + + topology Subtopology { + #Active Components + instance cmdDisp + instance events + instance tlmSend + + #Queued Components + instance $health + + #Passive Components + instance version + instance textLogger + instance fatalAdapter + + } # end topology +} # end CDHCore Subtopology \ No newline at end of file diff --git a/Svc/Subtopologies/CDHCore/CDHCoreConfig/CDHCoreConfig.fpp b/Svc/Subtopologies/CDHCore/CDHCoreConfig/CDHCoreConfig.fpp new file mode 100644 index 00000000000..265cb98aab2 --- /dev/null +++ b/Svc/Subtopologies/CDHCore/CDHCoreConfig/CDHCoreConfig.fpp @@ -0,0 +1,54 @@ +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 + # ); + # """ + #} + + +} \ No newline at end of file diff --git a/Svc/Subtopologies/CDHCore/CDHCoreConfig/CMakeLists.txt b/Svc/Subtopologies/CDHCore/CDHCoreConfig/CMakeLists.txt new file mode 100644 index 00000000000..8c5fe3c039a --- /dev/null +++ b/Svc/Subtopologies/CDHCore/CDHCoreConfig/CMakeLists.txt @@ -0,0 +1,5 @@ +register_fprime_module( + AUTOCODER_INPUTS + "${CMAKE_CURRENT_LIST_DIR}/CDHCoreConfig.fpp" + INTERFACE +) diff --git a/Svc/Subtopologies/CDHCore/CMakeLists.txt b/Svc/Subtopologies/CDHCore/CMakeLists.txt new file mode 100644 index 00000000000..d6d812a8e7b --- /dev/null +++ b/Svc/Subtopologies/CDHCore/CMakeLists.txt @@ -0,0 +1,9 @@ +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 +) diff --git a/Svc/Subtopologies/CDHCore/PingEntries.hpp b/Svc/Subtopologies/CDHCore/PingEntries.hpp new file mode 100644 index 00000000000..94316250fea --- /dev/null +++ b/Svc/Subtopologies/CDHCore/PingEntries.hpp @@ -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 diff --git a/Svc/Subtopologies/CMakeLists.txt b/Svc/Subtopologies/CMakeLists.txt new file mode 100644 index 00000000000..e97b2bfb41a --- /dev/null +++ b/Svc/Subtopologies/CMakeLists.txt @@ -0,0 +1,2 @@ +add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/CDHCore/") + diff --git a/cmake/test/data/TestDeployment/CMakeLists.txt b/cmake/test/data/TestDeployment/CMakeLists.txt index 7a90d9ae54b..22fee508bd4 100644 --- a/cmake/test/data/TestDeployment/CMakeLists.txt +++ b/cmake/test/data/TestDeployment/CMakeLists.txt @@ -23,3 +23,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() +add_dependencies(TestDeployment Svc_Subtopologies_CDHCore) \ No newline at end of file