source: rtems/c/src/ada-tests/tmtests/tm26/tmtest.ads @ 6d4e604b

4.104.114.84.95
Last change on this file since 6d4e604b was 6d4e604b, checked in by Joel Sherrill <joel.sherrill@…>, on 06/02/97 at 20:19:03

Initial revision

  • Property mode set to 100644
File size: 6.2 KB
Line 
1--
2--  TMTEST / SPECIFICATION
3--
4--  DESCRIPTION:
5--
6--  This package is the specification for Test 26 of the RTEMS
7--  Timing Test Suite.
8--
9--  DEPENDENCIES:
10--
11-- 
12--
13--  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
14--  On-Line Applications Research Corporation (OAR).
15--  All rights assigned to U.S. Government, 1994.
16--
17--  This material may be reproduced by or for the U.S. Government pursuant
18--  to the copyright license under the clause at DFARS 252.227-7013.  This
19--  notice must appear in all copies of this file and its derivatives.
20--
21--  tmtest.ads,v 1.3 1995/07/12 19:44:27 joel Exp
22--
23
24with TIMER_DRIVER;
25with RTEMS;
26
27package TMTEST is
28
29--
30--  This points to the RTEMS task control block for the MIDDLE_TASK.
31--
32
33   MIDDLE_TCB   : RTEMS.TCB_POINTER;
34
35--
36--  The following is the ID of the semaphore used for timing operations.
37--
38
39   SEMAPHORE_ID : RTEMS.ID;
40
41--
42--  The following variable is set to the execution time returned
43--  by the timer.
44--
45
46   END_TIME     : RTEMS.UNSIGNED32;
47
48--
49--  INIT
50--
51--  DESCRIPTION:
52--
53--  This RTEMS task initializes the application.
54--
55
56   procedure INIT (
57      ARGUMENT : in     RTEMS.TASK_ARGUMENT
58   );
59
60--
61--  NULL_TASK
62--
63--  DESCRIPTION:
64--
65--  This RTEMS task has a NULL body and is only included to
66--  allow TASK_START to be invoked without impacting another
67--  task.
68--
69
70   procedure NULL_TASK (
71      ARGUMENT : in     RTEMS.TASK_ARGUMENT
72   );
73
74--
75--  HIGH_TASK
76--
77--  DESCRIPTION:
78--
79--  This RTEMS task is the highest priority test task and
80--  thus executes first.  It is responsible for measuring
81--  and reporting the following times:
82--
83--    + THREAD_DISABLE_DISPATCH
84--    + THREAD_ENABLE_DISPATCH
85--    + THREAD_SET_STATE
86--
87--  After measuring and reporting the above times, this task
88--  starts the timer and forces dispatch to the MIDDLE_TASK.
89--
90
91   procedure HIGH_TASK (
92      ARGUMENT : in     RTEMS.TASK_ARGUMENT
93   );
94
95--
96--  MIDDLE_TASK
97--
98--  DESCRIPTION:
99--
100--  This RTEMS task stops the timer and reports the execution
101--  time for THREAD_DISPATCH without any floating point context
102--  save and restore involved.  Following this, it starts the
103--  timer and forces a CONTEXT_SWITCH to the LOW_TASK.
104--
105
106   procedure MIDDLE_TASK (
107      ARGUMENT : in     RTEMS.TASK_ARGUMENT
108   );
109
110--
111--  LOW_TASK
112--
113--  DESCRIPTION:
114--
115--  This RTEMS task stops the timer and reports the execution
116--  time for a raw CONTEXT_SWITCH without any floating point context
117--  save and restore involved.  Following this, it starts the
118--  timer and performs a CONTEXT_RESTORE_FP for the FLOATING_POINT_TASK_1
119--  and a CONTEXT_SWITCH to FLOATING_POINT_TASK_1.
120--
121
122   procedure LOW_TASK (
123      ARGUMENT : in     RTEMS.TASK_ARGUMENT
124   );
125
126--
127--  FLOATING_POINT_TASK_1
128--
129--  DESCRIPTION:
130--
131--  This RTEMS task stops the timer and reports the execution
132--  time for a CONTEXT_SWITCH which restores the first floating
133--  point context.  Following this, it starts the
134--  timer and performs a CONTEXT_SAVE_FP and CONTEXT_RESTORE_FP
135--  and a CONTEXT_SWITCH to FLOATING_POINT_TASK_2.  Once
136--  control is returned to this task FLOATING_POINT_TASK_2, the
137--  timer is stopped and the execution time for CONTEXT_SWITCH
138--  from a used to an initialized floating point context is reported.
139--  Following this, it starts the timer and performs a
140--  CONTEXT_SAVE_FP and CONTEXT_RESTORE_FP and a CONTEXT_SWITCH
141--  to FLOATING_POINT_TASK_2. 
142--
143
144   procedure FLOATING_POINT_TASK_1 (
145      ARGUMENT : in     RTEMS.TASK_ARGUMENT
146   );
147
148--
149--  FLOATING_POINT_TASK_2
150--
151--  DESCRIPTION:
152--
153--  This RTEMS task stops the timer and reports the execution
154--  time for a CONTEXT_SWITCH which switches from one freshly
155--  initialized floating point context to another freshly
156--  initialized floating point context.  Following this, it
157--  "dirties" its floating point context and starts the
158--  timer.  After this it performs a CONTEXT_SAVE_FP and
159--  CONTEXT_RESTORE_FP and a CONTEXT_SWITCH to FLOATING_POINT_TASK_1.
160--  Once control is returned to this task FLOATING_POINT_TASK_2, the
161--  timer is stopped and the execution time for CONTEXT_SWITCH
162--  from one used floating point context to another used floating
163--  point context is reported.  After this, this task invokes
164--  the COMPLETE_TEST subprogram to measure and report
165--  the remaining execution times measured by this test.
166-- 
167
168   procedure FLOATING_POINT_TASK_2 (
169      ARGUMENT : in     RTEMS.TASK_ARGUMENT
170   );
171
172--
173--  COMPLETE_TEST
174--
175--  DESCRIPTION:
176--
177--  This subprogram is responsible for measuring and reporting the
178--  following execution times:
179--
180--    + THREAD_RESUME
181--    + THREAD_UNBLOCK
182--    + THREAD_READY
183--    + THREAD_GET with a valid id
184--    + THREAD_GET with an invalid id
185--
186
187   procedure COMPLETE_TEST;
188
189--
190--  This is the Initialization Tasks Table for this test.
191--
192
193   INITIALIZATION_TASKS : aliased RTEMS.INITIALIZATION_TASKS_TABLE( 1 .. 1 ) :=
194   (1=>
195     (
196       RTEMS.BUILD_NAME( 'U', 'I', '1', ' ' ),        -- task name
197       2048,                                          -- stack size
198       1,                                             -- priority
199       RTEMS.DEFAULT_ATTRIBUTES,                      -- attributes
200       TMTEST.INIT'ACCESS,                            -- entry point
201       RTEMS.NO_PREEMPT,                              -- initial mode
202       0                                              -- argument list
203     )
204   );
205
206--
207--  This is the Configuration Table for this test.
208--
209
210   CONFIGURATION : aliased RTEMS.CONFIGURATION_TABLE := (
211      RTEMS.NULL_ADDRESS,        -- will be replaced by BSP
212      256 * 1024,                -- executive RAM size
213      111,                       -- maximum # tasks
214      0,                         -- maximum # timers
215      1,                         -- maximum # semaphores
216      0,                         -- maximum # message queues
217      0,                         -- maximum # messages
218      0,                         -- maximum # partitions
219      0,                         -- maximum # regions
220      0,                         -- maximum # dp memory areas
221      0,                         -- maximum # periods
222      0,                         -- maximum # user extensions
223      RTEMS.MILLISECONDS_TO_MICROSECONDS(10), -- # us in a tick
224      0                          -- # ticks in a timeslice
225  );
226
227end TMTEST;
Note: See TracBrowser for help on using the repository browser.