skip to main content
research-article
Open Access

Scratchpad allocation for concurrent embedded software

Published:22 April 2010Publication History
Skip Abstract Section

Abstract

Software-controlled scratchpad memory is increasingly employed in embedded systems as it offers better timing predictability compared to caches. Previous scratchpad allocation algorithms typically consider single-process applications. But embedded applications are mostly multitasking with real-time constraints, where the scratchpad memory space has to be shared among interacting processes that may preempt each other. In this work, we develop a novel dynamic scratchpad allocation technique that takes these process interferences into account to improve the performance and predictability of the memory system. We model the application as a Message Sequence Chart (MSC) to best capture the interprocess interactions. Our goal is to optimize the Worst-Case Response Time (WCRT) of the application through runtime reloading of the scratchpad memory content at appropriate execution points. We propose an iterative allocation algorithm that consists of two critical steps: (1) analyze the MSC along with the existing allocation to determine potential interference patterns, and (2) exploit this interference information to tune the scratchpad reloading points and content so as to best improve the WCRT. We present various alternative scratchpad allocation heuristics and evaluate their effectiveness in reducing the WCRT. The scheme is also extended to work on Message Sequence Graph models. We evaluate our memory allocation scheme on two real-world embedded applications controlling an Unmanned Aerial Vehicle (UAV) and an in-orbit monitoring instrument, respectively.

References

  1. Alur, R. and Yannakakis, M. 1999. Model checking message sequence charts. In Proceedings of the 10th International Conference on Concurrency Theory (CONCUR), J. C. Baeten and S. Mauw, Eds. Springer. 114--129. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Angiolini, F., Menichelli, F., Ferrero, A., Benini, L., and Olivieri, M. 2004. A post-compiler approach to scratchpad mapping of code. In Proceedings of the International Conference on Compilers, Architecture, and Synthesis for Embedded Systems (CASES). ACM, New York, 259--267. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Austin, T., Larson, E., and Ernst, D. 2002. SimpleScalar: An infrastructure for computer system modeling. IEEE Comput. 35, 2, 59--67. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Avissar, O., Barua, R., and Stewart, D. 2002. An optimal memory allocation scheme for scratch-pad-based embedded systems. ACM Trans. Embed. Comput. Syst. 1, 1, 6--26. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Banakar, R., Steinke, S., Lee, B.-S., Balakrishnan, M., and Marwedel, P. 2002. Scratchpad memory: Design alternative for cache on-chip memory in embedded systems. In Proceedings of the 10th International Symposium on Hardware/Software Codesign (CODES). ACM, New York, 73--78. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. CPLEX. 2002. The ILOG CPLEX Optimizer v7.5. Commercial software, http://www.ilog.com.Google ScholarGoogle Scholar
  7. Deverge, J.-F. and Puaut, I. 2007. WCET-Directed dynamic scratchpad memory allocation of data. In Proceedings of the 19th Euromicro Conference on Real-Time Systems (ECRTS). IEEE Computer Society, 179--190. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Dominguez, A., Udayakumaran, S., and Barua, R. 2005. Heap data allocation to scratch-pad memory in embedded systems. J. Embed. Comput. 1, 4, 521--540. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Egger, B., Kim, C., Jang, C., Nam, Y., Lee, J., and Min, S. L. 2006. A dynamic code placement technique for scratchpad memory using postpass optimization. In Proceedings of the International Conference on Compilers, Architecture and Synthesis for Embedded Systems (CASES). ACM, New York, 223--233. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Egger, B., Lee, J., and Shin, H. 2008. Dynamic scratchpad memory management for code in portable systems with an MMU. ACM Trans. Embed. Comput. Syst. 7, 2, 1--38. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. European Space Agency. 2008. DEBIE -- First standard space debris monitoring instrument. http://gate.etamax.de/edid/publicaccess/debie1.php.Google ScholarGoogle Scholar
  12. Falk, H. and Verma, M. 2004. Combined data partitioning and loop nest splitting for energy consumption minimization. In Proceedings of the 8th International Workshop on Software and Compilers for Embedded Systems (SCOPES), H. Schepers, Ed. Springer. 137--151.Google ScholarGoogle Scholar
  13. Harel, D. and Thiagarajan, P. S. 2003. Message sequence charts. In UML for Real: Design of Embedded Real-time Systems. 77--105. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Issenin, I., Brockmeyer, E., Durinck, B., and Dutt, N. 2006. Multiprocessor system-on-chip data reuse analysis for exploring customized memory hierarchies. In Proceedings of the 43rd Design Automation Conference (DAC). ACM, New York, 49--52. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. ITU-T. 1996. Recommendation Z.120: Message Sequence Chart (MSC). ITU-T, Geneva.Google ScholarGoogle Scholar
  16. Janapsatya, A., Ignjatovic, A., and Parameswaran, S. 2006. A novel instruction scratchpad memory optimization method based on concomitance metric. In Proceedings of the Conference on Asia South Pacific Design Automation (ASP-DAC). IEEE Press, 612--617. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Kandemir, M. 2007. Data locality enhancement for CMPs. In Proceedings of the International Conference on Computer-Aided Design (ICCAD). IEEE Press, 155--159. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Kandemir, M., Kadayif, I., and Sezer, U. 2001. Exploiting scratch-pad memory using presburger formulas. In Proceedings of the 14th International Symposium on Systems Synthesis (ISSS). ACM, New York, 7--12. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Kandemir, M., Ozturk, O., and Karakoy, M. 2004a. Dynamic on-chip memory management for chip multiprocessors. In Proceedings of the International Conference on Compilers, Architecture, and Synthesis for Embedded Systems (CASES). ACM, New York, 14--23. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Kandemir, M., Ramanujam, J., and Choudhary, A. 2002. Exploiting shared scratch pad memory space in embedded multiprocessor systems. In Proceedings of the 39th Design Automation Conference (DAC). ACM, New York, 219--224. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Kandemir, M., Ramanujam, J., Irwin, M. J., Vijaykrishnan, N., Kadayif, I., and Parikh, A. 2004b. A compiler based approach for dynamically managing scratch-pad memories in embedded systems. IEEE Trans. Comput.-Aided Des. Integr. Circ. Syst. 23, 2, 243--260. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Lee, C.-G., Hahn, J., Seo, Y.-M., Min, S. L., Ha, R., Hong, S., Park, C. Y., Lee, M., and Kim, C. S. 1998. Analysis of cache-related preemption delay in fixed-priority preemptive scheduling. IEEE Trans. Comput. 47, 6, 700--713. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Li, X., Liang, Y., Mitra, T., and Roychoudhury, A. 2007. Chronos: A timing analyzer for embedded software. Sci. Comput. Program. 69, 1-3, 56--67. http://www.comp.nus.edu.sg/~rpembed/chronos/. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Marwedel, P., Wehmeyer, L., Verma, M., Steinke, S., and Helmig, U. 2004. Fast, predictable and low energy memory references through architecture-aware compilation. In Proceedings of the Conference on Asia South Pacific Design Automation (ASP-DAC). IEEE Press, 4--11. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Mitra, T. and Roychoudhury, A. 2007. Worst case execution time and energy analysis. In The Compiler Design Handbook: Optimizations and Machine Code Generation 2nd Ed., Y. Srikant and P. Shankar, Eds. CRC Press, Boca Raton, FL, Chapter 1.Google ScholarGoogle Scholar
  26. Negi, H. S., Mitra, T., and Roychoudhury, A. 2003. Accurate estimation of cache-related preemption delay. In Proceedings of the 1st IEEE/ACM/IFIP International Conference on Hardware/Software Codesign and System Synthesis (CODES+ISSS). ACM, New York, 201--206. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Nemer, F., Cassé, H., Sainrat, P., Bahsoun, J.-P., and Michiel, M. D. 2006. PapaBench: A free real-time benchmark. In Proceedings of the 6th International Workshop on Worst-Case Execution Time Analysis (WCET), F. Mueller Ed. Internationales Begegnungs- und Forschungszentrum fuer Informatik (IBFI), Schloss Dagstuhl, Germany. http://www.irit.fr/recherches/ARCHI/MARCH/rubrique.php3?id\_rubrique=97.Google ScholarGoogle Scholar
  28. Nguyen, N., Dominguez, A., and Barua, R. 2005. Memory allocation for embedded systems with a compile-time-unknown scratch-pad size. In Proceedings of the International Conference on Compilers, Architectures and Synthesis for Embedded Systems (CASES). ACM, New York, 115--125. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Ozturk, O., Kandemir, M., and Kolcu, I. 2006. Shared scratch-pad memory space management. In Proceedings of the 7th International Symposium on Quality Electronic Design (ISQED). IEEE Computer Society, 576--584. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Panda, P. R., Dutt, N. D., and Nicolau, A. 2000. On-Chip vs. off-chip memory: The data partitioning problem in embedded processor-based systems. ACM Trans. Des. Autom. Electron. Syst. 5, 3, 682--704. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Puaut, I. 2006. WCET-Centric software-controlled instruction caches for hard real-time systems. In Proceedings of the 18th Euromicro Conference on Real-Time Systems (ECRTS). IEEE Computer Society, 217--226. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Ravindran, R. A., Nagarkar, P. D., Dasika, G. S., Marsman, E. D., Senger, R. M., Mahlke, S. A., and Brown, R. B. 2005. Compiler managed dynamic instruction placement in a low-power code cache. In Proceedings of the International Symposium on Code Generation and Optimization (CGO). IEEE Computer Society, 179--190. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Staschulat, J. and Ernst, R. 2004. Multiple process execution in cache related preemption delay analysis. In Proceedings of the 4th ACM International Conference on Embedded Software (EMSOFT). ACM, New York, 278--286. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Steinke, S., Grunwald, N., Wehmeyer, L., Banakar, R., Balakrishnan, M., and Marwedel, P. 2002a. Reducing energy consumption by dynamic copying of instructions onto onchip memory. In Proceedings of the 15th International Symposium on System Synthesis (ISSS). ACM, New York, 213--218. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Steinke, S., Wehmeyer, L., Lee, B. S., and Marwedel, P. 2002b. Assigning program and data objects to scratchpad for energy reduction. In Proceedings of the Design, Automation and Test in Europe (DATE) Conference. IEEE Computer Society, 409. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Suhendra, V., Mitra, T., and Roychoudhury, A. 2006a. Efficient detection and exploitation of infeasible paths for software timing analysis. In Proceedings of the 43rd Design Automation Conference (DAC). ACM, New York, 358--363. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Suhendra, V., Mitra, T., Roychoudhury, A., and Chen, T. 2005. WCET centric data allocation to scratchpad memory. In Proceedings of the 26th IEEE International Real-Time Systems Symposium (RTSS). IEEE Computer Society, 223--232. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Suhendra, V., Raghavan, C., and Mitra, T. 2006b. Integrated scratchpad memory optimization and task scheduling for MPSoC architectures. In Proceedings of the International Conference on Compilers, Architecture, and Synthesis for Embedded Systems (CASES). ACM, New York, 37--42. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Tomiyama, H. and Dutt, N. D. 2000. Program path analysis to bound cache-related preemption delay in preemptive real-time systems. In Proceedings of the 8th International Workshop on Hardware/Software Codesign (CODES). ACM, New York, 67--71. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Udayakumaran, S. and Barua, R. 2003. Compiler-Decided dynamic memory allocation for scratch-pad based embedded systems. In Proceedings of the International Conference on Compilers, Architecture, and Synthesis for Embedded Systems (CASES). ACM, New York, 276--286. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Verma, M., Petzold, K., Wehmeyer, L., Falk, H., and Marwedel, P. 2005. Scratchpad sharing strategies for multiprocess embedded systems: A first approach. In Proceedings of the 3rd Workshop on Embedded Systems for Real-Time Multimedia (ESTIMedia). M. Miranda and S. Ha, Eds. IEEE Computer Society, 115--120.Google ScholarGoogle Scholar
  42. Verma, M., Wehmeyer, L., and Marwedel, P. 2004a. Cache-Aware scratchpad allocation algorithm. In Proceedings of the Design, Automation and Test in Europe (DATE) Conference. IEEE Computer Society, 21264. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Verma, M., Wehmeyer, L., and Marwedel, P. 2004b. Dynamic overlay of scratchpad memory for energy minimization. In Proceedings of the IEEE/ACM/IFIP International Conference on Hardware/Software Codesign and System Synthesis (CODES+ISSS). ACM, New York, 104--109. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Wehmeyer, L., Helmig, U., and Marwedel, P. 2004. Compiler-Optimized usage of partitioned memories. In Proceedings of the 3rd Workshop on Memory Performance Issues (WMPI). ACM, New York, 114--120. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Welsh, D. J. A. and Powell, M. B. 1967. An upper bound for the chromatic number of a graph and its application to timetabling problems. The Comput. J. 10, 1, 85--87.Google ScholarGoogle ScholarCross RefCross Ref
  46. Yen, T.-Y. and Wolf, W. 1998. Performance estimation for real-time distributed embedded systems. IEEE Trans. Parallel Distrib. Syst. 9, 11, 1125--1136. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Scratchpad allocation for concurrent embedded software

Recommendations

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in

Full Access

  • Published in

    cover image ACM Transactions on Programming Languages and Systems
    ACM Transactions on Programming Languages and Systems  Volume 32, Issue 4
    April 2010
    230 pages
    ISSN:0164-0925
    EISSN:1558-4593
    DOI:10.1145/1734206
    Issue’s Table of Contents

    Copyright © 2010 ACM

    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 22 April 2010
    • Revised: 1 September 2009
    • Accepted: 1 September 2009
    • Received: 1 March 2009
    Published in toplas Volume 32, Issue 4

    Permissions

    Request permissions about this article.

    Request Permissions

    Check for updates

    Qualifiers

    • research-article
    • Research
    • Refereed

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader