Design Automation for Embedded Systems

, Volume 7, Issue 1–2, pp 53–87 | Cite as

Stack Size Minimization for Embedded Real-Time Systems-on-a-Chip

  • Paolo Gai
  • Giuseppe Lipari
  • Marco Di Natale


The primary goal for real-time kernel software for single and multiple-processor on a chip systems is to support the design of timely and cost effective systems. The kernel must provide time guarantees, in order to predict the timely behaviorof the application, an extremely fast response time, in order not to waste computing power outside of the application cycles and save as much RAM space as possible in order to reduce the overall cost of the chip. The research on real-time software systems has produced algorithms that allow to effectively schedule system resources while guaranteeing the deadlines of the application and to group tasks in a very small number of non-preemptive sets which require much less RAM memory for stack. Unfortunately, up to now the research focus has been on time guarantees rather than on the optimization of RAM usage.Furthermore, these techniques do not apply to multiprocessor architectures which are likely to be widely used in future microcontrollers. This paper presents innovative scheduling and optimization algorithms that effectively solve the problem of guaranteeing schedulability with an extremely little operating system overhead and minimizing RAM usage. We developed a fast and simple algorithm for sharing resources in multiprocessor systems, together with an innovative procedure for assigning a preemption threshold to tasks. These allow the use of a single user stack. The experimental part shows the effectiveness of a simulated annealing-based tool that allows to find a schedulable system configuration starting from the selection of a near-optimal task allocation. When used in conjunction with our preemption threshold assignment algorithm, our tool further reduces the RAM usage in multiprocessor systems.

Multiprocessor scheduling operating systems real-time stack size minimization 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Aarts, E. and J. Korst. Simulated Annealing and Boltzmann Machines. John Wiley & Sons, 1989.Google Scholar
  2. 2.
    Baker, T. Stack-Based Scheduling of Real-Time Processes. Journal of Real-Time Systems, vol.3, 1991.Google Scholar
  3. 3.
    Baruah, S., A. Mok, and L. Rosier. Preemptively Scheduling Hard-Real-Time Sporadic Tasks on One Processor. In Proceedings of the 11th IEEE Real-Time Systems Symposium, 1990a, pp.182–190.Google Scholar
  4. 4.
    Baruah, S., L. Rosier, and R. Howell. Algorithms and Complexity Concerning the Preemptive Scheduling of Periodic Real-Time Tasks on One Processor. The Journal of Real-Time Systems, vol. 2, 1990b.Google Scholar
  5. 5.
    Burchard, A., J. Liebeherr, Y. Oh, and S. Son. New Strategies for Assigning Real-Time Tasks to Multiprocessor Systems. IEEE Transactions on Computers, 1995.Google Scholar
  6. 6.
    Craig, T. S. Queuing Spin Lock Algorithms to Support Timing Predictability. In Proceedings of the IEEE Real-Time Systems Symposium, 1993.Google Scholar
  7. 7.
    Davis, R., N. Merriam, and N. Tracey. How Embedded Applications Using an RTOS Can Stay Within On-Chip Memory Limits. In Proceedings of the Work in Progress and Industrial Experience Session, Euromicro Conference on Real-Time Systems, 2000.Google Scholar
  8. 8.
    Dertouzos, M. L. and A. K.-L. Mok. Multiprocessor On-Line Scheduling of Hard-Real-Time Tasks. IEEE Transactions on Software Engineering, vol. 15, no.12, 1989.Google Scholar
  9. 9.
    Express Logic, I., available on Internet.Google Scholar
  10. 10.
    Ferrari, A., S. Garue, M. Peri, S. Pezzini, L. Valsecchi, F. Andretta, and W. Nesci. The Design and Implementation of a Dual-Core Platform for Power-Train Systems. In Convergence 2000, Detroit, MI, USA, 2000.Google Scholar
  11. 11.
    Gai, P., G. Lipari, L. Abeni, M. di Natale, and E. Bini. Architecture for a Portable Open Source Real-Time Kernel Environment. In Proceedings of the Second Real-Time Linux Workshop and Hand's on Real-Time Linux Tutorial, 2000.Google Scholar
  12. 12.
    Gai, P., G. Lipari, and M. di Natale. An Algorithm for Stack Size Minimization in Embedded SoC, RETIS TR2001–04. Technical Report, ReTiS Lab, Scuola Superiore S. Anna, 2001.Google Scholar
  13. 13.
    Graham, R. Bounds on the Performance of Scheduling Algorithms.Chap. 5, E.G. Coffman Jr. (ed.) Computer and JobShop Scheduling Theory, Wiley, New York, 1976.Google Scholar
  14. 14.
    Jeffay, K., D. F. Stanat, C. U. Martel. On Non-Preemptive Scheduling of Periodic and Sporadic Tasks. In Proceedings of the IEEE Real-Time Systems Symposium, 1991, pp.129–139.Google Scholar
  15. 15.
    Khemka, A. and R. K. Shyamasunda.Multiprocessor Scheduling of Periodic Tasks in a Hard Real-Time Environment. Technical report, Tata Institute of Fundamental Research, 1990.Google Scholar
  16. 16.
    Leung, J.Y.T. and J. Whitehead. On the Complexity of Fixed-Priority Scheduling of Periodic, Real-Time Tasks. Performance Evaluation, vol. 2, pp. 237–250, 1982.Google Scholar
  17. 17.
    Lipari, G. and G. Buttazzo. Schedulability Analysis of Periodic and Aperiodic Tasks with Resource Constraints. Journal of Systems Architecture, vol. 46, pp. 327–338, 2000.Google Scholar
  18. 18.
    Liu, C. and J. Layland. Scheduling Algorithms for Multiprogramming in a Hard-Real-Time Environment. Journal of the Association for Computing Machinery, vol. 20, no.1, 1973.Google Scholar
  19. 19.
    Natale, M. D. and J. Stankovic. Scheduling Distributed Real-Time Tasks with Minimum Jitter. Transactions on Computer, vol. 49, no.4, 2000.Google Scholar
  20. 20.
    Oh, Y. and S. H. Son. Allocating Fixed-Priority Periodic Tasks on Multiprocessor Systems. Journal on Real Time Systems, vol.9, 1995.Google Scholar
  21. 21.
    Rajkumar, R. Synchronization in Multiple Processor Systems. In Synchronization in Real-Time Systems: A Priority Inheritance Approach, Kluwer Academic Publishers, 1991.Google Scholar
  22. 22.
    Saksena, M. and Y. Wang. Scalable Real-Time System Design using Preemption Thresholds. In Proceedings of the Real Time Systems Symposium, 2000.Google Scholar
  23. 23.
    Sha, L., R. Rajkumar, and J. P. Lehoczky. Priority Inheritance Protocols: An Approach to Real-Time Synchronization. IEEE Transactions on Computers, vol. 39, no.9, 1990.Google Scholar
  24. 24.
    Tindell, K., A. Burns, and A. Wellings. Allocating Real-Time Tasks (an NP-Hard Problem Made Easy). Real-Time Systems Journal, 1992.Google Scholar
  25. 25.
    Wang, Y. and M. Saksena. Fixed Priority Scheduling with Preemption Threshold. In Proceedings of the IEEE International Conference on Real-Time Computing Systems and Applications, 1999.Google Scholar

Copyright information

© Kluwer Academic Publishers 2002

Authors and Affiliations

  • Paolo Gai
    • 1
  • Giuseppe Lipari
    • 1
  • Marco Di Natale
    • 1
  1. 1.ReTiS LabScuola Superiore di Studi e Perfezionamento S. AnnaPisa

Personalised recommendations