Skip to content

Commit 7e00ff5

Browse files
committed
Add Framing subtopologies and use them within Com subtopologies (nasa#4113)
* Update ComX subtopologies to not include ComStub and update Ref * Cosmetic updates * Working FramingCcsds subtopology used in ComCcsds * Revert Ref to use ComCcsds * Move FramingSubtopology into ComCcsds build module * Working ComFprime subtopology * Cosmetic updates * formatting
1 parent 5f5f29f commit 7e00ff5

File tree

7 files changed

+177
-120
lines changed

7 files changed

+177
-120
lines changed

Ref/Top/RefTopologyDefs.hpp

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
#include "Svc/Subtopologies/DataProducts/SubtopologyTopologyDefs.hpp"
2727
#include "Svc/Subtopologies/FileHandling/SubtopologyTopologyDefs.hpp"
2828

29-
//ComCcsds Enum Includes
30-
#include "Svc/Subtopologies/ComCcsds/Ports_ComPacketQueueEnumAc.hpp"
29+
// ComCcsds Enum Includes
3130
#include "Svc/Subtopologies/ComCcsds/Ports_ComBufferQueueEnumAc.hpp"
31+
#include "Svc/Subtopologies/ComCcsds/Ports_ComPacketQueueEnumAc.hpp"
3232

3333
/**
3434
* \brief required ping constants
@@ -50,34 +50,46 @@
5050
* ```
5151
*/
5252
namespace PingEntries {
53-
namespace Ref_blockDrv {enum { WARN = 3, FATAL = 5 };}
54-
namespace Ref_pingRcvr {enum { WARN = 3, FATAL = 5 };}
55-
namespace Ref_rateGroup1Comp {enum { WARN = 3, FATAL = 5 };}
56-
namespace Ref_rateGroup2Comp {enum { WARN = 3, FATAL = 5 };}
57-
namespace Ref_rateGroup3Comp {enum { WARN = 3, FATAL = 5 };}
58-
namespace Ref_cmdSeq {enum { WARN = 3, FATAL = 5 };}
53+
namespace Ref_blockDrv {
54+
enum { WARN = 3, FATAL = 5 };
55+
}
56+
namespace Ref_pingRcvr {
57+
enum { WARN = 3, FATAL = 5 };
58+
}
59+
namespace Ref_rateGroup1Comp {
60+
enum { WARN = 3, FATAL = 5 };
61+
}
62+
namespace Ref_rateGroup2Comp {
63+
enum { WARN = 3, FATAL = 5 };
64+
}
65+
namespace Ref_rateGroup3Comp {
66+
enum { WARN = 3, FATAL = 5 };
67+
}
68+
namespace Ref_cmdSeq {
69+
enum { WARN = 3, FATAL = 5 };
70+
}
5971
} // namespace PingEntries
6072

6173
// Definitions are placed within a namespace named after the deployment
6274
namespace Ref {
6375

64-
/**
65-
* \brief required type definition to carry state
66-
*
67-
* The topology autocoder requires an object that carries state with the name `Ref::TopologyState`. Only the type
68-
* definition is required by the autocoder and the contents of this object are otherwise opaque to the autocoder. The
69-
* contents are entirely up to the definition of the project. This reference application specifies hostname and port
70-
* fields, which are derived by command line inputs.
71-
*/
72-
struct TopologyState {
73-
const char* hostname; //!< Hostname for TCP communication
74-
U16 port; //!< Port for TCP communication
75-
CdhCore::SubtopologyState cdhCore; //!< Subtopology state for CdhCore
76-
ComCcsds::SubtopologyState comCcsds; //!< Subtopology state for ComCcsds
77-
DataProducts::SubtopologyState dataProducts; //!< Subtopology state for DataProducts
78-
FileHandling::SubtopologyState fileHandling; //!< Subtopology state for FileHandling
79-
};
76+
/**
77+
* \brief required type definition to carry state
78+
*
79+
* The topology autocoder requires an object that carries state with the name `Ref::TopologyState`. Only the type
80+
* definition is required by the autocoder and the contents of this object are otherwise opaque to the autocoder. The
81+
* contents are entirely up to the definition of the project. This reference application specifies hostname and port
82+
* fields, which are derived by command line inputs.
83+
*/
84+
struct TopologyState {
85+
const char* hostname; //!< Hostname for TCP communication
86+
U16 port; //!< Port for TCP communication
87+
CdhCore::SubtopologyState cdhCore; //!< Subtopology state for CdhCore
88+
ComCcsds::SubtopologyState comCcsds; //!< Subtopology state for ComCcsds
89+
DataProducts::SubtopologyState dataProducts; //!< Subtopology state for DataProducts
90+
FileHandling::SubtopologyState fileHandling; //!< Subtopology state for FileHandling
91+
};
8092

81-
namespace PingEntries = ::PingEntries;
93+
namespace PingEntries = ::PingEntries;
8294
} // namespace Ref
8395
#endif

Ref/Top/instances.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,6 @@ module Ref {
9999

100100
instance linuxTimer: Svc.LinuxTimer base id 0x10024000
101101

102-
instance comDriver: Drv.TcpClient base id 0x10025000
102+
instance comDriver: Drv.TcpClient base id 0x10025000
103103

104104
}

Ref/Top/topology.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module Ref {
2020
import ComCcsds.Subtopology
2121
import FileHandling.Subtopology
2222
import DataProducts.Subtopology
23-
23+
2424
# ----------------------------------------------------------------------
2525
# Instances used in the topology
2626
# ----------------------------------------------------------------------

Ref/test/int/int_config.json

Lines changed: 36 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,37 @@
11
{
2-
"Svc.ActiveRateGroup" : "Ref.rateGroup1Comp",
3-
"Svc.CommandDispatcher" : "CdhCore.cmdDisp",
4-
"Svc.CmdSequencer" : "Ref.cmdSeq",
5-
"Svc.FileDownlink" : "FileHandling.fileDownlink",
6-
"Svc.FileManager" : "FileHandling.fileManager",
7-
"Svc.FileUplink" : "Ref.fileUplink",
8-
"Ref.PingReceiver" : "Ref.pingRcvr",
9-
"Svc.EventManager" : "CdhCore.events",
10-
"Svc.TlmChan" : "Ref.tlmSend",
11-
"Svc.PrmDb" : "FileHandling.prmDb",
12-
"Svc.PrmDb.filename" : "/tmp/PrmDb.dat",
13-
"Svc.DpCatalog" : "DataProducts.dpCat",
14-
"Svc.DpManager" : "DataProducts.dpMgr",
15-
"Svc.DpWriter" : "DataProducts.dpWriter",
16-
"Svc.ComQueue" : "Ref.comQueue",
17-
"Ref.TypeDemo" : "Ref.typeDemo",
18-
"Svc.Health" : "CdhCore.health",
19-
"Ref.SignalGen" : "Ref.SG1",
20-
"Ref.SendBuff" : "Ref.sendBuffComp",
21-
"Drv.TcpClient" : "Ref.comDriver",
22-
"Svc.AssertFatalAdapter" : "Ref.fatalAdapter",
23-
"Svc.FatalHandler" : "Ref.fatalHandler",
24-
"Svc.BufferManager" : "Ref.commsBufferManager",
25-
"Svc.PosixTime" : "Ref.posixTime",
26-
"Svc.RateGroupDriver" : "Ref.rateGroupDriverComp",
27-
"Ref.RecvBuff" : "Ref.recvBuffComp",
28-
"Svc.Version" : "CdhCore.version",
29-
"Svc.PassiveTextLogger" : "Ref.textLogger",
30-
"Svc.SystemResources" : "Ref.systemResources",
31-
"Svc.BufferManager" : "Ref.dpBufferManager",
32-
"Svc.FrameAccumulator" : "Ref.frameAccumulator",
33-
"Svc.FprimeDeframer" : "Ref.deframer",
34-
"Svc.FprimeRouter" : "Ref.fprimeRouter",
35-
"Svc.FprimeFramer" : "Ref.fprimeFramer",
36-
"Svc.ComStub" : "Ref.comStub"
37-
}
38-
2+
"Svc.ActiveRateGroup": "Ref.rateGroup1Comp",
3+
"Svc.CommandDispatcher": "CdhCore.cmdDisp",
4+
"Svc.CmdSequencer": "Ref.cmdSeq",
5+
"Svc.FileDownlink": "FileHandling.fileDownlink",
6+
"Svc.FileManager": "FileHandling.fileManager",
7+
"Svc.FileUplink": "Ref.fileUplink",
8+
"Ref.PingReceiver": "Ref.pingRcvr",
9+
"Svc.EventManager": "CdhCore.events",
10+
"Svc.TlmChan": "Ref.tlmSend",
11+
"Svc.PrmDb": "FileHandling.prmDb",
12+
"Svc.PrmDb.filename": "/tmp/PrmDb.dat",
13+
"Svc.DpCatalog": "DataProducts.dpCat",
14+
"Svc.DpManager": "DataProducts.dpMgr",
15+
"Svc.DpWriter": "DataProducts.dpWriter",
16+
"Svc.ComQueue": "Ref.comQueue",
17+
"Ref.TypeDemo": "Ref.typeDemo",
18+
"Svc.Health": "CdhCore.health",
19+
"Ref.SignalGen": "Ref.SG1",
20+
"Ref.SendBuff": "Ref.sendBuffComp",
21+
"Drv.TcpClient": "Ref.comDriver",
22+
"Svc.AssertFatalAdapter": "Ref.fatalAdapter",
23+
"Svc.FatalHandler": "Ref.fatalHandler",
24+
"Svc.BufferManager": "Ref.commsBufferManager",
25+
"Svc.PosixTime": "Ref.posixTime",
26+
"Svc.RateGroupDriver": "Ref.rateGroupDriverComp",
27+
"Ref.RecvBuff": "Ref.recvBuffComp",
28+
"Svc.Version": "CdhCore.version",
29+
"Svc.PassiveTextLogger": "Ref.textLogger",
30+
"Svc.SystemResources": "Ref.systemResources",
31+
"Svc.BufferManager": "Ref.dpBufferManager",
32+
"Svc.FrameAccumulator": "Ref.frameAccumulator",
33+
"Svc.FprimeDeframer": "Ref.deframer",
34+
"Svc.FprimeRouter": "Ref.fprimeRouter",
35+
"Svc.FprimeFramer": "Ref.framer",
36+
"Svc.ComStub": "Ref.comStub"
37+
}

Svc/Subtopologies/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ add_custom_target(
1919
Svc_Subtopologies_DataProducts
2020
Svc_Subtopologies_DataProducts_DataProductsConfig
2121
Svc_Subtopologies_ComLoggerTee
22-
)
22+
)

Svc/Subtopologies/ComCcsds/ComCcsds.fpp

Lines changed: 53 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -90,38 +90,49 @@ module ComCcsds {
9090
"""
9191
}
9292

93-
instance fprimeRouter: Svc.FprimeRouter base id ComCcsdsConfig.BASE_ID + 0x03000 \
94-
95-
instance comStub: Svc.ComStub base id ComCcsdsConfig.BASE_ID + 0x04000 \
93+
instance fprimeRouter: Svc.FprimeRouter base id ComCcsdsConfig.BASE_ID + 0x03000
9694

97-
instance tcDeframer: Svc.Ccsds.TcDeframer base id ComCcsdsConfig.BASE_ID + 0x05000 \
95+
instance tcDeframer: Svc.Ccsds.TcDeframer base id ComCcsdsConfig.BASE_ID + 0x04000
9896

99-
instance spacePacketDeframer: Svc.Ccsds.SpacePacketDeframer base id ComCcsdsConfig.BASE_ID + 0x06000 \
97+
instance spacePacketDeframer: Svc.Ccsds.SpacePacketDeframer base id ComCcsdsConfig.BASE_ID + 0x05000
98+
# NOTE: name 'framer' is used for the framer that connects to the Com Adapter Interface for better subtopology interoperability
99+
instance framer: Svc.Ccsds.TmFramer base id ComCcsdsConfig.BASE_ID + 0x06000
100100

101-
instance tmFramer: Svc.Ccsds.TmFramer base id ComCcsdsConfig.BASE_ID + 0x07000 \
101+
instance spacePacketFramer: Svc.Ccsds.SpacePacketFramer base id ComCcsdsConfig.BASE_ID + 0x07000
102102

103-
instance spacePacketFramer: Svc.Ccsds.SpacePacketFramer base id ComCcsdsConfig.BASE_ID + 0x08000 \
103+
instance apidManager: Svc.Ccsds.ApidManager base id ComCcsdsConfig.BASE_ID + 0x08000
104+
105+
instance comStub: Svc.ComStub base id ComCcsdsConfig.BASE_ID + 0x09000
106+
107+
topology FramingSubtopology {
108+
# Usage Note:
109+
#
110+
# When importing this subtopology, users shall establish 5 port connections with a component implementing
111+
# the Svc.Com (Svc/Interfaces/Com.fpp) interface. They are as follows:
112+
#
113+
# 1) Outputs:
114+
# - ComCcsds.framer.dataOut -> [Svc.Com].dataIn
115+
# - ComCcsds.frameAccumulator.dataReturnOut -> [Svc.Com].dataReturnIn
116+
# 2) Inputs:
117+
# - [Svc.Com].dataReturnOut -> ComCcsds.framer.dataReturnIn
118+
# - [Svc.Com].comStatusOut -> ComCcsds.framer.comStatusIn
119+
# - [Svc.Com].dataOut -> ComCcsds.frameAccumulator.dataIn
104120

105-
instance apidManager: Svc.Ccsds.ApidManager base id ComCcsdsConfig.BASE_ID + 0x09000 \
106121

107-
topology Subtopology {
108122
# Active Components
109123
instance comQueue
110124

111125
# Passive Components
112126
instance commsBufferManager
113127
instance frameAccumulator
114128
instance fprimeRouter
115-
instance comStub
116129
instance tcDeframer
117130
instance spacePacketDeframer
118-
instance tmFramer
131+
instance framer
119132
instance spacePacketFramer
120133
instance apidManager
121134

122135
connections Downlink {
123-
124-
125136
# ComQueue <-> SpacePacketFramer
126137
comQueue.dataOut -> spacePacketFramer.dataIn
127138
spacePacketFramer.dataReturnOut -> comQueue.dataReturnIn
@@ -130,27 +141,22 @@ module ComCcsds {
130141
spacePacketFramer.bufferDeallocate -> commsBufferManager.bufferSendIn
131142
spacePacketFramer.getApidSeqCount -> apidManager.getApidSeqCountIn
132143
# SpacePacketFramer <-> TmFramer
133-
spacePacketFramer.dataOut -> tmFramer.dataIn
134-
tmFramer.dataReturnOut -> spacePacketFramer.dataReturnIn
135-
# Framer <-> ComStub
136-
tmFramer.dataOut -> comStub.dataIn
137-
comStub.dataReturnOut -> tmFramer.dataReturnIn
144+
spacePacketFramer.dataOut -> framer.dataIn
145+
framer.dataReturnOut -> spacePacketFramer.dataReturnIn
138146
# ComStatus
139-
comStub.comStatusOut -> tmFramer.comStatusIn
140-
tmFramer.comStatusOut -> spacePacketFramer.comStatusIn
141-
spacePacketFramer.comStatusOut -> comQueue.comStatusIn
147+
framer.comStatusOut -> spacePacketFramer.comStatusIn
148+
spacePacketFramer.comStatusOut -> comQueue.comStatusIn
149+
# (Outgoing) Framer <-> ComInterface connections shall be established by the user
142150
}
143151

144152
connections Uplink {
145-
# ComStub <-> FrameAccumulator
146-
comStub.dataOut -> frameAccumulator.dataIn
147-
frameAccumulator.dataReturnOut -> comStub.dataReturnIn
153+
# (Incoming) ComInterface <-> FrameAccumulator connections shall be established by the user
148154
# FrameAccumulator buffer allocations
149155
frameAccumulator.bufferDeallocate -> commsBufferManager.bufferSendIn
150156
frameAccumulator.bufferAllocate -> commsBufferManager.bufferGetCallee
151-
# FrameAccumulator <-> Deframer
152-
frameAccumulator.dataOut -> tcDeframer.dataIn
153-
tcDeframer.dataReturnOut -> frameAccumulator.dataReturnIn
157+
# FrameAccumulator <-> TcDeframer
158+
frameAccumulator.dataOut -> tcDeframer.dataIn
159+
tcDeframer.dataReturnOut -> frameAccumulator.dataReturnIn
154160
# TcDeframer <-> SpacePacketDeframer
155161
tcDeframer.dataOut -> spacePacketDeframer.dataIn
156162
spacePacketDeframer.dataReturnOut -> tcDeframer.dataReturnIn
@@ -162,8 +168,25 @@ module ComCcsds {
162168
# Router buffer allocations
163169
fprimeRouter.bufferAllocate -> commsBufferManager.bufferGetCallee
164170
fprimeRouter.bufferDeallocate -> commsBufferManager.bufferSendIn
165-
166171
}
172+
} # end FramingSubtopology
173+
174+
# This subtopology uses FramingSubtopology with a ComStub component for Com Interface
175+
topology Subtopology {
176+
import FramingSubtopology
177+
178+
instance comStub
179+
180+
connections ComStub {
181+
# Framer <-> ComStub (Downlink)
182+
ComCcsds.framer.dataOut -> comStub.dataIn
183+
comStub.dataReturnOut -> ComCcsds.framer.dataReturnIn
184+
comStub.comStatusOut -> ComCcsds.framer.comStatusIn
185+
186+
# ComStub <-> FrameAccumulator (Uplink)
187+
comStub.dataOut -> ComCcsds.frameAccumulator.dataIn
188+
ComCcsds.frameAccumulator.dataReturnOut -> comStub.dataReturnIn
189+
}
190+
} # end Subtopology
167191

168-
} # end topology
169-
} # end ComCcsds Subtopology
192+
} # end ComCcsds

0 commit comments

Comments
 (0)