File: /home/oboss/Users/gec/sources/PUS_Services/On_Board_Scheduler/on_board_scheduler.ads
1 --% Compilation Unit: On_Board_Scheduler
2 --
3 --% Category: Generic Package Declaration
4 --
5 --% Release: $Name: $
6 --
7 --% Version: $Revision: 2.0 $
8 --
9 --% Author: $Author: gec $
10 --
11 --% Revision Log:
12 -- $Log: on_board_scheduler.ads,v $
13 -- Revision 2.0 2003/04/04 08:51:18 gec
14 -- Initial release of source files serving as baseline for OBOSS-III project.
15 --
16 -- Revision 1.1.1.1 2003/04/04 08:13:14 gec
17 -- Imported using TkCVS
18 --
19 --
20 --
21 --% Project: OBOSS
22 --
23 --% Copyright (C) 2003 by Terma A/S
24 -- Proprietary and intellectual rights of Terma A/S, Denmark,
25 -- are involved in the subject-matter of this material and
26 -- all manufacturing, reproduction, use, disclosure, and
27 -- sales rights pertaining to such subject-matter are
28 -- expressly reserved. This material is submitted for a
29 -- specific purpose as agreed, and the recipient by
30 -- accepting this material agrees that this material will
31 -- not be used, copied, or reproduced in whole or in part
32 -- nor its contents revealed in any manner or to any person,
33 -- except to meet the purpose for which it was submitted and
34 -- subject to the terms of the agreement.
35 --
36 --% Target Dependencies:
37 -- None
38 --% Compiler Dependencies:
39 -- None
40
41 --~-----------------------------------------------------------------------------
42
43 with Task_Priority_Control;
44 with External_On_Board_Scheduling_Types;
45 with Mission_Parameters;
46 with PUS;
47 generic
48
49 --% Generic Parameter Constraints:
50 --> Optional_Deposit - This operation must update TM counters
51 --> Forward_TC - This operation must leave TC counters unchanged
52 --> Telecommand_Buffer_Priority - Shall exceed ceiling of any callers of
53 --+ Handle_PUS_Packet and Telecommand_Interpreter_Priority
54 --> Schedule_Priority - Shall exceed ceiling of Scheduler_Task_Priority
55 --+ and Telecommand_Interpreter_Priority
56
57
58 -- Identification of the application process of the "current" instance of
59 --+ this service
60 Application_ID : in Mission_Parameters.APID;
61
62 -- Maximal number of telecommands on the command schedule
63 Schedule_Size : in Natural;
64
65 -- Maximal length of parameter lists in telecommands and telemetry reports
66 Max_List_Length : in Positive;
67
68 -- Types and representations of sub-schedule identifications
69 type Sub_Schedule_ID is (<>);
70 All_Sub_Schedules : in Sub_Schedule_ID;
71 type Sub_Schedule_ID_Rep is array (Sub_Schedule_ID) of
72 External_On_Board_Scheduling_Types.Sub_Schedule_ID;
73 Sub_Schedule_ID_Rep_Vals : in Sub_Schedule_ID_Rep;
74
75 -- Scheduling_Period indicates the period by which schedulable TCs are
76 --+ extracted and executed.
77 -- On board scheduling is implemented based on polling, meaning that the
78 --+ scheduler task once every Scheduling_Period schedules all TCs due for
79 --+ execution.
80 -- The actual execution time of one telecommand is thus subject to a jitter
81 --+ equaling Scheduling_Period
82 Scheduling_Period : in Integer; -- Expressed in milliseconds.
83
84 -- Max_No_Of_Telecommands_In_Scheduling_Period indicates the maximum number
85 --+ of TCs that are to be scheduled during one Scheduling_Period as
86 --+ defined above.
87 Max_No_Of_Telecommands_In_Scheduling_Period : in Natural;
88
89 -- Routine for depositing generated telemetry, should be instantiated with
90 --+ an operation that ensures that telemetry packet counters are
91 --+ updated.
92 with function Optional_Deposit
93 (Packet : in PUS.Optional_PUS_Packet)
94 return Boolean;
95
96 -- Routine for routing telecommands that have been scheduled for execution,
97 --+ should be instantiated with an operation that does NOT update packet
98 --+ counters.
99 with function Forward_TC
100 (Packet : in PUS.PUS_Packet)
101 return Boolean;
102
103 -- Priority of protected object implementing buffering of calls to
104 --+ Handle_PUS_Packet
105 --
106 Telecommand_Buffer_Priority
107 : in Task_Priority_Control.
108 Passive_Task_Priority;
109
110 -- Size of buffer for events corresponding to requests for execution of TCs
111 Telecommand_Buffer_Size : in Natural;
112
113 -- Priority and stack size of sporadic task performing telecommand execution
114 --+ as a response to calls to Handle_PUS_Packet
115 Telecommand_Interpreter_Priority
116 : in Task_Priority_Control.
117 Active_Task_Priority;
118 Telecommand_Interpreter_Stack_Size : in Natural;
119
120 -- Priority of protected object implementing the telecommand schedule.
121 Schedule_Priority : in Task_Priority_Control.Passive_Task_Priority;
122
123 -- Priority and stack size of cyclic task performing command scheduling
124 Scheduler_Task_Priority
125 : in Task_Priority_Control.Active_Task_Priority;
126 Scheduler_Task_Stack_Size : in Natural;
127
128 package On_Board_Scheduler is
129
130 --% Library Package:
131 -- Implementation of the on-board scheduling service
132 --% Active Tasks:
133 --> OBS_Scheduler.The_Scheduler.The_Cyclic_Task - Cyclic
134 --> OBS_TC_Interpreter.The_TC_Interpreter.The_Sporadic_Task - Sporadic
135 --% Passive Tasks:
136 --> OBS_Schedule.Critical_Region - Protection of schedule state
137 --> OBS_TC_Interpreter.The_TC_Interpreter.Event_Buffer.Queue_Task -
138 --+ Implementation of TC buffer
139
140 procedure Initialize;
141
142
143 --% Subprogram:
144 -- Handling of on-board scxheduling related TCs
145 --% Parameter Constraints:
146 --> None
147 --% Exceptions Raised:
148 --> None
149
150 procedure Handle_PUS_Packet
151 (Packet : in PUS.PUS_Packet);
152
153 end On_Board_Scheduler;
154
155 --~-----------------------------------------------------------------------------
156