home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / ada / 2376 < prev    next >
Encoding:
Internet Message Format  |  1992-08-17  |  10.2 KB

  1. Path: sparky!uunet!sun-barr!ames!agate!ucbvax!ROO.FIT.EDU!SAHARBAUGH
  2. From: SAHARBAUGH@ROO.FIT.EDU
  3. Newsgroups: comp.lang.ada
  4. Subject: zzz K1 explanation
  5. Message-ID: <9208171224.AA26522@ajpo.sei.cmu.edu>
  6. Date: 17 Aug 92 12:20:00 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Distribution: world
  9. Organization: The Internet
  10. Lines: 279
  11.  
  12. K1 - A alternate Ada task scheduler and supporting 
  13. tools for hard real-time embedded systems
  14.  
  15. K1 provides hard deadline Ada task scheduling 
  16. (periodic and aperiodic), task performance 
  17. monitoring, task overrun detection and supporting 
  18. CASE tools.
  19.  
  20. Features:
  21.  
  22. An Ada Task can switch itself to being a K1 Task
  23.  
  24. Periodic K1 Tasks are Scheduled on a Frame/Subframe 
  25. Timeline
  26.  
  27. K1 Task Scheduling can be dynamically altered
  28.  
  29. K1 Task Timing Performance is measured and reported 
  30. to your Ada program
  31.  
  32. K1 Task Timing Overrun is detected and reported to 
  33. your Ada program
  34.  
  35. K1 Task Priority can be dynamically altered
  36.  
  37. Precision Delay is provided for use in K1 tasks
  38.  
  39. Graphical Workstation Tools are provided for 
  40. convenience in configuring the K1 Real-Time 
  41. Executive and individual K1 Tasks
  42.  
  43.  
  44. The K1 Real-Time Executive:
  45.  
  46. The K1 Real-Time Executive is an integrated part of 
  47. the Ada Runtime Environment.  K1 scheduling is 
  48. implemented using a frame/subframe model of time.  
  49. Periodic K1 tasks are scheduled to run in one, 
  50. several or all subframes.  The scheduling of 
  51. periodic K1 tasks can be done initially by the 
  52. designer, using the Task Generation Tool on the 
  53. host workstation.  The scheduling may be altered 
  54. dynamically within task bodies.
  55.  
  56. The K1 Real-Time executive consists of a Scheduler, 
  57. a Dispatcher and a Time Overrun Detector.  The 
  58. Scheduler builds a K1 task schedule according to 
  59. data passed when an Ada task starts as a K1 Task.
  60.  
  61. The Dispatcher allocates the CPU resource on a 
  62. priority basis.  Dispatching occurs at the 
  63. beginning of a subframe or when a K1 task 
  64. voluntarily gives-up the CPU.  The highest priority 
  65. ready-to-run K1 task is dispatched next.  In case 
  66. there is more than one ready-to-run K1 task with 
  67. highest priority, then Periodic Tasks are chosen 
  68. before Aperiodic Tasks.  Periodic tasks which have 
  69. not yet had any execution time are chosen before 
  70. tasks that have executed previously.  Tasks of 
  71. equal rank and priority are chosen in the order 
  72. they are queued.
  73.  
  74. The Dispatcher records K1 task dispatching event 
  75. times for the application program to analyze and 
  76. act upon.  Performance statistics can be collected.  
  77. Misbehaving tasks can be detected before a hard 
  78. failure occurs.  In this way an application program 
  79. can detect and adjust resource usage of tasks which 
  80. overrun their timing allotment.  Task(s) can be 
  81. stopped and/or their K1 task priority(s) changed, 
  82. etc., as desired.
  83.  
  84. The Time Overrun Detector, part of the dispatcher, 
  85. determines when a task does not complete execution 
  86. in its specified number of subframes.  If an 
  87. overrun is detected an error routine in the 
  88. application program is called.   The error routine 
  89. can take corrective action such as stopping a 
  90. task(s), changing task(s) priority, etc.
  91.  
  92. A static Ada task is one declared at compile time.  
  93. Any static Ada task may call the runtime to be 
  94. scheduled as a K1 task.  The task passes the 
  95. following information with the call:
  96.  
  97. - Task ID and K1 Priority
  98. - Periodic or Aperiodic Scheduling
  99. - If Periodic, which subframe(s) to be scheduled in
  100. - Number of subframes allowed for completion
  101.  
  102. After scheduling itself, the K1 task is controlled 
  103. by the K1 runtime executive until it calls the 
  104. runtime to be canceled as a K1 task.  After 
  105. canceling itself as a K1 task, the task reverts to 
  106. being a conventional Ada task.  The task can 
  107. schedule itself as a K1 task and cancel as often as 
  108. desired.
  109.  
  110.  
  111. Relationship of Conventional Ada Tasks to K1 Tasks:
  112.  
  113. All K1 tasks begin as conventional Ada tasks.  They 
  114. call the K1 Runtime Executive to be scheduled as K1 
  115. tasks.  They can call the runtime again to revert 
  116. to being conventional Ada tasks.
  117.  
  118. K1 tasks have a higher priority than all 
  119. conventional Ada tasks.  The K1 Real-Time Executive 
  120. has a higher priority than the conventional 
  121. runtime.  Therefore the highest priority K1 task 
  122. has priority over everything except the K1 subframe 
  123. clock tick interrupt, the reset button interrupt 
  124. and hardware interrupts.
  125.  
  126. K1 tasks have Ada scope and visibility rules and 
  127. therefore data structures can be visible from both 
  128. K1 tasks and conventional Ada tasks.  A K1 task can 
  129. pass data through such structures.
  130.  
  131. A K1 Task's priority value determines how it is 
  132. dispatched and how the Time Overrun Detector 
  133. operates.  
  134.  
  135. Aperiodic tasks can be given any initial or dynamic 
  136. priority value from 1 to Pmax.  When its priority 
  137. value is less than P2 the Time Overrun Detector 
  138. does not monitor the amount of execution time it 
  139. consumes.  
  140.  
  141. Periodic tasks can be given any initial or dynamic 
  142. priority value from P2 to Pmax.  The Time Overrun 
  143. Detector always monitors periodic tasks.  If the 
  144. periodic task's priority is between P2 and P3 then 
  145. the number of subframes specified when the task was 
  146. instated is used by the Time Overrun Alarm.  If the 
  147. periodic task's priority is between P3 and Pmax 
  148. then the Time Overrun Detector checks to see that 
  149. the task completed execution in one subframe, 
  150. regardless of the number of subframes specified 
  151. when scheduled as a K1 task.
  152.  
  153. A K1 task's execution time behavior is classified 
  154. as Deterministic, Bounded Non-Deterministic or Non-
  155. Deterministic.  A task in the priority range of 1 
  156. to P2 is treated as Non-Deterministic, no execution 
  157. timing checks are performed on it.  A task in the 
  158. priority range of P2 to P3 is treated as Bounded 
  159. Non-Deterministic, execution is expected to 
  160. complete in the number of subframes specified.  A 
  161. task in the priority range of P3 to Pmax is treated 
  162. as Deterministic, execution is expected to complete 
  163. in the subframe in which it started.
  164.  
  165. As a consequence of this behavior 1) a periodic 
  166. task cannot be non-deterministic because it could 
  167. try to start again before it had completed its 
  168. previous start, 2) the bound of a bounded non-
  169. deterministic task must be less than the number of 
  170. subframes before it is scheduled to start again and 
  171. 3) a deterministic task can be scheduled in one, 
  172. several or all subframes because it must finish in 
  173. the subframe in which it started.
  174.  
  175. To assist the real time designer, there are three 
  176. K1 tools, 
  177.  
  178.   the runtime configuration tool (RCT), 
  179.   the task generation tool (TGT) and 
  180.   the task analysis tool (TAT).  
  181.  
  182. The runtime configuration tool can be used to set 
  183. up the parameters of the frame/subframe model, set 
  184. priority limits, etc.  
  185.  
  186. The  task generation tool can be used to configure 
  187. the timing behavior of each K1 task.  The TGT 
  188. produces a task template which includes appropriate 
  189. data structures and initial values to work with the 
  190. runtime.  The designer then uses an editor to 
  191. create the algorithm portion of each K1 task.
  192.  
  193. The runtime parameters are used in compiling the 
  194. runtime.  The K1 runtime is linked with the 
  195. conventional runtime, converted to s-records and 
  196. downloaded to the embedded computer.  The s-records 
  197. can be burned into EPROMs and plugged into the 
  198. embedded computer
  199.  
  200. The task analysis tool can be used to monitor 
  201. performance of a K1 task or a group of K1 tasks and 
  202. compare their performance against requirements.
  203.  
  204. The K1 Runtime Configuration Tool can be used by 
  205. the designer to set the scheduling parameters of 
  206. the K1 Real-Time Executive.   
  207.  
  208. The K1 Runtime Configuration Tool allows the frame 
  209. rate, number of subframes and the Priority 
  210. boundaries P2, P3 and Pmax to be easily set using a 
  211. graphical user interface.  The number of frames per 
  212. second and the number of subframes per frame are 
  213. also chosen using a graphical user interface.  The 
  214. frame rate and possible rates for periodic tasks 
  215. are automatically shown.
  216.  
  217. The K1 Real-Time Executive parameter values are 
  218. static and cannot be changed dynamically.  If one 
  219. or more of these values are changed the Runtime 
  220. must be recompiled and re-downloaded.  If the 
  221. runtime is in ROM then a new ROM must be loaded and 
  222. plugged into the embedded computer.
  223.  
  224. The K1 Task Generation Tool allows the timing 
  225. specification of each K1 task to be easily selected 
  226. using a graphical user interface.  Using a mouse, 
  227. the designer selects options which determine the 
  228. taskUs timing description.  
  229.  
  230. If the task is selected to be periodic then the 
  231. designer selects one of the available rates.  Note 
  232. that these available rates were determined when the 
  233. designer configured the K1 Real-Time Executive 
  234. using the Runtime Configuration Tool.
  235.  
  236. The designer selects the task's behavior 
  237. classification, Deterministic, Bounded Non-
  238. Deterministic or Non-Deterministic.  The Task 
  239. Generation Tool enforces the rules of the K1 Task 
  240. Priority Layout.  A Periodic Task cannot select 
  241. Non-Deterministic because there would be no 
  242. assurance that it would complete before its next 
  243. scheduled periodic execution begins.  The allowable 
  244. task priority selection depends on the task's 
  245. behavior classification and the Runtime 
  246. Configuration parameters.
  247.  
  248. Alternately, Ada tasks in existing programs can 
  249. easily be converted to K1 tasks using a text editor 
  250. to insert the K1 calls and data structures.
  251.  
  252.  
  253. Validation Considerations:
  254.  
  255. The validation suite will execute just as it did 
  256. before the K1 real-time executive was added into 
  257. the runtime environment.  Since the validation 
  258. suite does not call K1 to start any tasks as K1 
  259. tasks, the K1 real-time executive will be unused.
  260.  
  261. The validity of this approach is covered by AI-
  262. 00850* and the proposed Ada 9X Real-Time annex.
  263. (Ada Interpretations 00850 is available from the 
  264. AJPO data base or Integrated Software, Inc.)
  265.  
  266.  
  267. Status
  268.  
  269. K1 has been demonstrated on a Motorola MVME-147, 
  270. 68030 based single board computer.  The Ada Runtime 
  271. Environment including the K1 Real-Time Executive 
  272. was burned into EPROM and plugged into the single 
  273. board computer.  The demonstration program was 
  274. downloaded from a portable PC via a RS232 port.
  275.  
  276. The K1 tools are currently hosted on a SUN SPARC 
  277. workstation with a color monitor.  The Ada compiler 
  278. is currently the Verdix VADS 6.0 , 680X0 cross compiler.
  279.  
  280. K1 is planned to be demonstrated at Tri-Ada, Nov. 
  281. 16-20 in Orlando, Florida.
  282.  
  283. For more information contact:
  284.  
  285. Integrated Software, Inc.
  286. 1945 Palm Bay Rd #7
  287. Palm Bay, Florida 32905 USA
  288. (407) 984-1986
  289. (407) 951-4291 (fax)
  290.  
  291.