Skip to main content
Log in

Instruction Cache Locking for Embedded Systems using Probability Profile

  • Published:
Journal of Signal Processing Systems Aims and scope Submit manuscript

Abstract

Cache is effective in bridging the gap between processor and memory speed. It is also a source of unpredictability because of its dynamic and adaptive behavior. A lot of modern processors provide cache locking capability which locks instructions or data of a program into cache so that a more precise estimation of execution time can be obtained. The selection of instructions or data to be locked in cache has a dramatic influence on the system performance. For real-time systems, cache locking is mostly utilized to improve the Worst-Case Execution Time (WCET). However, Average-Case Execution Time (ACET) is also an important criterion for some embedded systems, especially for soft real-time embedded systems, such as image processing systems. This paper aims to utilize instruction cache (I-Cache) locking technique to guarantee a minimized estimable ACET for embedded systems by exploring the probability profile information. A Probability Execution Flow Tree (PEFT) is introduced to model an embedded application with runtime profile information. The static I-Cache locking problem is proved to be NP-Hard and two kinds of locking, fully locking and partially locking, are proposed to find the instructions to be locked. Dynamic I-Cache locking can further improve the ACET. For dynamic I-Cache locking, an algorithm that leverages the application’s branching information is proposed. All the algorithms are executed during the compilation time and the results are applied during the runtime. Experimental results show that the proposed algorithms reduce the ACET of embedded applications further compared to state-of-the-art techniques.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Figure 1
Figure 2
Figure 3
Figure 4

Similar content being viewed by others

References

  1. Sarkar, V. (1989). Determining average program execution times and their variance. In ACM SIGPLAN 1989 Conference on Programming language design and implementation, (pp. 298–312).

  2. Guo, X., Boubekeur, M., McEnery, J., & Hickey, D. (2007). ACET based scheduling of soft real-time systems: An approach to optimise resource budgeting. In International Journal of Computers and Communications, (Issue 3, Vol. 1, pp. 82–89).

  3. ARM. http://www.arm.com/.

  4. MIPS. http://www.mips.com/.

  5. Moto. http://www.motorola.com/.

  6. Anand, K., & Barua, R. (2009). Instruction cache locking inside a binary rewriter. In Proceedings of the International Conference on Compilers Architectures and Synthesis for Embedded Systems (CASES09), (pp. 185–194).

  7. Liang, Y., & Mitra, T. (2010). Instruction cache locking using temporal reuse profile. In Proceedings of the 47th Design Automation Conference (DAC10), (pp. 244–340).

  8. Buck, B., & Hollingsworth, J. K. (2000). An API for runtime code patching. In International Journal of High Performance Computing Applications, 14(4), 317–329.

  9. Puaut, I., & Decotigny, D. (2002). Low-complexity algorithms for static cache locking in multitasking hard real-time systems. In Proceedings of the 23rd IEEE Real-Time Systems Symposium (RTSS02), (pp. 114–123).

  10. Arnaud, A., & Puaut, I. (2006). Dynamic instruction cache locking in hard real-time systems. In Proceedings of the 14th International Conference on Real-Time and Network Systems (RTNS06).

  11. Campoy, A. M., Ivars, A. P., Rodriguez, F., & Busquets Mataix, J. V. (2003). Static use of locking caches vs dynamic use of locking caches for real-time systems. In IEEE Canadian Conference on Electrical and Computer Engineering, (pp. 1283–1286).

  12. Campoy, A. M., Ivars, A. P., & Busquets Mataix, J. V. (2002). Dynamic use of locking caches in multitask, preemptive real-time systems. In 15th Triennial World Congress.

  13. Falk, H., Plazar, S., & Theiling, H. (2007). Compile-time decided instruction cache locking using worst-case execution paths. In Proceedings of the 5th IEEE/ACM international conference on Hardware/software codesign and system synthesis (CODE+ISSS07), (pp. 143–148).

  14. Liu, T., Li, M., & Xue, C. J. (2009). Minimizing WCET for Real-time Embedded Systems via Static Instruction Cache Locking. In Proceedings of the 15th IEEE Real-Time and Embedded Technology and Applications Symposium (RTAS09), (pp. 35–44).

  15. Kandemir, M., Ramanujam, J., Irwin, M. J., Vijaykrishnan, N., Kadayil, I., & Parikh, A. (2001). Dynamic management of scratchpad memory space. In Proceedings of the 38th Design Automation Conference (DAC01), (pp. 690–695).

  16. Udayakumaran,S., & Barua, R. (2003). Compiler-decided dynamic memory allocation for scratch-pad based embedded systems. In Proceedings of the International Conference on Compilers, Architectures and Synthesis for Embedded Systems, (pp. 276–286).

  17. Puaut, I., & Pais, C. (2007). Scratchpad memories vs locked caches in hard real-time systems: a quantitative comparison. In Proceedings of the conference on Design, Automation and Test in Europe (DATE07), (pp. 1484–1489).

  18. Liang, Y., & Mitra, T. (2008). Cache modeling in probabilistic execution time analysis. In Proceedings of the 45th Design Automation Conference (DAC08), (pp. 319–324).

  19. Petrov, P., & Orailoglu, A. (2005). A reprogrammable customization framework for efficient branch resolution embedded processors. ACM Transactions on Embedded Computing Systems, 4(2), 452–468.

    Article  Google Scholar 

  20. Xue, C. J., Sha, E. H. -M., Shao, Z., & Qiu, M. (2008). Effective loop partitioning and scheduling under memory and register dual constraints. In Proceedings of the 40th Design, Automation and Test in Europe (DATE08) (pp. 1202–1207).

  21. Qiu, M., Xue, C., Shao, Z., & Sha, E. H. -M. (2007). Energy minimization with soft real-time and DVS for uniprocessor and multiprocessor embedded systems. In Proceedings of the 39th Design, Automation and Test in Europe (DATE07) (pp. 1641–1646).

  22. Shao, Z., Xiao, B., Xue, C., Zhuge, Q., Sha, E. H. -M. (2006). Loop scheduling with timing and switching-activity minimization for VLIW DSP. ACM Transactions on Design Automation of Electronic Systems, 11(1), 165–185.

    Article  Google Scholar 

  23. Intel. http://www.intel.com/design/intelxscale.

  24. IDT. http://www.idt.com/.

  25. Gordon-Ross, A., Vahid, F., & Dutt, N. (2005). A first look at the interplay of code reordering and configurable caches. In Proceedings of the 15th ACM Great Lakes symposium on VLSI, (pp. 416–421).

  26. Guillon, C., Rastello, F., Bidault, T., & Bouchez, F. (2004). Procedure placement using temporal-ordering information: dealing with code size expansion. Journal of Embedded Computing, 1(4), 437–459.

    Google Scholar 

  27. Zhao, W., Whalley, D., Healy, C., & Mueller, F. (2005). Improving WCET by Applying a WC Code-Positioning Optimization. ACM Transactions on Architecture and Code Optimization, 2(4), 335–365.

    Article  Google Scholar 

  28. StreamIt. http://www.cag.lcs.mit.edu/streamit/shtml/benchmarks.shtml.

  29. SimpleScalar. http://www.simplescalar.com/.

  30. Chakraborty, S., Mitra, T., Roychoudhury, A., & Thiele, L. (2009). Cache-aware timing analysis of streaming applications. Real-Time Syst, 41, 52–85.

    Article  MATH  Google Scholar 

  31. Martello, S., & Toth, P. (1990). Knapsack Problems: Algorithms and Computer Implementation. John Wiley and Sons.

  32. MRTC. http://www.mrtc.mdh.se/projects/wcet/home.html.

  33. MiBench. http://www.eecs.umich.edu/mibench/.

  34. Mueller, F. (2000). Timing analysis for instruction caches. Real-Time Systems, 18(2), 217–247.

    Article  Google Scholar 

Download references

Acknowledgement

This work is supported by grants from City University of Hong Kong [Project No. 7008042, 7002694].

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Tiantian Liu.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Liu, T., Li, M. & Xue, C.J. Instruction Cache Locking for Embedded Systems using Probability Profile. J Sign Process Syst 69, 173–188 (2012). https://doi.org/10.1007/s11265-011-0650-6

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11265-011-0650-6

Keywords

Navigation