Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article

WCET-Aware Function-Level Dynamic Code Management on Scratchpad Memory

Published: 11 May 2017 Publication History

Abstract

Scratchpad memory (SPM) is a promising on-chip memory choice in real-time and cyber-physical systems where timing is of the utmost importance. SPM has time-predictable characteristics since its data movement between the SPM and the main memory is entirely managed by software. One way of such management is dynamic management. In dynamic management of instruction SPMs, code blocks are dynamically copied from the main memory to the SPM at runtime by executing direct memory access (DMA) instructions. Code management techniques try to minimize the overhead of DMA operations by finding an allocation scheme that leads to efficient utilization. In this article, we present three function-level code management techniques. These techniques perform allocation at the granularity of functions, with the objective of minimizing the impact of DMA overhead to the worst-case execution time (WCET) of a given program. The first technique finds an optimal mapping of each function to a region using integer linear programming (ILP), whereas the second technique is a polynomial-time heuristic that is suboptimal. The third technique maps functions directly to SPM addresses, not using regions, which can further reduce the WCET. Based on ILP, it can also find an optimal mapping. We evaluate our techniques using the Mälardalen WCET suite, MiBench suite, and proprietary automotive applications from industry. The results show that our techniques can significantly reduce the WCET estimates compared to caches with the state-of-the-art cache analysis.

References

[1]
Oren Avissar, Rajeev Barua, and Dave Stewart. 2002. An optimal memory allocation scheme for scratch-pad-based embedded systems. ACM Trans. Embed. Comput. Syst. 1, 1 (Nov. 2002), 6--26.
[2]
Philip Axer, Rolf Ernst, Heiko Falk, Alain Girault, Daniel Grund, Nan Guan, Bengt Jonsson, Peter Marwedel, Jan Reineke, Christine Rochange, Maurice Sebastian, Reinhard Von Hanxleden, Reinhard Wilhelm, and Wang Yi. 2014. Building timing predictable embedded systems. ACM Trans. Embed. Comput. Syst. 13, 4, Article 82 (March 2014), 37 pages.
[3]
Ke Bai, Jing Lu, Aviral Shrivastava, and Bryce Holton. 2013. CMSM: An efficient and effective code management for software managed multicores. In Proc. of International Conference on Hardware/Software Codesign and System Synthesis (CODES+ISSS). 1--9.
[4]
Michael A. Baker, Amrit Panda, Nikhil Ghadge, Aniruddha Kadne, and Karam S. Chatha. 2010. A performance model and code overlay generator for scratchpad enhanced embedded processors. In Proc. of International Conference on Hardware/Software Codesign and System Synthesis (CODES+ISSS). 287--296.
[5]
Rajeshwari Banakar, Stefan Steinke, Bo-Sik Lee, M. Balakrishnan, and Peter Marwedel. 2002. Scratchpad memory: Design alternative for cache on-chip memory in embedded systems. In Proc. of International Symposium on Hardware/Software Codesign (CODES). 73--78.
[6]
Nathan Binkert, Bradford Beckmann, Gabriel Black, Steven K. Reinhardt, Ali Saidi, Arkaprava Basu, Joel Hestness, Derek R. Hower, Tushar Krishna, Somayeh Sardashti, Rathijit Sen, Korey Sewell, Muhammad Shoaib, Nilay Vaish, Mark D. Hill, and David A. Wood. 2011. The gem5 simulator. SIGARCH Comput. Archit. News 39, 2 (Aug. 2011), 1--7.
[7]
Stephen P. Bradley, Arnoldo C. Hax, and Thomas L. Magnanti. 1977. Applied Mathematical Programming. Addison-Wesley Publishing Company.
[8]
Giorgio C. Buttazzo. 2011. Hard Real-Time Computing Systems: Predictable Scheduling Algorithms and Applications (3rd ed.). Springer Publishing Company.
[9]
Christoph Cullmann. 2013. Cache persistence analysis: Theory and practice. ACM Trans. Embed. Comput. Syst. 12, 1s, Article 40 (March 2013), 25 pages.
[10]
Jean-Francois Deverge and Isabelle Puaut. 2007. WCET-directed dynamic scratchpad memory allocation of data. In Proc. of Euromicro Conference on Real-Time Systems (ECRTS). 179--190.
[11]
Huping Ding, Yun Liang, and T. Mitra. 2014. WCET-centric dynamic instruction cache locking. In Proc. of Design, Automation 8 Test in Europe (DATE). 1--6.
[12]
Bernhard Egger, Chihun Kim, Choonki Jang, Yoonsung Nam, Jaejin Lee, and Sang Lyul Min. 2006. A dynamic code placement technique for scratchpad memory using postpass optimization. In Proc. of International Conference on Compilers, Architecture, and Synthesis for Embedded Systems (CASES). 223--233.
[13]
Heiko Falk and Jan C. Kleinsorge. 2009. Optimal static WCET-aware scratchpad allocation of program code. In Proc. of Design Automation Conference (DAC). 732--737.
[14]
Heiko Falk and Helena Kotthaus. 2011. WCET-driven cache-aware code positioning. In Proc. of International Conference on Compilers, Architecture, and Synthesis for Embedded Systems (CASES). 145--154.
[15]
Christian Ferdinand. 2004. Worst-case execution time prediction by static program analysis. In Proc. of International Parallel and Distributed Processing Symposium (IPDPS). 125--127.
[16]
Christian Ferdinand and Reinhard Wilhelm. 1999. Efficient and precise cache behavior prediction for real-time systems. Real-Time Syst. 17, 2 (Nov. 1999), 131--181.
[17]
Giovani Gracioli, Ahmed Alhammad, Renato Mancuso, Antônio Augusto Fröhlich, and Rodolfo Pellizzoni. 2015. A survey on cache management mechanisms for real-time embedded systems. ACM Comput. Surv. 48, 2, Article 32 (Nov. 2015), 36 pages.
[18]
Nan Guan, Mingsong Lv, Wang Yi, and Ge Yu. 2012. WCET analysis with MRU caches: Challenging LRU for predictability. In Proc. of Real-Time and Embedded Technology and Applications Symposium (RTAS). 55--64.
[19]
Jan Gustafsson, Adam Betts, Andreas Ermedahl, and Björn Lisper. 2010. The Mälardalen WCET benchmarks - Past, present and future. In Proc. of International Workshop on Worst-Case Execution time Analysis (WCET). 136--146.
[20]
Matthew R. Guthaus, Jeffrey S. Ringenberg, Dan Ernst, Todd M. Austin, Trevor Mudge, and Richard B. Brown. 2001. MiBench: A free, commercially representative embedded benchmark suite. In Proc. of International Workshop on Workload Characterization (WWC). 3--14.
[21]
Benedikt Huber, Stefan Hepp, and Martin Schoeberl. 2014. Scope-based method cache analysis. In Proc. of International Workshop on Worst-Case Execution time Analysis (WCET), Vol. 39. 73--82.
[22]
Andhi Janapsatya, Aleksandar Ignjatović, and Sri Parameswaran. 2006. A novel instruction scratchpad memory optimization method based on concomitance metric. In Proc. of Asia and South Pacific Design Automation Conference (ASPDAC). 612--617.
[23]
Seung Chul Jung, Aviral Shrivastava, and Ke Bai. 2010. Dynamic code mapping for limited local memory systems. In Proc. of International Conference on Application-specific Systems (ASAP). 13--20.
[24]
James A. Kahle, Michael N. Day, H. Peter Hofstee, Charles R. Johns, Theodore R. Maeurer, and David Shippy. 2005. Introduction to the cell multiprocessor. IBM J. Res. Dev. 49, 4/5 (July 2005), 589--604.
[25]
Mahmut Kandemir and Alok Choudhary. 2002. Compiler-directed scratch pad memory hierarchy design and management. In Proc. of Design Automation Conference (DAC). 628--633.
[26]
Uday Khedker, Amitabha Sanyal, and Bageshri Karkare. 2009. Data Flow Analysis: Theory and Practice. CRC Press.
[27]
Hokeun Kim, David Broman, Edward A. Lee, Michael Zimmer, Aviral Shrivastava, and Junkwang Oh. 2015. A predictable and command-level priority-based DRAM controller for mixed-criticality systems. In Proc. of Real-Time and Embedded Technology and Applications Symposium (RTAS). 317--326.
[28]
Youngbin Kim, Jian Cai, Yooseong Kim, Kyoungwoo Lee, and Aviral Shrivastava. 2016. Splitting functions in code management on scratchpad memories. In Proc. of International Conference on Computer-Aided Design (ICCAD). 1--8.
[29]
Edward A. Lee. 2008. Cyber physical systems: Design challenges. In Proc. of International Symposium on Real-Time Computing (ISORC). 363--369.
[30]
Fuyang Li, Mengying Zhao, and C. J. Xue. 2015. C3: Cooperative code positioning and cache locking for WCET minimization. In Proc. of International Conference on Embedded and Real-Time Computing Systems and Applications (RTCSA). 51--59.
[31]
Isaac Liu, Jan Reineke, David Broman, Michael Zimmer, and Edward A. Lee. 2012. A PRET microarchitecture implementation with repeatable timing and competitive performance. In Proc. of International Conference on Computer Design (ICCD). 87--93.
[32]
Tiantian Liu, Yingchao Zhao, Minming Li, and C. J. Xue. 2010. Task assignment with cache partitioning and locking for WCET minimization on MPSoC. In Proc. of International Conference on Parallel Processing (ICPP). 573--582.
[33]
Amit Pabalkar, Aviral Shrivastava, Arun Kannan, and Jongeun Lee. 2008. SDRM: Simultaneous determination of regions and function-to-region mapping for scratchpad memories. In Proc. of the IEEE Conference on High Performance Computing (HiPC). 569--582.
[34]
Sascha Plazar, Jan C. Kleinsorge, Peter Marwedel, and Heiko Falk. 2012. WCET-aware static locking of instruction caches. In Proc. of International Symposium on Code Generation and Optimization (CGO). 44--52.
[35]
Aayush Prakash and Hiren D. Patel. 2012. An instruction scratchpad memory allocation for the precision timed architecture. In Proc. of Design, Automation 8 Test in Europe (DATE). 659--664.
[36]
Isabelle Puaut and Christophe Pais. 2007. Scratchpad memories vs locked caches in hard real-time systems: A quantitative comparison. In Proc. of Design, Automation 8 Test in Europe (DATE). 1484--1489.
[37]
Stefan Steinke, Nils Grunwald, Lars Wehmeyer, Rajeshwari Banakar, M. Balakrishnan, and Peter Marwedel. 2002a. Reducing energy consumption by dynamic copying of instructions onto onchip memory. In Proc. of International Symposium on System Synthesis (ISSS). 213--218.
[38]
Stefan Steinke, Lars Wehmeyer, Bo-Sik Lee, and Peter Marwedel. 2002b. Assigning program and data objects to scratchpad for energy reduction. In Proc. of Design, Automation 8 Test in Europe (DATE). 409--415.
[39]
Vivy Suhendra and Tulika Mitra. 2008. Exploring locking 8 partitioning for predictable shared caches on multi-cores. In Proc. of Design Automation Conference (DAC). 300--303.
[40]
Vivy Suhendra, Tulika Mitra, Abhik Roychoudhury, and Ting Chen. 2005. WCET centric data allocation to scratchpad memory. In Proc. of Real-Time Systems Symposium (RTSS). 223--232.
[41]
Vivy Suhendra, Abhik Roychoudhury, and Tulika Mitra. 2010. Scratchpad allocation for concurrent embedded software. ACM Trans. Program. Lang. Syst. 32, 4, Article 13 (April 2010), 47 pages.
[42]
Sumesh Udayakumaran, Angel Dominguez, and Rajeev Barua. 2006. Dynamic allocation for scratch-pad memory using compile-time decisions. ACM Trans. Embed. Comput. Syst. 5, 2 (May 2006), 472--511.
[43]
Junhyung Um and Taewhan Kim. 2003. Code placement with selective cache activity minimization for embedded real-time software design. In Proc. of International Conference on Computer-Aided Design (ICCAD). 197--200.
[44]
Manish Verma, Lars Wehmeyer, and Peter Marwedel. 2004. Dynamic overlay of scratchpad memory for energy minimization. In Proc. of International Conference on Hardware/Software Codesign and System Synthesis (CODES+ISSS). 104--109.
[45]
Qing Wan, Hui Wu, and Jingling Xue. 2012. WCET-aware data selection and allocation for scratchpad memory. In Proc. of Languages, Compilers, and Tools for Embedded Systems (LCTES). 41--50.
[46]
Jack Whitham and Neil Audsley. 2009. Implementing time-predictable load and store operations. In Proc. of International Conference on Embedded Software (EMSOFT). 265--274.
[47]
Reinhard Wilhelm, Jakob Engblom, Andreas Ermedahl, Niklas Holsti, Stephan Thesing, David Whalley, Guillem Bernat, Christian Ferdinand, Reinhold Heckmann, Tulika Mitra, Frank Mueller, Isabelle Puaut, Peter Puschner, Jan Staschulat, and Per Stenström. 2008. The worst-case execution-time problem-overview of methods and survey of tools. ACM Trans. Embed. Comput. Syst. 7, 3, Article 36 (May 2008), 53 pages.
[48]
Hui Wu, Jingling Xue, and Sri Parameswaran. 2010. Optimal WCET-aware code selection for scratchpad memory. In Proc. of International Conference on Embedded Software (EMSOFT). 59--68.
[49]
Michael Zimmer, David Broman, Chris Shaver, and Edward A. Lee. 2014. FlexPRET: A processor platform for mixed-criticality systems. In Proc. of Real-Time and Embedded Technology and Applications Symposium (RTAS). 101--110.

Cited By

View all
  • (2019)SA-SPM: an efficient compiler for security aware scratchpad memory (invited paper)Proceedings of the 20th ACM SIGPLAN/SIGBED International Conference on Languages, Compilers, and Tools for Embedded Systems10.1145/3316482.3326347(57-69)Online publication date: 23-Jun-2019
  • (2018)TTEC: Data Allocation Optimization for Morphable Scratchpad Memory in Embedded SystemsIEEE Access10.1109/ACCESS.2018.28727626(54701-54712)Online publication date: 2018

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Embedded Computing Systems
ACM Transactions on Embedded Computing Systems  Volume 16, Issue 4
Special Issue on Secure and Fault-Tolerant Embedded Computing and Regular Papers
November 2017
614 pages
ISSN:1539-9087
EISSN:1558-3465
DOI:10.1145/3092956
Issue’s Table of Contents
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

Journal Family

Publication History

Published: 11 May 2017
Accepted: 01 February 2017
Revised: 01 February 2017
Received: 01 April 2016
Published in TECS Volume 16, Issue 4

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Scratchpad memory (SPM)
  2. code management
  3. hard real-time systems
  4. worst-case execution time (WCET)

Qualifiers

  • Research-article
  • Research
  • Refereed

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)8
  • Downloads (Last 6 weeks)0
Reflects downloads up to 25 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2019)SA-SPM: an efficient compiler for security aware scratchpad memory (invited paper)Proceedings of the 20th ACM SIGPLAN/SIGBED International Conference on Languages, Compilers, and Tools for Embedded Systems10.1145/3316482.3326347(57-69)Online publication date: 23-Jun-2019
  • (2018)TTEC: Data Allocation Optimization for Morphable Scratchpad Memory in Embedded SystemsIEEE Access10.1109/ACCESS.2018.28727626(54701-54712)Online publication date: 2018

View Options

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media