1 | /*
|
---|
2 | * TOPPERS Software
|
---|
3 | * Toyohashi Open Platform for Embedded Real-Time Systems
|
---|
4 | *
|
---|
5 | * Copyright (C) 2014-2015 by Embedded and Real-Time Systems Laboratory
|
---|
6 | * Graduate School of Information Science, Nagoya Univ., JAPAN
|
---|
7 | *
|
---|
8 | * ä¸è¨èä½æ¨©è
|
---|
9 | ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
|
---|
10 | * ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ã使ç¨ã»è¤è£½ã»æ¹
|
---|
11 | * å¤ã»åé
|
---|
12 | å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
|
---|
13 | * (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
|
---|
14 | * 権表示ï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
|
---|
15 | * ã¹ã³ã¼ãä¸ã«å«ã¾ãã¦ãããã¨ï¼
|
---|
16 | * (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
17 | * ç¨ã§ããå½¢ã§åé
|
---|
18 | å¸ããå ´åã«ã¯ï¼åé
|
---|
19 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨
|
---|
20 | * è
|
---|
21 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
|
---|
22 | * ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
23 | * (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
24 | * ç¨ã§ããªãå½¢ã§åé
|
---|
25 | å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
|
---|
26 | * ã¨ï¼
|
---|
27 | * (a) åé
|
---|
28 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨è
|
---|
29 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
|
---|
30 | * ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
31 | * (b) åé
|
---|
32 | å¸ã®å½¢æ
|
---|
33 | ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSããã¸ã§ã¯ãã«
|
---|
34 | * å ±åãããã¨ï¼
|
---|
35 | * (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
|
---|
36 | * 害ãããï¼ä¸è¨èä½æ¨©è
|
---|
37 | ããã³TOPPERSããã¸ã§ã¯ããå
|
---|
38 | 責ãããã¨ï¼
|
---|
39 | * ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
|
---|
40 | * ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
|
---|
41 | ããã³TOPPERSããã¸ã§ã¯ãã
|
---|
42 | * å
|
---|
43 | 責ãããã¨ï¼
|
---|
44 | *
|
---|
45 | * æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
|
---|
46 | ã
|
---|
47 | * ãã³TOPPERSããã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
|
---|
48 | * ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
|
---|
49 | * ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ害ã«é¢ãã¦ãï¼ã
|
---|
50 | * ã®è²¬ä»»ãè² ããªãï¼
|
---|
51 | *
|
---|
52 | * $Id: hrt_systim1.c 310 2015-02-08 13:46:46Z ertl-hiro $
|
---|
53 | */
|
---|
54 |
|
---|
55 | /*
|
---|
56 | * ã·ã¹ãã æå»ç®¡çæ©è½ã®ãã¹ã(1)
|
---|
57 | *
|
---|
58 | * ããã¹ãã®ç®çã
|
---|
59 | *
|
---|
60 | * è¨è¨æ¸ã®ãé«å解è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ã®è¨å®ããé«å解è½ã¿
|
---|
61 | * ã¤ãå²è¾¼ã¿ã®å¦çããç¸å¯¾æéæå®ã«ããã¿ã¤ã ã¤ãã³ãã®ç»é²ãã®ç¯ã«
|
---|
62 | * è¨è¿°å
|
---|
63 | 容ããã¹ãããï¼
|
---|
64 | *
|
---|
65 | * 以ä¸ã®é¢æ°ã®C1ã«ãã¬ãã¸ãéæããï¼
|
---|
66 | * set_hrt_eventï¼é«å解è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ã®è¨å®ï¼
|
---|
67 | * tmevtb_enqueueï¼ç¸å¯¾æéæå®ã«ããã¿ã¤ã ã¤ãã³ãã®ç»é²ï¼
|
---|
68 | * signal_timeï¼é«å解è½ã¿ã¤ãå²è¾¼ã¿ã®å¦çï¼
|
---|
69 | *
|
---|
70 | * ããã¹ãé
|
---|
71 | ç®ã
|
---|
72 | *
|
---|
73 | * (A) ãé«å解è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ã®è¨å®ãã®ç¯ã®è¨è¿°å
|
---|
74 | 容ã®
|
---|
75 | * ãã¹ãã¨set_hrt_eventã®å®è¡/åå²ãã¹ã®ç¶²ç¾
|
---|
76 |
|
---|
77 | * (A-1) ã¿ã¤ã ã¤ãã³ããç»é²ããã¦ããªãæï¼»ASPD1007ï¼½
|
---|
78 | * (A-2) ã¿ã¤ã ã¤ãã³ããç»é²ããã¦ããï¼çºçæå»ãéãã¦ããæï¼»ASPD1017ï¼½
|
---|
79 | * (A-3) ã¿ã¤ã ã¤ãã³ããç»é²ããã¦ããï¼å
|
---|
80 | é ã®ã¿ã¤ã ã¤ãã³ãã®çºç
|
---|
81 | * æå»ã¾ã§ã®é«å解ã¿ã¤ãã®ã«ã¦ã³ãã¢ããå¤ãHRTCNT_BOUND以ä¸
|
---|
82 | * ã®æï¼»ASPD1002ï¼½
|
---|
83 | * (A-4) ã¿ã¤ã ã¤ãã³ããç»é²ããã¦ããï¼å
|
---|
84 | é ã®ã¿ã¤ã ã¤ãã³ãã®çºç
|
---|
85 | * æå»ã¾ã§ã®é«å解ã¿ã¤ãã®ã«ã¦ã³ãã¢ããå¤ãHRTCNT_BOUNDãè¶
|
---|
86 |
|
---|
87 | * ããæï¼»ASPD1006ï¼½
|
---|
88 | * (B) ãç¸å¯¾æéæå®ã«ããã¿ã¤ã ã¤ãã³ãã®ç»é²ãã®ç¯ã®è¨è¿°å
|
---|
89 | 容ã®ãã¹
|
---|
90 | * ãã¨tmevtb_enqueueã®å®è¡/åå²ãã¹ã®ç¶²ç¾
|
---|
91 |
|
---|
92 | * (B-1) çºçæå»ãæ£ããè¨å®ããããã¨ï¼»ASPD1026][ASPD1027ï¼½
|
---|
93 | * (B-2) ã¿ã¤ã ã¤ãã³ããã¼ãã«æ¿å
|
---|
94 | ¥ããããã¨ï¼»ASPD1030ï¼½
|
---|
95 | * (B-3) signal_timeã®ä¸ã§å¼ã°ããæï¼»ASPD1034ï¼½
|
---|
96 | * (B-4) ç»é²ããã¿ã¤ã ã¤ãã³ããå
|
---|
97 | é ã§ãªãæï¼»ASPD1031ï¼½
|
---|
98 | * (B-5) ç»é²ããã¿ã¤ã ã¤ãã³ããå
|
---|
99 | é ã«ãªã£ãæï¼é«å解è½ã¿ã¤ããè¨
|
---|
100 | * å®ããï¼ï¼»ASPD1031ï¼½
|
---|
101 | * (C) signal_timeã®å®è¡/åå²ãã¹ã®ç¶²ç¾
|
---|
102 |
|
---|
103 | * (C-1) ã¿ã¤ã ã¤ãã³ããã¼ãã空ã®ç¶æ
|
---|
104 | ã§ï¼signal_timeãå¼ã³åºããã
|
---|
105 | * å ´å
|
---|
106 | * (C-2) ã¿ã¤ã ã¤ãã³ããã¼ãã®å
|
---|
107 | é ã®ã¤ãã³ãã®çºçæå»åã«ï¼
|
---|
108 | * signal_timeãå¼ã³åºãããå ´å
|
---|
109 | * (C-3) signal_timeã§ï¼ã¿ã¤ã ã¤ãã³ããã¼ãã®å
|
---|
110 | é ã®ã¤ãã³ãã®ã¿ãå¦
|
---|
111 | * çããå ´å
|
---|
112 | * (C-4) signal_timeã§ï¼ã¿ã¤ã ã¤ãã³ããã¼ãã®å
|
---|
113 | é ãã2ã¤ã®ã¤ãã³ã
|
---|
114 | * ãï¼å
|
---|
115 | å´ã®ã«ã¼ãã§å¦çããå ´å
|
---|
116 | * (C-5) signal_timeã§ï¼ã¿ã¤ã ã¤ãã³ããã¼ãã®å
|
---|
117 | é ãã2ã¤ã®ã¤ãã³ã
|
---|
118 | * ãï¼å¤å´ã®ã«ã¼ãã§å¦çããå ´å
|
---|
119 | * (D) signal_timeããå¼ãã å¦çã§ç¾å¨æå»ãæ´æ°ãããå ´å
|
---|
120 | * (D-1) æ´æ°ãããç¾å¨æå»ãï¼æ¬¡ã®ã¿ã¤ã ã¤ãã³ããéãã¦ããï¼æ¬¡ã®
|
---|
121 | * ã¿ã¤ã ã¤ãã³ããå
|
---|
122 | å´ã®ã«ã¼ãã§å¦çããå ´å
|
---|
123 | *
|
---|
124 | * ã使ç¨ãªã½ã¼ã¹ã
|
---|
125 | *
|
---|
126 | * é«å解è½ã¿ã¤ãã¢ã¸ã¥ã¼ã«ã®æ§è³ªï¼HRT_CONFIG1
|
---|
127 | * TCYC_HRTCNT æªå®ç¾©ï¼2^32ã®æå³ï¼
|
---|
128 | * TSTEP_HRTCNT 1U
|
---|
129 | * HRTCNT_BOUND 4000000002U
|
---|
130 | *
|
---|
131 | * TASK1: ä¸åªå
|
---|
132 | 度ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
|
---|
133 | * ALM1: ã¢ã©ã¼ã ãã³ãã©
|
---|
134 | * ALM2: ã¢ã©ã¼ã ãã³ãã©
|
---|
135 | * ALM3: ã¢ã©ã¼ã ãã³ãã©
|
---|
136 | *
|
---|
137 | * ãè£è¶³èª¬æã
|
---|
138 | *
|
---|
139 | * ã¿ã¤ã ã¤ãã³ããç»é²ããã¦ããªãæã«é«å解è½ã¿ã¤ãã«è¨å®ããç¸å¯¾ã¯ï¼
|
---|
140 | * ããªãã調æ´æ©è½ãæããªãå ´åã¯HRTCNT_BOUNDã§ããã®ã«å¯¾ãã¦ï¼ããª
|
---|
141 | * ãã調æ´æ©è½ãæã¤å ´åã¯TMAX_RELTIMãã¤ãã³ãæå»ã®ä¼¸ç¸®çã§å²ã£ãå¤
|
---|
142 | * ã¨HRTCNT_BOUNDã®å°ããæ¹ã®å¤ï¼ãã®ãã¹ãã§ã¯ï¼ããªããéãè¨å®ããï¼
|
---|
143 | * HRTCNT_BOUNDï¼TMAX_RELTIMã§ããããï¼TMAX_RELTIMã«ä¸è´ï¼ã¨ãªãï¼ã
|
---|
144 | * ãã§ï¼HRTCNT_EMPTYããã®å¤ã«å®ç¾©ãï¼ããªãã調æ´æ©è½ã®æç¡ã«ããã
|
---|
145 | * åããã¹ãã·ã¼ã±ã³ã¹ã使ããããã«ããï¼
|
---|
146 | *
|
---|
147 | * 以ä¸ã®ãã¹ãã·ã¼ã±ã³ã¹ã®ã³ã¡ã³ãä¸ã§ï¼ãçºçï¼xxxãã¨ã¯ï¼é«å解è½ã¿
|
---|
148 | * ã¤ãã®ã«ã¦ã³ãå¤ãxxxã«ãªã£ãæã«ã¿ã¤ã ã¤ãã³ããçºçãããã¨ãæå³
|
---|
149 | * ããï¼ã¿ã¤ã ã¤ãã³ãã®ã¤ãã³ãçºçæå»ã§ã¯ãªãï¼
|
---|
150 | *
|
---|
151 | * ããã¹ãã·ã¼ã±ã³ã¹ã
|
---|
152 | *
|
---|
153 | * == START ==
|
---|
154 | * // ã«ã¼ãã«èµ·åï¼é«å解è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ã¨ã¤ãã³ãæå»ã¯10ããã
|
---|
155 | * 1: [target_hrt_get_current -> 10U]
|
---|
156 | * 2: [target_hrt_set_event <- HRTCNT_EMPTY]
|
---|
157 | * == TASK1ï¼åªå
|
---|
158 | 度ï¼ä¸ï¼==
|
---|
159 | * // ã¿ã¤ã ã¤ãã³ãã1ã¤ã ãç»é²
|
---|
160 | * 3: sta_alm(ALM1, 100U)
|
---|
161 | * 4: [target_hrt_get_current -> 20U] // çºçï¼121
|
---|
162 | * 5: [target_hrt_set_event <- 101U] ... (A-3)
|
---|
163 | * 6: DO(target_raise_hrt_int(1U))
|
---|
164 | * slp_tsk()
|
---|
165 | * == HRT_HANDLER == ... (C-3)
|
---|
166 | * 7: [target_hrt_get_current -> 130U] // ALM1ãçºç
|
---|
167 | * == ALM1-1ï¼1åç®ï¼==
|
---|
168 | * 8: wup_tsk(TASK1)
|
---|
169 | * RETURN
|
---|
170 | * // ã¿ã¤ã ã¤ãã³ãããªããªã£ãå ´å
|
---|
171 | * 9: [target_hrt_get_current -> 140U]
|
---|
172 | * 10: [target_hrt_set_event <- HRTCNT_EMPTY] ... (A-1)
|
---|
173 | * == TASK1ï¼ç¶ãï¼==
|
---|
174 | * // 3ã¤ã®ã¿ã¤ã ã¤ãã³ããç»é²ï¼ãã®å
|
---|
175 | ã®2ã¤ãå
|
---|
176 | å´ã®ã«ã¼ãã§å¦ç
|
---|
177 | * 11: sta_alm(ALM1, 100U) ... (B-5)
|
---|
178 | * 12: [target_hrt_get_current -> 150U] // çºçï¼251
|
---|
179 | * 13: [target_hrt_set_event <- 101U] ... (B-1)(B-2)
|
---|
180 | * 14: sta_alm(ALM2, 100U) ... (B-4)
|
---|
181 | * 15: [target_hrt_get_current -> 160U] // çºçï¼261
|
---|
182 | * 16: sta_alm(ALM3, 110U)
|
---|
183 | * 17: [target_hrt_get_current -> 170U] // çºçï¼281
|
---|
184 | * 18: DO(target_raise_hrt_int(1U))
|
---|
185 | * slp_tsk()
|
---|
186 | * == HRT_HANDLER == ... (C-4)
|
---|
187 | * 19: [target_hrt_get_current -> 261U] // ALM1ã¨ALM2ãçºç
|
---|
188 | * == ALM1-2ï¼2åç®ï¼==
|
---|
189 | * 20: RETURN
|
---|
190 | * == ALM2-1ï¼1åç®ï¼== // é£ç¶ãã¦å¦ç
|
---|
191 | * 21: DO(target_raise_hrt_int(1U))
|
---|
192 | * RETURN
|
---|
193 | * 22: [target_hrt_get_current -> 280U]
|
---|
194 | * 23: [target_hrt_set_event <- 1U] // ALM3ã¾ã§ã®æéã¯1
|
---|
195 | * == HRT_HANDLER ==
|
---|
196 | * 24: [target_hrt_get_current -> 290U] // ALM3ãçºç
|
---|
197 | * == ALM3-1ï¼1åç®ï¼==
|
---|
198 | * 25: wup_tsk(TASK1)
|
---|
199 | * RETURN
|
---|
200 | * 26: [target_hrt_get_current -> 300U]
|
---|
201 | * 27: [target_hrt_set_event <- HRTCNT_EMPTY]
|
---|
202 | * == TASK1ï¼ç¶ãï¼==
|
---|
203 | * // 2ã¤ã®ã¿ã¤ã ã¤ãã³ããç»é²ï¼ãã®2ã¤ãå¤å´ã®ã«ã¼ãã§å¦ç
|
---|
204 | * 28: sta_alm(ALM1, 100U)
|
---|
205 | * 29: [target_hrt_get_current -> 310U] // çºçï¼411
|
---|
206 | * 30: [target_hrt_set_event <- 101U]
|
---|
207 | * 31: sta_alm(ALM2, 100U)
|
---|
208 | * 32: [target_hrt_get_current -> 320U] // çºçï¼421
|
---|
209 | * 33: DO(target_raise_hrt_int(1U))
|
---|
210 | * slp_tsk()
|
---|
211 | * == HRT_HANDLER == ... (C-5)
|
---|
212 | * 34: [target_hrt_get_current -> 420U] // ALM1ãçºç
|
---|
213 | * == ALM1-3ï¼3åç®ï¼==
|
---|
214 | * 35: RETURN
|
---|
215 | * 36: [target_hrt_get_current -> 430U] // ALM2ãçºç
|
---|
216 | * == ALM2-2ï¼2åç®ï¼==
|
---|
217 | * 37: wup_tsk(TASK1)
|
---|
218 | * RETURN
|
---|
219 | * 38: [target_hrt_get_current -> 440U]
|
---|
220 | * 39: [target_hrt_set_event <- HRTCNT_EMPTY]
|
---|
221 | * == TASK1ï¼ç¶ãï¼==
|
---|
222 | * // 2ã¤ã®ã¿ã¤ã ã¤ãã³ããç»é²
|
---|
223 | * 40: sta_alm(ALM1, 100U)
|
---|
224 | * 41: [target_hrt_get_current -> 450U] // çºçï¼551
|
---|
225 | * 42: [target_hrt_set_event <- 101U]
|
---|
226 | * 43: sta_alm(ALM2, 100U)
|
---|
227 | * 44: [target_hrt_get_current -> 460U] // çºçï¼561
|
---|
228 | * 45: DO(target_raise_hrt_int(1U))
|
---|
229 | * slp_tsk()
|
---|
230 | * == HRT_HANDLER == ... (D-1)
|
---|
231 | * 46: [target_hrt_get_current -> 560U] // ALM1ãçºç
|
---|
232 | * == ALM1-4ï¼4åç®ï¼==
|
---|
233 | * // ã¢ã©ã¼ã ãã³ãã©ä¸ã§ããã«1ã¤ã®ã¿ã¤ã ã¤ãã³ããç»é²
|
---|
234 | * 47: sta_alm(ALM3, 10U) ... (B-3)
|
---|
235 | * 48: [target_hrt_get_current -> 570U] // çºçï¼581ï¼ALM2ãçºç
|
---|
236 | * 49: RETURN
|
---|
237 | * == ALM2-3ï¼3åç®ï¼==
|
---|
238 | * 50: RETURN
|
---|
239 | * 51: [target_hrt_get_current -> 590U] // ALM3ãçºç
|
---|
240 | * == ALM3-2ï¼2åç®ï¼==
|
---|
241 | * 52: wup_tsk(TASK1)
|
---|
242 | * RETURN
|
---|
243 | * 53: [target_hrt_get_current -> 600U]
|
---|
244 | * 54: [target_hrt_set_event <- HRTCNT_EMPTY]
|
---|
245 | * == TASK1ï¼ç¶ãï¼==
|
---|
246 | * // 2ã¤ã®ã¿ã¤ã ã¤ãã³ããç»é²ï¼2ã¤ãã®æ¹ãçºçæå»ãæ©ãå ´å
|
---|
247 | * 55: sta_alm(ALM1, 100U) // çºçï¼711
|
---|
248 | * 56: [target_hrt_get_current -> 610U]
|
---|
249 | * 57: [target_hrt_set_event <- 101U]
|
---|
250 | * 58: sta_alm(ALM2, 50U) // çºçï¼671
|
---|
251 | * 59: [target_hrt_get_current -> 620U]
|
---|
252 | * 60: [target_hrt_set_event <- 51U]
|
---|
253 | * 61: DO(target_raise_hrt_int(1U))
|
---|
254 | * slp_tsk()
|
---|
255 | * == HRT_HANDLER ==
|
---|
256 | * 62: [target_hrt_get_current -> 680U] // ALM2ãçºç
|
---|
257 | * == ALM2-4ï¼4åç®ï¼==
|
---|
258 | * 63: DO(target_raise_hrt_int(1U))
|
---|
259 | * RETURN
|
---|
260 | * 64: [target_hrt_get_current -> 690U]
|
---|
261 | * 65: [target_hrt_set_event <- 21U]
|
---|
262 | * == HRT_HANDLER ==
|
---|
263 | * 66: [target_hrt_get_current -> 720U] // ALM1ãçºç
|
---|
264 | * == ALM1-5ï¼5åç®ï¼==
|
---|
265 | * 67: wup_tsk(TASK1)
|
---|
266 | * 68: RETURN
|
---|
267 | * 69: [target_hrt_get_current -> 730U]
|
---|
268 | * 70: [target_hrt_set_event <- HRTCNT_EMPTY]
|
---|
269 | * == TASK1ï¼ç¶ãï¼==
|
---|
270 | * // 2ã¤ã®ã¿ã¤ã ã¤ãã³ããç»é²ï¼2ã¤ãã®ã¿ã¤ã ã¤ãã³ãã®ç»é²æç¹ã§ï¼
|
---|
271 | * // 1ã¤ãã®ã¿ã¤ã ã¤ãã³ãã®çºçæå»ãéãã¦ããå ´å
|
---|
272 | * 71: sta_alm(ALM1, 10U)
|
---|
273 | * 72: [target_hrt_get_current -> 740U] // çºçï¼751
|
---|
274 | * 73: [target_hrt_set_event <- 11U]
|
---|
275 | * 74: sta_alm(ALM2, 100U)
|
---|
276 | * 75: [target_hrt_get_current -> 760U] // çºçï¼861ï¼ALM1ãçºç
|
---|
277 | * 76: DO(target_raise_hrt_int(1U))
|
---|
278 | * slp_tsk()
|
---|
279 | * == HRT_HANDLER ==
|
---|
280 | * 77: [target_hrt_get_current -> 770U] // ALM1ãçºç
|
---|
281 | * == ALM1-6ï¼6åç®ï¼==
|
---|
282 | * 78: DO(target_raise_hrt_int(1U))
|
---|
283 | * RETURN
|
---|
284 | * 79: [target_hrt_get_current -> 780U]
|
---|
285 | * 80: [target_hrt_set_event <- 81U]
|
---|
286 | * == HRT_HANDLER == ... (C-2)
|
---|
287 | * 81: [target_hrt_get_current -> 810U] // ã¹ããªã¢ã¹å²è¾¼ã¿
|
---|
288 | * == target_hrt_set_event-N // target_raise_hrt_intã
|
---|
289 | * 82: assert(hrtcnt == 51U) // å¼ã¶ããã«ãã®å½¢ã§è¨è¿°
|
---|
290 | * DO(target_raise_hrt_int(1U))
|
---|
291 | * RETURN
|
---|
292 | * == HRT_HANDLER ==
|
---|
293 | * 83: [target_hrt_get_current -> 870U] // ALM2ãçºç
|
---|
294 | * == ALM2-5ï¼5åç®ï¼==
|
---|
295 | * 84: wup_tsk(TASK1)
|
---|
296 | * RETURN
|
---|
297 | * 85: [target_hrt_get_current -> 880U]
|
---|
298 | * 86: [target_hrt_set_event <- HRTCNT_EMPTY]
|
---|
299 | * == TASK1ï¼ç¶ãï¼==
|
---|
300 | * 87: DO(target_raise_hrt_int(0U))
|
---|
301 | * == HRT_HANDLER == ... (C-1)
|
---|
302 | * 88: [target_hrt_get_current -> 890U] // ã¹ããªã¢ã¹å²è¾¼ã¿
|
---|
303 | * 89: [target_hrt_set_event <- HRTCNT_EMPTY]
|
---|
304 | * == TASK1ï¼ç¶ãï¼==
|
---|
305 | * // ã¿ã¤ã ã¤ãã³ããç»é²å¾ã«æéãé²ãï¼å
|
---|
306 | é ã®ã¿ã¤ã ã¤ãã³ãã®çºçæ
|
---|
307 | * // å»ãéããç¶æ³ãä½ã
|
---|
308 | * 90: sta_alm(ALM1, 100U)
|
---|
309 | * 91: [target_hrt_get_current -> 900U] // çºçï¼1001
|
---|
310 | * 92: [target_hrt_set_event <- 101U]
|
---|
311 | * 93: adj_tim(200) // ALM1ã®çºçï¼801
|
---|
312 | * 94: [target_hrt_get_current -> 910U] // ALM1ãçºç
|
---|
313 | * 95: [target_hrt_raise_event] ... (A-2)
|
---|
314 | * 96: DO(target_raise_hrt_int(1U))
|
---|
315 | * slp_tsk()
|
---|
316 | * == HRT_HANDLER ==
|
---|
317 | * 97: [target_hrt_get_current -> 920U]
|
---|
318 | * == ALM1-7ï¼7åç®ï¼==
|
---|
319 | * 98: wup_tsk(TASK1)
|
---|
320 | * RETURN
|
---|
321 | * 99: [target_hrt_get_current -> 930U]
|
---|
322 | * 100: [target_hrt_set_event <- HRTCNT_EMPTY]
|
---|
323 | * == TASK1ï¼ç¶ãï¼==
|
---|
324 | * // ã¿ã¤ã ã¤ãã³ããç»é²å¾ã«æéãæ»ãï¼å
|
---|
325 | é ã®ã¿ã¤ã ã¤ãã³ãã®çºçæ
|
---|
326 | * // å»ã¾ã§ã®é«å解ã¿ã¤ãã®ã«ã¦ã³ãã¢ããå¤ãHRTCNT_BOUNDãè¶
|
---|
327 | ããç¶æ³
|
---|
328 | * // ãä½ã
|
---|
329 | * 101:sta_alm(ALM1, TMAX_RELTIM)
|
---|
330 | * 102: [target_hrt_get_current -> 940U] // çºçï¼4,000,000,941
|
---|
331 | * 103: [target_hrt_set_event <- 4000000001U]
|
---|
332 | * 104:adj_tim(-200) // çºçï¼4,000,001,141
|
---|
333 | * 105: [target_hrt_get_current -> 950U]
|
---|
334 | * 106: [target_hrt_set_event <- HRTCNT_BOUND] ... (A-4)
|
---|
335 | * // å¾å§æ«
|
---|
336 | * 107:stp_alm(ALM1)
|
---|
337 | * 108: [target_hrt_get_current -> 960U]
|
---|
338 | * 109: [target_hrt_set_event <- HRTCNT_EMPTY]
|
---|
339 | * 110:END
|
---|
340 | */
|
---|
341 |
|
---|
342 | #include <kernel.h>
|
---|
343 | #include <t_syslog.h>
|
---|
344 | #include "syssvc/test_svc.h"
|
---|
345 | #include "kernel_cfg.h"
|
---|
346 | #include "hrt_systim1.h"
|
---|
347 | #include "target_timer.h"
|
---|
348 |
|
---|
349 | #if !defined(HRT_CONFIG1) || defined(HRT_CONFIG2)
|
---|
350 | #error Compiler option "-DHRT_CONFIG1" is missing.
|
---|
351 | #endif
|
---|
352 |
|
---|
353 | #ifdef TOPPERS_SUPPORT_DRIFT
|
---|
354 | #define HRTCNT_EMPTY TMAX_RELTIM
|
---|
355 | #else /* TOPPERS_SUPPORT_DRIFT */
|
---|
356 | #define HRTCNT_EMPTY HRTCNT_BOUND
|
---|
357 | #endif /* TOPPERS_SUPPORT_DRIFT */
|
---|
358 |
|
---|
359 | #define target_hrt_get_current _kernel_target_hrt_get_current
|
---|
360 | #define target_hrt_set_event _kernel_target_hrt_set_event
|
---|
361 | #define target_hrt_raise_event _kernel_target_hrt_raise_event
|
---|
362 |
|
---|
363 | /* DO NOT DELETE THIS LINE -- gentest depends on it. */
|
---|
364 |
|
---|
365 | static uint_t alarm1_count = 0;
|
---|
366 |
|
---|
367 | void
|
---|
368 | alarm1_handler(intptr_t exinf)
|
---|
369 | {
|
---|
370 | ER_UINT ercd;
|
---|
371 |
|
---|
372 | switch (++alarm1_count) {
|
---|
373 | case 1:
|
---|
374 | check_point(8);
|
---|
375 | ercd = wup_tsk(TASK1);
|
---|
376 | check_ercd(ercd, E_OK);
|
---|
377 |
|
---|
378 | return;
|
---|
379 |
|
---|
380 | check_point(0);
|
---|
381 |
|
---|
382 | case 2:
|
---|
383 | check_point(20);
|
---|
384 | return;
|
---|
385 |
|
---|
386 | check_point(0);
|
---|
387 |
|
---|
388 | case 3:
|
---|
389 | check_point(35);
|
---|
390 | return;
|
---|
391 |
|
---|
392 | check_point(0);
|
---|
393 |
|
---|
394 | case 4:
|
---|
395 | check_point(47);
|
---|
396 | ercd = sta_alm(ALM3, 10U);
|
---|
397 | check_ercd(ercd, E_OK);
|
---|
398 |
|
---|
399 | check_point(49);
|
---|
400 | return;
|
---|
401 |
|
---|
402 | check_point(0);
|
---|
403 |
|
---|
404 | case 5:
|
---|
405 | check_point(67);
|
---|
406 | ercd = wup_tsk(TASK1);
|
---|
407 | check_ercd(ercd, E_OK);
|
---|
408 |
|
---|
409 | check_point(68);
|
---|
410 | return;
|
---|
411 |
|
---|
412 | check_point(0);
|
---|
413 |
|
---|
414 | case 6:
|
---|
415 | check_point(78);
|
---|
416 | target_raise_hrt_int(1U);
|
---|
417 |
|
---|
418 | return;
|
---|
419 |
|
---|
420 | check_point(0);
|
---|
421 |
|
---|
422 | case 7:
|
---|
423 | check_point(98);
|
---|
424 | ercd = wup_tsk(TASK1);
|
---|
425 | check_ercd(ercd, E_OK);
|
---|
426 |
|
---|
427 | return;
|
---|
428 |
|
---|
429 | check_point(0);
|
---|
430 |
|
---|
431 | default:
|
---|
432 | check_point(0);
|
---|
433 | }
|
---|
434 | check_point(0);
|
---|
435 | }
|
---|
436 |
|
---|
437 | static uint_t alarm2_count = 0;
|
---|
438 |
|
---|
439 | void
|
---|
440 | alarm2_handler(intptr_t exinf)
|
---|
441 | {
|
---|
442 | ER_UINT ercd;
|
---|
443 |
|
---|
444 | switch (++alarm2_count) {
|
---|
445 | case 1:
|
---|
446 | check_point(21);
|
---|
447 | target_raise_hrt_int(1U);
|
---|
448 |
|
---|
449 | return;
|
---|
450 |
|
---|
451 | check_point(0);
|
---|
452 |
|
---|
453 | case 2:
|
---|
454 | check_point(37);
|
---|
455 | ercd = wup_tsk(TASK1);
|
---|
456 | check_ercd(ercd, E_OK);
|
---|
457 |
|
---|
458 | return;
|
---|
459 |
|
---|
460 | check_point(0);
|
---|
461 |
|
---|
462 | case 3:
|
---|
463 | check_point(50);
|
---|
464 | return;
|
---|
465 |
|
---|
466 | check_point(0);
|
---|
467 |
|
---|
468 | case 4:
|
---|
469 | check_point(63);
|
---|
470 | target_raise_hrt_int(1U);
|
---|
471 |
|
---|
472 | return;
|
---|
473 |
|
---|
474 | check_point(0);
|
---|
475 |
|
---|
476 | case 5:
|
---|
477 | check_point(84);
|
---|
478 | ercd = wup_tsk(TASK1);
|
---|
479 | check_ercd(ercd, E_OK);
|
---|
480 |
|
---|
481 | return;
|
---|
482 |
|
---|
483 | check_point(0);
|
---|
484 |
|
---|
485 | default:
|
---|
486 | check_point(0);
|
---|
487 | }
|
---|
488 | check_point(0);
|
---|
489 | }
|
---|
490 |
|
---|
491 | static uint_t alarm3_count = 0;
|
---|
492 |
|
---|
493 | void
|
---|
494 | alarm3_handler(intptr_t exinf)
|
---|
495 | {
|
---|
496 | ER_UINT ercd;
|
---|
497 |
|
---|
498 | switch (++alarm3_count) {
|
---|
499 | case 1:
|
---|
500 | check_point(25);
|
---|
501 | ercd = wup_tsk(TASK1);
|
---|
502 | check_ercd(ercd, E_OK);
|
---|
503 |
|
---|
504 | return;
|
---|
505 |
|
---|
506 | check_point(0);
|
---|
507 |
|
---|
508 | case 2:
|
---|
509 | check_point(52);
|
---|
510 | ercd = wup_tsk(TASK1);
|
---|
511 | check_ercd(ercd, E_OK);
|
---|
512 |
|
---|
513 | return;
|
---|
514 |
|
---|
515 | check_point(0);
|
---|
516 |
|
---|
517 | default:
|
---|
518 | check_point(0);
|
---|
519 | }
|
---|
520 | check_point(0);
|
---|
521 | }
|
---|
522 |
|
---|
523 | void
|
---|
524 | task1(intptr_t exinf)
|
---|
525 | {
|
---|
526 | ER_UINT ercd;
|
---|
527 |
|
---|
528 | check_point(3);
|
---|
529 | ercd = sta_alm(ALM1, 100U);
|
---|
530 | check_ercd(ercd, E_OK);
|
---|
531 |
|
---|
532 | check_point(6);
|
---|
533 | target_raise_hrt_int(1U);
|
---|
534 |
|
---|
535 | ercd = slp_tsk();
|
---|
536 | check_ercd(ercd, E_OK);
|
---|
537 |
|
---|
538 | check_point(11);
|
---|
539 | ercd = sta_alm(ALM1, 100U);
|
---|
540 | check_ercd(ercd, E_OK);
|
---|
541 |
|
---|
542 | check_point(14);
|
---|
543 | ercd = sta_alm(ALM2, 100U);
|
---|
544 | check_ercd(ercd, E_OK);
|
---|
545 |
|
---|
546 | check_point(16);
|
---|
547 | ercd = sta_alm(ALM3, 110U);
|
---|
548 | check_ercd(ercd, E_OK);
|
---|
549 |
|
---|
550 | check_point(18);
|
---|
551 | target_raise_hrt_int(1U);
|
---|
552 |
|
---|
553 | ercd = slp_tsk();
|
---|
554 | check_ercd(ercd, E_OK);
|
---|
555 |
|
---|
556 | check_point(28);
|
---|
557 | ercd = sta_alm(ALM1, 100U);
|
---|
558 | check_ercd(ercd, E_OK);
|
---|
559 |
|
---|
560 | check_point(31);
|
---|
561 | ercd = sta_alm(ALM2, 100U);
|
---|
562 | check_ercd(ercd, E_OK);
|
---|
563 |
|
---|
564 | check_point(33);
|
---|
565 | target_raise_hrt_int(1U);
|
---|
566 |
|
---|
567 | ercd = slp_tsk();
|
---|
568 | check_ercd(ercd, E_OK);
|
---|
569 |
|
---|
570 | check_point(40);
|
---|
571 | ercd = sta_alm(ALM1, 100U);
|
---|
572 | check_ercd(ercd, E_OK);
|
---|
573 |
|
---|
574 | check_point(43);
|
---|
575 | ercd = sta_alm(ALM2, 100U);
|
---|
576 | check_ercd(ercd, E_OK);
|
---|
577 |
|
---|
578 | check_point(45);
|
---|
579 | target_raise_hrt_int(1U);
|
---|
580 |
|
---|
581 | ercd = slp_tsk();
|
---|
582 | check_ercd(ercd, E_OK);
|
---|
583 |
|
---|
584 | check_point(55);
|
---|
585 | ercd = sta_alm(ALM1, 100U);
|
---|
586 | check_ercd(ercd, E_OK);
|
---|
587 |
|
---|
588 | check_point(58);
|
---|
589 | ercd = sta_alm(ALM2, 50U);
|
---|
590 | check_ercd(ercd, E_OK);
|
---|
591 |
|
---|
592 | check_point(61);
|
---|
593 | target_raise_hrt_int(1U);
|
---|
594 |
|
---|
595 | ercd = slp_tsk();
|
---|
596 | check_ercd(ercd, E_OK);
|
---|
597 |
|
---|
598 | check_point(71);
|
---|
599 | ercd = sta_alm(ALM1, 10U);
|
---|
600 | check_ercd(ercd, E_OK);
|
---|
601 |
|
---|
602 | check_point(74);
|
---|
603 | ercd = sta_alm(ALM2, 100U);
|
---|
604 | check_ercd(ercd, E_OK);
|
---|
605 |
|
---|
606 | check_point(76);
|
---|
607 | target_raise_hrt_int(1U);
|
---|
608 |
|
---|
609 | ercd = slp_tsk();
|
---|
610 | check_ercd(ercd, E_OK);
|
---|
611 |
|
---|
612 | check_point(87);
|
---|
613 | target_raise_hrt_int(0U);
|
---|
614 |
|
---|
615 | check_point(90);
|
---|
616 | ercd = sta_alm(ALM1, 100U);
|
---|
617 | check_ercd(ercd, E_OK);
|
---|
618 |
|
---|
619 | check_point(93);
|
---|
620 | ercd = adj_tim(200);
|
---|
621 | check_ercd(ercd, E_OK);
|
---|
622 |
|
---|
623 | check_point(96);
|
---|
624 | target_raise_hrt_int(1U);
|
---|
625 |
|
---|
626 | ercd = slp_tsk();
|
---|
627 | check_ercd(ercd, E_OK);
|
---|
628 |
|
---|
629 | check_point(101);
|
---|
630 | ercd = sta_alm(ALM1, TMAX_RELTIM);
|
---|
631 | check_ercd(ercd, E_OK);
|
---|
632 |
|
---|
633 | check_point(104);
|
---|
634 | ercd = adj_tim(-200);
|
---|
635 | check_ercd(ercd, E_OK);
|
---|
636 |
|
---|
637 | check_point(107);
|
---|
638 | ercd = stp_alm(ALM1);
|
---|
639 | check_ercd(ercd, E_OK);
|
---|
640 |
|
---|
641 | check_finish(110);
|
---|
642 | check_point(0);
|
---|
643 | }
|
---|
644 |
|
---|
645 | static uint_t target_hrt_get_current_count = 0;
|
---|
646 |
|
---|
647 | HRTCNT
|
---|
648 | target_hrt_get_current(void)
|
---|
649 | {
|
---|
650 |
|
---|
651 | switch (++target_hrt_get_current_count) {
|
---|
652 | case 1:
|
---|
653 | test_start(__FILE__);
|
---|
654 |
|
---|
655 | check_point(1);
|
---|
656 | return(10U);
|
---|
657 |
|
---|
658 | check_point(0);
|
---|
659 |
|
---|
660 | case 2:
|
---|
661 | check_point(4);
|
---|
662 | return(20U);
|
---|
663 |
|
---|
664 | check_point(0);
|
---|
665 |
|
---|
666 | case 3:
|
---|
667 | check_point(7);
|
---|
668 | return(130U);
|
---|
669 |
|
---|
670 | check_point(0);
|
---|
671 |
|
---|
672 | case 4:
|
---|
673 | check_point(9);
|
---|
674 | return(140U);
|
---|
675 |
|
---|
676 | check_point(0);
|
---|
677 |
|
---|
678 | case 5:
|
---|
679 | check_point(12);
|
---|
680 | return(150U);
|
---|
681 |
|
---|
682 | check_point(0);
|
---|
683 |
|
---|
684 | case 6:
|
---|
685 | check_point(15);
|
---|
686 | return(160U);
|
---|
687 |
|
---|
688 | check_point(0);
|
---|
689 |
|
---|
690 | case 7:
|
---|
691 | check_point(17);
|
---|
692 | return(170U);
|
---|
693 |
|
---|
694 | check_point(0);
|
---|
695 |
|
---|
696 | case 8:
|
---|
697 | check_point(19);
|
---|
698 | return(261U);
|
---|
699 |
|
---|
700 | check_point(0);
|
---|
701 |
|
---|
702 | case 9:
|
---|
703 | check_point(22);
|
---|
704 | return(280U);
|
---|
705 |
|
---|
706 | check_point(0);
|
---|
707 |
|
---|
708 | case 10:
|
---|
709 | check_point(24);
|
---|
710 | return(290U);
|
---|
711 |
|
---|
712 | check_point(0);
|
---|
713 |
|
---|
714 | case 11:
|
---|
715 | check_point(26);
|
---|
716 | return(300U);
|
---|
717 |
|
---|
718 | check_point(0);
|
---|
719 |
|
---|
720 | case 12:
|
---|
721 | check_point(29);
|
---|
722 | return(310U);
|
---|
723 |
|
---|
724 | check_point(0);
|
---|
725 |
|
---|
726 | case 13:
|
---|
727 | check_point(32);
|
---|
728 | return(320U);
|
---|
729 |
|
---|
730 | check_point(0);
|
---|
731 |
|
---|
732 | case 14:
|
---|
733 | check_point(34);
|
---|
734 | return(420U);
|
---|
735 |
|
---|
736 | check_point(0);
|
---|
737 |
|
---|
738 | case 15:
|
---|
739 | check_point(36);
|
---|
740 | return(430U);
|
---|
741 |
|
---|
742 | check_point(0);
|
---|
743 |
|
---|
744 | case 16:
|
---|
745 | check_point(38);
|
---|
746 | return(440U);
|
---|
747 |
|
---|
748 | check_point(0);
|
---|
749 |
|
---|
750 | case 17:
|
---|
751 | check_point(41);
|
---|
752 | return(450U);
|
---|
753 |
|
---|
754 | check_point(0);
|
---|
755 |
|
---|
756 | case 18:
|
---|
757 | check_point(44);
|
---|
758 | return(460U);
|
---|
759 |
|
---|
760 | check_point(0);
|
---|
761 |
|
---|
762 | case 19:
|
---|
763 | check_point(46);
|
---|
764 | return(560U);
|
---|
765 |
|
---|
766 | check_point(0);
|
---|
767 |
|
---|
768 | case 20:
|
---|
769 | check_point(48);
|
---|
770 | return(570U);
|
---|
771 |
|
---|
772 | check_point(0);
|
---|
773 |
|
---|
774 | case 21:
|
---|
775 | check_point(51);
|
---|
776 | return(590U);
|
---|
777 |
|
---|
778 | check_point(0);
|
---|
779 |
|
---|
780 | case 22:
|
---|
781 | check_point(53);
|
---|
782 | return(600U);
|
---|
783 |
|
---|
784 | check_point(0);
|
---|
785 |
|
---|
786 | case 23:
|
---|
787 | check_point(56);
|
---|
788 | return(610U);
|
---|
789 |
|
---|
790 | check_point(0);
|
---|
791 |
|
---|
792 | case 24:
|
---|
793 | check_point(59);
|
---|
794 | return(620U);
|
---|
795 |
|
---|
796 | check_point(0);
|
---|
797 |
|
---|
798 | case 25:
|
---|
799 | check_point(62);
|
---|
800 | return(680U);
|
---|
801 |
|
---|
802 | check_point(0);
|
---|
803 |
|
---|
804 | case 26:
|
---|
805 | check_point(64);
|
---|
806 | return(690U);
|
---|
807 |
|
---|
808 | check_point(0);
|
---|
809 |
|
---|
810 | case 27:
|
---|
811 | check_point(66);
|
---|
812 | return(720U);
|
---|
813 |
|
---|
814 | check_point(0);
|
---|
815 |
|
---|
816 | case 28:
|
---|
817 | check_point(69);
|
---|
818 | return(730U);
|
---|
819 |
|
---|
820 | check_point(0);
|
---|
821 |
|
---|
822 | case 29:
|
---|
823 | check_point(72);
|
---|
824 | return(740U);
|
---|
825 |
|
---|
826 | check_point(0);
|
---|
827 |
|
---|
828 | case 30:
|
---|
829 | check_point(75);
|
---|
830 | return(760U);
|
---|
831 |
|
---|
832 | check_point(0);
|
---|
833 |
|
---|
834 | case 31:
|
---|
835 | check_point(77);
|
---|
836 | return(770U);
|
---|
837 |
|
---|
838 | check_point(0);
|
---|
839 |
|
---|
840 | case 32:
|
---|
841 | check_point(79);
|
---|
842 | return(780U);
|
---|
843 |
|
---|
844 | check_point(0);
|
---|
845 |
|
---|
846 | case 33:
|
---|
847 | check_point(81);
|
---|
848 | return(810U);
|
---|
849 |
|
---|
850 | check_point(0);
|
---|
851 |
|
---|
852 | case 34:
|
---|
853 | check_point(83);
|
---|
854 | return(870U);
|
---|
855 |
|
---|
856 | check_point(0);
|
---|
857 |
|
---|
858 | case 35:
|
---|
859 | check_point(85);
|
---|
860 | return(880U);
|
---|
861 |
|
---|
862 | check_point(0);
|
---|
863 |
|
---|
864 | case 36:
|
---|
865 | check_point(88);
|
---|
866 | return(890U);
|
---|
867 |
|
---|
868 | check_point(0);
|
---|
869 |
|
---|
870 | case 37:
|
---|
871 | check_point(91);
|
---|
872 | return(900U);
|
---|
873 |
|
---|
874 | check_point(0);
|
---|
875 |
|
---|
876 | case 38:
|
---|
877 | check_point(94);
|
---|
878 | return(910U);
|
---|
879 |
|
---|
880 | check_point(0);
|
---|
881 |
|
---|
882 | case 39:
|
---|
883 | check_point(97);
|
---|
884 | return(920U);
|
---|
885 |
|
---|
886 | check_point(0);
|
---|
887 |
|
---|
888 | case 40:
|
---|
889 | check_point(99);
|
---|
890 | return(930U);
|
---|
891 |
|
---|
892 | check_point(0);
|
---|
893 |
|
---|
894 | case 41:
|
---|
895 | check_point(102);
|
---|
896 | return(940U);
|
---|
897 |
|
---|
898 | check_point(0);
|
---|
899 |
|
---|
900 | case 42:
|
---|
901 | check_point(105);
|
---|
902 | return(950U);
|
---|
903 |
|
---|
904 | check_point(0);
|
---|
905 |
|
---|
906 | case 43:
|
---|
907 | check_point(108);
|
---|
908 | return(960U);
|
---|
909 |
|
---|
910 | check_point(0);
|
---|
911 |
|
---|
912 | default:
|
---|
913 | check_point(0);
|
---|
914 | }
|
---|
915 | check_point(0);
|
---|
916 | return(0U);
|
---|
917 | }
|
---|
918 |
|
---|
919 | static uint_t target_hrt_raise_event_count = 0;
|
---|
920 |
|
---|
921 | void
|
---|
922 | target_hrt_raise_event(void)
|
---|
923 | {
|
---|
924 |
|
---|
925 | switch (++target_hrt_raise_event_count) {
|
---|
926 | case 1:
|
---|
927 | check_point(95);
|
---|
928 | return;
|
---|
929 |
|
---|
930 | check_point(0);
|
---|
931 |
|
---|
932 | default:
|
---|
933 | check_point(0);
|
---|
934 | }
|
---|
935 | check_point(0);
|
---|
936 | }
|
---|
937 |
|
---|
938 | static uint_t target_hrt_set_event_count = 0;
|
---|
939 |
|
---|
940 | void
|
---|
941 | target_hrt_set_event(HRTCNT hrtcnt)
|
---|
942 | {
|
---|
943 |
|
---|
944 | switch (++target_hrt_set_event_count) {
|
---|
945 | case 1:
|
---|
946 | check_point(2);
|
---|
947 | check_assert(hrtcnt == HRTCNT_EMPTY);
|
---|
948 |
|
---|
949 | return;
|
---|
950 |
|
---|
951 | check_point(0);
|
---|
952 |
|
---|
953 | case 2:
|
---|
954 | check_point(5);
|
---|
955 | check_assert(hrtcnt == 101U);
|
---|
956 |
|
---|
957 | return;
|
---|
958 |
|
---|
959 | check_point(0);
|
---|
960 |
|
---|
961 | case 3:
|
---|
962 | check_point(10);
|
---|
963 | check_assert(hrtcnt == HRTCNT_EMPTY);
|
---|
964 |
|
---|
965 | return;
|
---|
966 |
|
---|
967 | check_point(0);
|
---|
968 |
|
---|
969 | case 4:
|
---|
970 | check_point(13);
|
---|
971 | check_assert(hrtcnt == 101U);
|
---|
972 |
|
---|
973 | return;
|
---|
974 |
|
---|
975 | check_point(0);
|
---|
976 |
|
---|
977 | case 5:
|
---|
978 | check_point(23);
|
---|
979 | check_assert(hrtcnt == 1U);
|
---|
980 |
|
---|
981 | return;
|
---|
982 |
|
---|
983 | check_point(0);
|
---|
984 |
|
---|
985 | case 6:
|
---|
986 | check_point(27);
|
---|
987 | check_assert(hrtcnt == HRTCNT_EMPTY);
|
---|
988 |
|
---|
989 | return;
|
---|
990 |
|
---|
991 | check_point(0);
|
---|
992 |
|
---|
993 | case 7:
|
---|
994 | check_point(30);
|
---|
995 | check_assert(hrtcnt == 101U);
|
---|
996 |
|
---|
997 | return;
|
---|
998 |
|
---|
999 | check_point(0);
|
---|
1000 |
|
---|
1001 | case 8:
|
---|
1002 | check_point(39);
|
---|
1003 | check_assert(hrtcnt == HRTCNT_EMPTY);
|
---|
1004 |
|
---|
1005 | return;
|
---|
1006 |
|
---|
1007 | check_point(0);
|
---|
1008 |
|
---|
1009 | case 9:
|
---|
1010 | check_point(42);
|
---|
1011 | check_assert(hrtcnt == 101U);
|
---|
1012 |
|
---|
1013 | return;
|
---|
1014 |
|
---|
1015 | check_point(0);
|
---|
1016 |
|
---|
1017 | case 10:
|
---|
1018 | check_point(54);
|
---|
1019 | check_assert(hrtcnt == HRTCNT_EMPTY);
|
---|
1020 |
|
---|
1021 | return;
|
---|
1022 |
|
---|
1023 | check_point(0);
|
---|
1024 |
|
---|
1025 | case 11:
|
---|
1026 | check_point(57);
|
---|
1027 | check_assert(hrtcnt == 101U);
|
---|
1028 |
|
---|
1029 | return;
|
---|
1030 |
|
---|
1031 | check_point(0);
|
---|
1032 |
|
---|
1033 | case 12:
|
---|
1034 | check_point(60);
|
---|
1035 | check_assert(hrtcnt == 51U);
|
---|
1036 |
|
---|
1037 | return;
|
---|
1038 |
|
---|
1039 | check_point(0);
|
---|
1040 |
|
---|
1041 | case 13:
|
---|
1042 | check_point(65);
|
---|
1043 | check_assert(hrtcnt == 21U);
|
---|
1044 |
|
---|
1045 | return;
|
---|
1046 |
|
---|
1047 | check_point(0);
|
---|
1048 |
|
---|
1049 | case 14:
|
---|
1050 | check_point(70);
|
---|
1051 | check_assert(hrtcnt == HRTCNT_EMPTY);
|
---|
1052 |
|
---|
1053 | return;
|
---|
1054 |
|
---|
1055 | check_point(0);
|
---|
1056 |
|
---|
1057 | case 15:
|
---|
1058 | check_point(73);
|
---|
1059 | check_assert(hrtcnt == 11U);
|
---|
1060 |
|
---|
1061 | return;
|
---|
1062 |
|
---|
1063 | check_point(0);
|
---|
1064 |
|
---|
1065 | case 16:
|
---|
1066 | check_point(80);
|
---|
1067 | check_assert(hrtcnt == 81U);
|
---|
1068 |
|
---|
1069 | return;
|
---|
1070 |
|
---|
1071 | check_point(0);
|
---|
1072 |
|
---|
1073 | case 17:
|
---|
1074 | check_point(82);
|
---|
1075 | check_assert(hrtcnt == 51U);
|
---|
1076 |
|
---|
1077 | target_raise_hrt_int(1U);
|
---|
1078 |
|
---|
1079 | return;
|
---|
1080 |
|
---|
1081 | check_point(0);
|
---|
1082 |
|
---|
1083 | case 18:
|
---|
1084 | check_point(86);
|
---|
1085 | check_assert(hrtcnt == HRTCNT_EMPTY);
|
---|
1086 |
|
---|
1087 | return;
|
---|
1088 |
|
---|
1089 | check_point(0);
|
---|
1090 |
|
---|
1091 | case 19:
|
---|
1092 | check_point(89);
|
---|
1093 | check_assert(hrtcnt == HRTCNT_EMPTY);
|
---|
1094 |
|
---|
1095 | return;
|
---|
1096 |
|
---|
1097 | check_point(0);
|
---|
1098 |
|
---|
1099 | case 20:
|
---|
1100 | check_point(92);
|
---|
1101 | check_assert(hrtcnt == 101U);
|
---|
1102 |
|
---|
1103 | return;
|
---|
1104 |
|
---|
1105 | check_point(0);
|
---|
1106 |
|
---|
1107 | case 21:
|
---|
1108 | check_point(100);
|
---|
1109 | check_assert(hrtcnt == HRTCNT_EMPTY);
|
---|
1110 |
|
---|
1111 | return;
|
---|
1112 |
|
---|
1113 | check_point(0);
|
---|
1114 |
|
---|
1115 | case 22:
|
---|
1116 | check_point(103);
|
---|
1117 | check_assert(hrtcnt == 4000000001U);
|
---|
1118 |
|
---|
1119 | return;
|
---|
1120 |
|
---|
1121 | check_point(0);
|
---|
1122 |
|
---|
1123 | case 23:
|
---|
1124 | check_point(106);
|
---|
1125 | check_assert(hrtcnt == HRTCNT_BOUND);
|
---|
1126 |
|
---|
1127 | return;
|
---|
1128 |
|
---|
1129 | check_point(0);
|
---|
1130 |
|
---|
1131 | case 24:
|
---|
1132 | check_point(109);
|
---|
1133 | check_assert(hrtcnt == HRTCNT_EMPTY);
|
---|
1134 |
|
---|
1135 | return;
|
---|
1136 |
|
---|
1137 | check_point(0);
|
---|
1138 |
|
---|
1139 | default:
|
---|
1140 | check_point(0);
|
---|
1141 | }
|
---|
1142 | check_point(0);
|
---|
1143 | }
|
---|