ICAROUS
All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Modules Pages
sch_verify.h
1/*
2** $Id: sch_verify.h 1.3 2017/06/21 15:29:22EDT mdeschu Exp $
3**
4** Copyright (c) 2007-2014 United States Government as represented by the
5** Administrator of the National Aeronautics and Space Administration.
6** All Other Rights Reserved.
7**
8** This software was created at NASA's Goddard Space Flight Center.
9** This software is governed by the NASA Open Source Agreement and may be
10** used, distributed and modified only pursuant to the terms of that
11** agreement.
12**
13** Purpose: CFS Scheduler (SCH) configuration verification
14**
15** Notes:
16**
17*/
18
19#ifndef _sch_verify_
20#define _sch_verify_
21
22/*************************************************************************/
23
24#if SCH_PIPE_DEPTH < 1
25 #error SCH_PIPE_DEPTH must be greater than zero.
26#endif
27
28#if SCH_ENTRIES_PER_SLOT < 1
29 #error SCH_ENTRIES_PER_SLOT must be greater than zero. Schedule Definition Table must have at least one entry per slot.
30#endif
31
32#if SCH_MAX_MESSAGES < 1
33 #error SCH_MAX_MESSAGES must be greater than zero. Message Definition Table must have at least one message definition.
34#endif
35
36#if SCH_MAX_MESSAGES < 1
37 #error SCH_MAX_MESSAGES must be greater than zero. Message Definition Table must have at least one message definition.
38#endif
39
40#if SCH_MDT_MIN_MSG_ID < 0
41 #error SCH_MDT_MIN_MSG_ID must be at least 0.
42#endif
43
44#if SCH_MDT_MAX_MSG_ID < SCH_MDT_MIN_MSG_ID
45 #error SCH_MDT_MAX_MSG_ID must be at least SCH_MDT_MIN_MSG_ID.
46#endif
47
48#if SCH_MDT_MAX_MSG_ID > CFE_SB_HIGHEST_VALID_MSGID
49 #error SCH_MDT_MAX_MSG_ID must be less than or equal to CFE_SB_HIGHEST_VALID_MSGID.
50#endif
51
52#if SCH_MAX_LAG_COUNT < 1
53 #error SCH_MAX_LAG_COUNT must be at least 1.
54#endif
55
56#if SCH_MAX_LAG_COUNT > SCH_TOTAL_SLOTS
57 #error SCH_MAX_LAG_COUNT cannot be greater than SCH_TOTAL_SLOTS.
58#endif
59
60
61#if SCH_MAX_SLOTS_PER_WAKEUP < 1
62 #error SCH_MAX_SLOTS_PER_WAKEUP must be at least 1.
63#endif
64
65#if SCH_MICROS_PER_MAJOR_FRAME < SCH_TOTAL_SLOTS
66 #error SCH_MICROS_PER_MAJOR_FRAME must be greater than SCH_TOTAL_SLOTS (i.e. - a normal slot period must be at least 1 microsecond)
67#endif
68
69#if SCH_STARTUP_SYNC_TIMEOUT < 0
70 #error SCH_STARTUP_SYNC_TIMEOUT must be greater than or equal to zero.
71#endif
72
73#if SCH_STARTUP_PERIOD < SCH_MICROS_PER_MAJOR_FRAME
74 #error SCH_STARTUP_PERIOD must be greater than or equal to SCH_MICROS_PER_MAJOR_FRAME.
75#endif
76
77/*
78** Make sure Diagnostic Packet does not exceed mission packet size
79** NOTE: The "2" below is for the current size of a CFE_SB_MsgId_t in bytes. "sizeof" cannot be used in #if statements.
80** and the "14" is the size of a CCSDS Telemetry Header
81*/
82#ifdef MESSAGE_FORMAT_IS_CCSDS
83#if (SCH_NUM_STATUS_BYTES_REQD + 2*SCH_TABLE_ENTRIES + 12 ) > CFE_SB_MAX_SB_MSG_SIZE
84 #error SCH Diagnostic Packet exceeds maximum allowed message size (see CFE_SB_MAX_SB_MSG_SIZE)
85#endif
86#endif
87
88/*
89** Validate Number of Minor Frames per Major Frame
90*/
91#if SCH_TOTAL_SLOTS > 65535
92 #error SCH_TOTAL_SLOTS cannot specify more than 65535 minor frames per major frame
93#endif
94
95#if SCH_TOTAL_SLOTS < 2
96 #error SCH_TOTAL_SLOTS must specify at least 2 minor frames per major frame
97#endif
98
99/*
100** Ensure Allowed Drift is not larger than a single slot
101*/
102#if SCH_SYNC_SLOT_DRIFT_WINDOW >= (SCH_MICROS_PER_MAJOR_FRAME/SCH_TOTAL_SLOTS)
103 #error SCH_SYNC_SLOT_DRIFT_WINDOW must be less than one normal slot period
104#endif
105
106#if SCH_SYNC_SLOT_DRIFT_WINDOW < 0
107 #error SCH_SYNC_SLOT_DRIFT_WINDOW must be greater than or equal to zero
108#endif
109
110/*
111** Noisy Major Frame
112*/
113
114#if SCH_MAX_NOISY_MAJORF < 2
115 #error SCH_MAX_NOISY_MAJORF must specify at least 2 noisy frames before disregarding
116#endif
117
118#ifndef SCH_MISSION_REV
119 #error SCH_MISSION_REV must be defined!
120#elif (SCH_MISSION_REV < 0)
121 #error SCH_MISSION_REV must be greater than or equal to zero!
122#endif
123
124
125/*************************************************************************/
126
127#endif /* _sch_verify_ */
128
129/************************/
130/* End of File Comment */
131/************************/