A Dynamic Instruction Cache Locking Approach for Minimizing Worst Case Execution Time of a Single Task

In real time embedded system, the embedded software often consists of a set of concurrent tasks, and such tasks are generally subject to timing constraints. In order to satisfy all the timing constraints, precisely predicting the WCET of a task is essential for the task scheduler to construct a feasible schedule for a task set. Caches have been widely used to bridge the gap between high speed processors and relatively slower off-chip memory. However, caches make it extremely harder to predict precise WCET (Worst Case Execution Time) of a task for the simple reason that it is difficult to predict if each cache access is a cache hit or miss. Cache locking is a mechanism which disables the replacement policy of caches and locks some contents (instruction or data) in the caches, such that the accesses to those contents become fully predictable and the WCET of a task is easier to predict. Furthermore, cache locking is also an effective technique to reduce the WCET of a task by locking appropriate contents in the caches. In this paper, we investigate the WCET-aware I-cache (Instruction cache) locking problem and propose an ILP-based (Integer Linear Programming) dynamic I-cache locking approach for reducing the WCET of a task. Our approach not only select locking contents which have largest benefit for reducing WCET of a task, but also finds a good locking point for each locked instruction such that extra execution time spend on locking instructions is also minimized. We have implemented this approach and compared it with two state-of-the-art I-cache locking approaches, the longest path based dynamic cache locking approach proposed in and the min-cut based dynamic locking approach proposed in by using MRTC benchmark suite. The experimental results show that our approach performs better for each benchmark. Compared to the longest path based dynamic approach, our approach achieves the average improvements of 5.8%, 13.8%, 16.1% and 12.6% for the 256B, 512B, 1KB and 2KB caches, respectively. Compared to the min-cut based dynamic approach, our approach achieves the average improvements of 2.2%, 7.6%, 8.2% and 6.4% for the 256B, 512B, 1KB and 2KB caches, respectively.

[1]  Björn Lisper,et al.  Data cache locking for higher program predictability , 2003, SIGMETRICS '03.

[2]  Hui Wu,et al.  WCET: aware dynamic instruction cache locking , 2014, LCTES '14.

[3]  Yun Liang,et al.  Instruction cache locking using temporal reuse profile , 2010, Design Automation Conference.

[4]  Hui Wu,et al.  WCET-aware data selection and allocation for scratchpad memory , 2012, LCTES '12.

[5]  F. Rodriguez,et al.  Static use of locking caches vs. dynamic use of locking caches for real-time systems , 2003, CCECE 2003 - Canadian Conference on Electrical and Computer Engineering. Toward a Caring and Humane Technology (Cat. No.03CH37436).

[6]  Ann Gordon-Ross,et al.  PhLock: A Cache Energy Saving Technique Using Phase-Based Cache Locking , 2018, IEEE Transactions on Very Large Scale Integration (VLSI) Systems.

[7]  Jing Wang,et al.  Data re-allocation enabled cache locking for embedded systems , 2017, J. Syst. Archit..

[8]  José V. Busquets-Mataix,et al.  Cache contents selection for statically-locked instruction caches: an algorithm comparison , 2005, 17th Euromicro Conference on Real-Time Systems (ECRTS'05).

[9]  Minming Li,et al.  Instruction Cache Locking for Embedded Systems using Probability Profile , 2012, J. Signal Process. Syst..

[10]  Hui Wu,et al.  WCET-Aware Dynamic I-Cache Locking for a Single Task , 2017, ACM Trans. Archit. Code Optim..

[11]  Rajeev Barua,et al.  Instruction cache locking inside a binary rewriter , 2009, CASES '09.

[12]  Gabriela Nicolescu,et al.  Cache Locking Content Selection Algorithms for ARINC-653 Compliant RTOS , 2019, ACM Trans. Embed. Comput. Syst..

[13]  Yun Liang,et al.  WCET-Centric dynamic instruction cache locking , 2014, 2014 Design, Automation & Test in Europe Conference & Exhibition (DATE).

[14]  Isabelle Puaut,et al.  Low-complexity algorithms for static cache locking in multitasking hard real-time systems , 2002, 23rd IEEE Real-Time Systems Symposium, 2002. RTSS 2002..

[15]  Xianfeng Li,et al.  Chronos: A timing analyzer for embedded software , 2007, Sci. Comput. Program..

[16]  Abu Asaduzzaman,et al.  Improving cache locking performance of modern embedded systems via the addition of a miss table at the L2 cache level , 2010, J. Syst. Archit..

[18]  Isabelle Puaut,et al.  WCET-centric software-controlled instruction caches for hard real-time systems , 2006, 18th Euromicro Conference on Real-Time Systems (ECRTS'06).

[19]  Hui Wu,et al.  Dynamic Data-Cache Locking for Minimizing the WCET of a Single Task , 2017, ACM Trans. Embed. Comput. Syst..

[20]  Brani Vidakovic,et al.  USING GENETIC ALGORITHMS IN CONTENT SELECTION FOR LOCKING-CACHES , 2001 .

[21]  Rajeev Barua,et al.  Instruction-Cache Locking for Improving Embedded Systems Performance , 2015, ACM Trans. Embed. Comput. Syst..

[22]  Naijie Gu,et al.  Cache locking optimization in java virtual machine , 2013, IEEE Conference Anthology.

[23]  Chun Jason Xue,et al.  Branch Prediction directed Dynamic instruction Cache Locking for embedded systems , 2013, 2013 IEEE 19th International Conference on Embedded and Real-Time Computing Systems and Applications.

[24]  Yun Liang,et al.  WCET-centric partial instruction cache locking , 2012, DAC Design Automation Conference 2012.

[25]  Ann Gordon-Ross,et al.  Phase-based Cache Locking for Embedded Systems , 2015, ACM Great Lakes Symposium on VLSI.

[26]  Michael Opoku Agyeman,et al.  A Study of Cache Management Mechanisms for Real-Time Embedded Systems , 2018, Proceedings of the 2nd International Symposium on Computer Science and Intelligent Control.

[27]  Henrik Theiling,et al.  Compile-time decided instruction cache locking using worst-case execution paths , 2007, 2007 5th IEEE/ACM/IFIP International Conference on Hardware/Software Codesign and System Synthesis (CODES+ISSS).