scieee AI-readable full text Open interactive document viewer

Locality-aware cache random replacement policies

Benedicte Illescas, Pedro,Hernández Luz, Carles,Abella Ferrer, Jaume,Cazorla Almeida, Francisco Javier

Abstract

Measurement-Based Probabilistic Timing Analysis (MBPTA) facilitates the analysis of complex software running on hardware comprising high-performance features. MBPTA also aims at preventing additional analysis costs for timing analysis techniques and preserving the confidence on derived WCET estimates. Cache behavior has a deep influence on WCET estimates and hence on “the amount of software” that can be consolidated onto a single hardware platform. Deterministic replacement policies such as LRU (Least Recently Used) and NMRU (Non-Most Recently Used) have systematic pathological cases that may lead to high execution times and WCET estimates. Instead, random replacement (RR) decreases pathological cases probability, at the cost of temporal locality. We present two new MBPTA-amenable replacement policies that completely remove the presented pathological cases. The first policy, Random Permutations (RP) preserves higher temporal locality than RR; while the second, NMRU Random Permutations (NMRURP), also protects the Most Recently Used line from eviction. Both proposed policies build upon restricted random replacement choices. Our simulation evaluation (validated against a real prototype) using the Mälardalen benchmarks and a case study shows that RP and NMRURP deliver both high average performance (within 1% of LRUs and NRMU performance) and tight WCET estimates 11% and 24% lower than those of RR.

Full text

Locality-aware Cache Random Replacement Policies Pedro Benedictea,b,∗, Carles Hernandeza,d, Jaume Abellaa, Francisco J. Cazorlaa,c Carrer Jordi Girona 29, Barcelona, Spain aBarcelona Supercomputing Center (BSC), Barcelona, Spain bUniversitat Polit`ecnica de Catalunya (UPC), Barcelona, Spain cIIIA-CSIC, Bellaterra, Spain dUniversitat Polit`ecnica de Val`encia (UPV), Val`encia, Spain Abstract Measurement-Based Probabilistic Timing Analysis (MBPTA) facilitates the analysis of complex software running on hardware comprising high-performance features. MBPTA also aims at preventing additional analysis costs for timing analysis techniques and preserving the confidence on derived WCET estimates. Cache behavior has a deep influence on WCET estimates and hence on “the amount of software” that can be consolidated onto a single hardware platform. Deterministic replacement policies such as LRU (Least Recently Used) and NMRU (Non-Most Recently Used) have systematic pathological cases that may lead to high execution times and WCET estimates. Instead, random replacement (RR) decreases pathological cases probability, at the cost of temporal locality. We present two new MBPTA-amenable replacement policies that completely remove the presented pathological cases. The first policy, Random Permutations (RP) preserves higher temporal locality than RR; while the second, NMRU Random Permutations (NMRURP), also protects the Most Recently Used line from eviction. Both proposed policies build upon restricted random replacement choices. Our simulation evaluation (validated against a real prototype) using the Malardalen benchmarks and a case study shows that RP and NMRURP deliver both high average performance (within 1% of LRUs and NRMU performance) and tight WCET estimates 11% and 24% lower than those of RR. 1. Introduction 1The increased level of automation in critical real-time embedded systems (CRTES) and the advent of autonomous vehicles across different CRTES domains call for higher levels of performance than5 those provided by simple microcontrollers used nowadays [2, 3]. Such performance can only be achieved using powerful processors implementing high-performance features including cache memories. Unfortunately, caches challenge the estimation10 of Worst-Case Execution Time (WCET), a fundamental step for timing validation and verification and hence for assessing the correct timing behavior of CRTES [4]. ∗Corresponding author Email address: [email protected] (Pedro Benedicte) 1This work is based on the work previously published in SAC [1] In this work, we build upon measurement-15 based probabilistic timing analysis (MBPTA) [5, 6]. MBPTA is a mature technology that has been successfully assessed with case studies in the automotive, railway, space, and avionics domains [7][8]. MBPTA builds on the underlying (complex) plat-20 form having certain properties in its timing behavior as a means to facilitate the analysis of software timing. In particular, MBPTA requires the sources of execution time variability (jitter) to be either upper-bounded (during analysis) or time-25 randomized (during both analysis and operation). For instance, latencies due to values operated in variable-latency units are typically upper-bounded, and cache placement is typically randomized. By applying these techniques to the different sources30 of jitter of the processor, MBPTA relieves the user from controlling during the test campaign low level aspects of those resources causing jitter, for which the end user may lack means to determine and en- 1 force their worst timing behavior at analysis.35 The jitter that caches cause on programs’ execution time challenges the tightness of the bounds derived by timing analysis techniques since memory placement (and so cache placement) changes across software integrations [9]. If these effects are40 not properly leveraged – which is in general quite challenging – WCET estimates obtained for a given software unit are no longer valid when incrementally integrated with other software units (even if they share no data or instructions) as part of the45 regular software development process. This occurs because small changes in the memory placement modify cache layouts and hence, cache performance [9]. With random placement, which varies across runs, and replacement caches [10][11] the50 space of potential cache mappings is naturally and randomly explored as the number of program runs (tests) performed is increased. By preserving random placement and replacement during operation, the timing behavior of caches matches probabilisti-55 cally that explored at analysis, effectively relieving the end user from controlling whether bad cache mapping scenarios are captured during experiments carried out at analysis. MBPTA’s requirements on cache memories can60 be achieved either with software or hardware means. Software solutions have been implemented as a pass of the LLVM compiler [10] and as a source- to-source compiler [12], with different implications on the interpretation of WCET estimates. Hard-65 ware solutions (the focus of this work), while requiring specific implementations provide in general higher performance. Cache hardware randomization techniques have been progressively assessed in performance simulators [13] and higher-maturity70 solutions at RTL level on LEON-based platforms (widely deployed in the space domain) that are now offered as a commercial product [14]. The impact of caches on execution time is highly program-dependent. For instance, some programs75 barely exploit cache space. In the context of CRTES, programs may be produced by means of automatic code generation tools (e.g. SCADE [15]), typically leading to programs with few thousands of instructions. For these programs, random re-80 placement (RR) may produce a first pathological scenario (ps1) in which few cache lines fitting in a cache set, randomly evict each other on each miss despite there are some available lines in that set. This occurs because nothing prevents unfortunate85 replacement choices whose probability decreases, but still must be accounted for with WCET estimates, which may be relatively high. RR can also cause a second pathological scenario (ps2) resulting in the replacement of cache lines that have been90 just accessed, losing some temporal locality. Both effects have the same root cause: cache lines recently fetched can be randomly evicted shortly after fetched. In order to tackle this challenge, we make the following contributions:95 1. We make an in-depth analysis of pathological behavior of RR in terms of probability of each pathological scenario and its potential impact on performance. 2. We propose Random Permutations (RP) and100 Non-Most Recently Used Random Permutation (NMRURP) that restrict random choices to prevent pathological cases. RP evicts all lines in a set, yet in a random order, before it starts evicting occupied lines, whereas NM-105 RURP additionally prevents the last cache line accessed from being replaced. Both techniques reduce the number of evictions that can occur before all lines are placed in a cache set (ps1) and increase temporal locality (ps2) by reduc-110 ing the chance of evicting recently accessed lines. 3. We perform a detailed analysis of the suitability of the presented replacement policies, both deterministic policies and their random115 counter-parts, with respect to the properties needed by MBPTA. 4. Finally, we assess RP and NMRURP complexity and benefits with the M¨alardalen benchmarks as well as a railway case study, providing120 evidence of their feasibility and gains in terms of WCET reduction. The rest of the paper is organized as follows. Sections 2 and 3 respectively introduce MBPTA and existing replacement policies. RP and NMRURP125 are presented in Section 4. Section 5 reviews the MBPTA compliance of the different replacement policies. RP and NMRURP are evaluated in Section 6. Section 7 describes some related work. Finally, conclusions are drawn in Section 8.130 2. Background on MBPTA Safety standards require deriving WCET estimates for software units as basic building block for assessing the overall timing of the software. 2 Figure 1: MBPTA application example to an execution time sample with 1,000 measurements. The red dashed line is to the empirical CCDF of the execution time sample. The blue solid line is the EVT-derived pWCET distribution. WCET estimates need to be as tight as possi-135 ble and be consistent with safety-related requirements (goals). A common misconception is that a WCET estimate overrun necessarily causes a system level failure. This, however, is not true since safety mechanisms factor in the impact that over-140 runs can have on the safety goals. Following the probabilistic approach used to handle random hardware faults [16][17], MBPTA reasons on WCET as a distribution, aka probabilistic WCET (pWCET) curve [18, 19], describing the maximum probabil-145 ity with which a WCET estimate can be exceeded. This approach has been assessed in case studies in railway, space, aerospace and automotive [7][8]; and shown fit safety standards [20]. We refer the reader to those works for more details on MBPTA.150 MBPTA builds on a set of execution time measurements taken during system analysis phase, whose Complementary Cumulative Distribution Function (CCDF) is shown with a dashed red line in Figure 1. Those measurements are passed as input155 to Extreme Value Theory (EVT) [21], a statistical tool to estimate an upper-bound distribution for high execution times. MBPTA controls how execution time measurements are collected so they capture those conditions that lead to higher or equal160 execution times than those during system operation. EVT requires that the execution times meet several statistical properties related to the degree of independence and identical distribution of the random variable (execution times) modeled [22, 23].165 Also whether execution times can be modeled with an exponential tail, which is the most convenient distribution for pWCET estimates of real-time programs [5, 6]. MBPTA delivers a pWCET distribution, often170 depicted as a CCDF, so that for each particular execution time value we obtain an upper-bound probability with which it can be exceeded (see blue solid line in Figure 1). Therefore, the pWCET estimate is the value such that its upper-bound exceedance175 probability can be regarded as irrelevant in relation to acceptable failure rates in the corresponding safety standards (e.g. ISO26262 in automotive [16]). For instance, as shown in Figure 1, the probability of the program to take 22,000 cycles or180 longer is below an exceedance probability of 10−12 per run. Interestingly, EVT is able to predict the probabilities for combinations of events that have not occurred simultaneously in any of the observations185 in the sample. For instance, if those observations correspond to the execution time when experiencing between 10 and 20 cache misses, EVT can predict the probabilities for execution times caused by a larger number of misses (e.g. caused by 50, 100 or190 1,000 misses) [24]. 3. Analysis of replacement policies Several replacement policies have been proposed over the years. We classify them into two main categories: those with a fully deterministic behavior195 and those with a randomized behavior. 3.1. Deterministic replacement policies We analyze LRU, NMRU and BT replacement policies as a representative of deterministic policies. It is noted that the latter two have been pro-200 posed to reduce the hardware requirements of the former [25]. Our analysis shows that all of them have systematic pathological cases, i.e. addresses sequences for which they result in evictions that occur systematically.205 LRU keeps the order in which lines in the set have been last accessed, from the most recently used (MRU) to the least recently used (LRU). Upon a cache hit, the cache line accessed is promoted to the top of the list (MRU). Upon a cache miss, the cache210 line in the botton of the list (LRU) is replaced and used to store the newly fetched cache line, which is then promoted to the first position in the list. NMRU can be seen as a simplified version of LRU. Keeping the full order of cache lines in a set is215 increasingly costly for high associative cache memories: for an N-way cache, LRU requires keeping the 3 Figure 2: Schematic of BT operation. Dark thick lines indicate candidates for replacement. full order across the N elements. NMRU instead only prevents the MRU line from being evicted, without imposing any particular order on the other220 cache lines. This can be achieved, for instance, with a single pointer indicating the next line to be evicted in the set (e.g. in a round-robin fashion) skipping the MRU line if it is selected for eviction. In general, such a solution may not preserve tem-225 poral locality as much as LRU, since the 2nd MRU line could be evicted instead of the LRU line on a miss. On the positive end, NMRU scales to arbitrarily highly associative caches with limited cost: a pointer to the next line to be evicted (incremented230 upon an eviction) and another pointer to the MRU line to protect it from being evicted. BT protects the MRU line, as NMRU does, but also keeps some partial order on the remaining lines. Hence, BT lays in-between LRU and NMRU in235 terms of ability to preserve temporal locality and complexity. In particular, BT partitions cache lines in a set into two halves (left and right) recursively indicating in each partition the side from where to select the line to be evicted. This is illustrated in240 Figure 2 for an 8-way cache set. In the figure, cache line 2 is the candidate to be replaced. Upon an access, all arrows in the path to the cache line accessed are changed to point to the other element. For instance, as shown in the figure, on a miss all245 arrows pointing to 2 are changed, thus pointing now to 4. Then, upon a hit on cache line 0, only the arrow pointing to the pair 0-1 is changed to point to the pair 2-3. Note that within the pair 2-3, the corresponding arrow points to 3, thus providing250 some temporal locality protection for 2, which has been accessed recently. While such protection does not guarantee full order as in the case of LRU, it provides some further temporal locality protection than in the case of NMRU. BT has a logarithmic255 cost on the associativity, thus limiting the overhead w.r.t. LRU, although it is slightly higher than that of NMRU. In particular, it requires 1 bit for each left/right choice. Hence, N-1 bits are needed per set for an N-way cache.260 Pathological cases. All deterministic policies have, at least, one pathological case for which accesses systematically result in misses. One such cases for all deterministic policies above is an access sequence with N+1 different addresses accessed in265 a round-robin fashion. For instance, for a 4-way cache, a pathological case would be repeating the sequence ABCDE an arbitrary number of times. •LRU: after the first 4 accesses, Ais the LRU270 line, so Eevicts A. Then we access A, which is a miss and evicts B. Then access Bresults in a miss that evicts C, and so on and so forth. •For NMRU it can be seen that 5 different addresses are enough to evict cache lines in the 4275 sets in a round-robin fashion. In this particular example we never try to evict the MRU line, so the behavior is analogous to a FIFO policy. •In the case of BT, although less obvious, after 4 misses, the tree points to the first line fetched280 out of those for replacement systematically, so Eevicts A,Aevicts B,Bevicts Cand so on and so forth, analogously to the case of LRU and NMRU. While our analysis is limited to a subset of re-285 placement policies, it serves the purpose of illustrating that systematic pathological cases exist for deterministic policies due to their intrinsic deterministic nature. Such systematic cases can only be broken, in general, by means of some form of ran-290 dom choice. For instance, this is the case of random replacement (RR), which randomly selects the cache line to be evicted in the set upon a miss. 4 3.2. Random replacement Cache memories achieving MBPTA compliance295 via hardware implement random placement and replacement [10, 11]. Random placement [10] produces random and independent address mappings across sets so that two arbitrary addresses (not in the same cache line) are mapped to the same set300 with a probability 1/S, where Sis the number of sets. Random replacement (RR), makes random eviction choices so that, in the event of a miss in a given set, for a cache with Wways, the probability of a line in that set to be evicted is 1/W.305 RR builds on a pseudo-random number generator (PRNG) with sufficient quality to allow cache conflicts to be truly random. These low-cost and MBPTA-amenable probabilistic properties of such PRNGs have already shown elsewhere [26].310 RR evicts a specific cache line with a probability of 1/N for an N-way cache. Hence, the probability of a line surviving an eviction is (N-1)/N, and hence, there is a non-null probability of survival for cache lines for any access sequence. In particu-315 lar, for the systematic pathological case above for deterministic replacement policies, RR provides a survival (hit) probability of 3 44= 0.316. On the other hand, if we consider a sequence with N addresses instead of N+1, then we realize that320 all deterministic policies would lead to all-hit sequences except for cold misses. Instead RR has non-null probability of evicting some cache lines before (randomly) placing all addresses in distinct physical cache lines so that all remaining accesses325 become hits. This occurs because RR is unaware of temporal locality since it does not preserve any history. Since pWCET estimates with MBPTA need to account for the worst case that can occur with non-330 negligible probability, the pathological cases of deterministic policies need to be accounted. In the case of RR, some low-probability high-execution time eviction scenarios need to be accounted for, but those scenarios will not include the absolute335 worst case, which is the actual case for deterministic policies under systematic pathological cases. Still, the fact that these eviction sequences can occur under RR may lead to high pWCET estimates, which relates to the fact that RR is a locality-unaware340 replacement policy. This is illustrated with the following examples. 3.2.1. The number of objects mapped to a cache line is smaller than or equal to W Let us consider a fully-associative data cache345 with 4 ways (W= 4) and a program accessing alternatively addresses Aand B, which belong to different cache lines, 20 times each. First, Ais placed in a random line. Then, Bwill be placed in a random line, with a probability of 3/4 of not replacing A350 and 1/4 of replacing it. If Breplaces A, then Ahas a 1/4 probability of replacing Bagain. And they can keep replacing each other with probability 1/4. Overall, this program experiences M+ 2 misses (2 cold misses are always experienced), where M≥0,355 with a probability: P(M) = 1 4M ×3 4(1) For instance, P(4) (the probability of having 4 + 2 = 6 misses) is ∼0.003, P(10) ≈7·10−7and P(20) ≈7·10−13 (see blue line in the top chart of360 Figure 3). Assuming 10 cycles per miss and 1 cycle per hit, and considering only the impact of cache in execution time, the pWCET at an exceedance threshold of 10−12 per run can only be at least 238 cycles to account for 22 misses and 18 hits, since365 the probability of having at least 22 misses (the accumulated probability of [22,40] misses) is ∼9· 10−13, see blue line in the bottom chart of Figure 3. 3.2.2. The number of objects mapped to a cache line exceeds W370 Another pathological case arises when the number of objects mapped to the same set exceeds W. In this case, RR can lead to the loss of temporal locality, since random eviction patterns can make recently touched objects (i.e. cache lines) be evicted375 from cache on a miss, whereas old-standing (unlikely to be reused) objects remain in cache. For instance, in the repeating sequence ABACADAE..., where Ais continuously interleaved with accesses to addresses that lead to a cold miss, RR may evict A380 sometimes. Conversely, deterministic policies presented in previous section would always protect A from eviction since it is the MRU line upon the access to any other address. As the number of objects mapped per set increases, cold and capacity385 (unavoidable2) misses become the main contribu- 2They could only be avoided prefetching cache lines, but still prefetch requests would need to fetch data from upper memory levels. 5 Figure 3: pWCET and probabilistic miss count curves. tors to miss rates, naturally reducing the benefit of any replacement policy. 4. Locality-aware random replacement In this section we introduce our proposed (tempo-390 ral) locality-aware random replacement policies. In particular, we propose Random Permutations (RP) and NMRU Random Permutations (NMRURP), which aim at avoiding systematic pathological cases such as those of deterministic policies as well as pre-395 serving higher levels of temporal locality than RR, thus improving RR. 4.1. Random Permutations (RP) RP limits pathological random replacement scenarios by increasing temporal reuse and enforcing400 random evictions to occur across all cache ways. •When accessed data fits in a cache set, they will eventually be placed in different cache lines, thus avoiding potentially long mutual evictions by construction. This would result in a sin-405 gle replacement for the previous example, thus leading to a maximum execution time of 67 cycles (3 misses and 37 hits), see red lines in Figure 3. •When the number of accessed lines exceeds the410 size of a set, RP effects are also positive increasing reuse, though the impact of replacement naturally reduces. To reach its goals, RP leverages the concept of Random Permutations [27], which we first intro-415 duce and then explain how can be used and implemented in RP. We finally show how the resulting RP limits pathological eviction patterns. 4.1.1. Logic behind Random Permutations Random Permutations avoid potentially infinite420 starvation in the arbitration for shared resources, where one requester (unluckily) loses all arbitrations with decreasing probabilities. This occurs with standard random (lottery) arbitration [28], with which on every arbitration round the grant425 is randomly given to one of the requesters without taking into account how long requests have been waiting. Hence, while each of the Nrrequesters is granted access 1/Nrof the times in the long run, one requester could suffer long starvation periods.430 Instead, Random Permutations generates in every arbitration (or permutation) window a random permutation of all potential requesters. While the particular requester that is granted access in each arbitration round is random, each of the Nrre-435 questers is granted access exactly once every arbitration window. For instance, for a resource shared across Nr= 3 requesters (r1, r2 and r3) each requester has 1/3 chances to be granted access first. If r2 is granted access, then r1 and r3 have 1/2440 chances to be granted access second, whereas r2 cannot be granted access second. If r3 is granted access second, then r1 is automatically granted access third. RP is implemented by creating a list where each445 requester appears once and sorting it randomly. Note that a requester could request access to the shared resource at any point in time w.r.t. the current arbitration window. Thus, the worst case occurs when, for instance, r2 arrives in the second slot450 of the current arbitration window, r2 was the first one in the window (so it just missed its opportunity), and has to wait for its slot in the next window, which, potentially, can be the last one. Recalling the example before, we could have the following455 arbitration windows: < r2, r3, r1>,< r3, r1, r2>, and r2 could arrive right after its slot in the first window has elapsed. Overall, in general the maximum number of slots a requester may have to wait is 2 ·(Nr−1). This limits how long a request waits460 to be granted access. RP can be applied with the same logic to the replacement policy. Instead of randomly choosing the way within the cache set that will be evicted next, 6 Figure 4: RP operation and an example for a 4-way cache. RP generates a random permutation window per465 set in which the number of elements matches the number of cache ways W. Whether a line is evicted next is a random event (each line can be evicted with 1/W probability), but the eviction choices, though random, are not independent among them.470 In other words, each different permutation has the same probability to be created, each way number is in each of the Wpositions of the NP erm different permutations NP erm/W times and permutations are chosen (generated) randomly. However, given475 that each permutation contains each way number exactly once, it is impossible that a way is not selected for more than 2 ·(W−1) evictions, and a particular way can be evicted at most twice consecutively (if it is the last in one permutation and the480 first in the following one). 4.1.2. Implementing RP For a W-way cache the total number of potential permutations of cache ways is Nperm =W!. At hardware level, implementing such an ideal solution485 could require W!·dlog2(W)e·Wbits for the permutations table, dlog2(W!)ebits per set for the pointer that selects the permutation, and dlog2(W)ebits for selecting the current permutation entry, plus the control logic for such an implementation. For a490 4-way cache this would mean 192 bits for the table and 7 (5+2) bits per set. In an 8-way cache or higher this number significantly increases. In this section we implement a low-complexity solution that limits the number of potential permuta-495 tions while preserving the properties of the ideal solution, and matching its average and WCET performance. We use area and logic as main metrics to assess the hardware feasibility of our approach. Registers area: We implement RP by adding500 a bit vector per cache set, similar to that needed for Least-Recently Used (LRU) replacement. In the vector each way number is represented exactly once. Given a cache with Wways, this vector requires Wfields with dlog2Webits each, plus a pointer of505 dlog2Webits to point to the current position in the vector. Thus, a 2-way cache requires 2+1 (vector+pointer) bits, a 4-way cache 8+2 bits and a 8-way cache 24+3 bits. For comparison purposes, LRU requires the same number of vector bits per510 set to keep the eviction order. Hence RP has similar area requirements in terms of bits to keep the replacement state as LRU, and only adds the bits of the pointer indicating the current position in the permutation.515 Additional logic: The vector part of RP for a 4-way cache is depicted in Figure 4 (left). We denote the id assigned to cache ways as w1, w2, w3 and w4 respectively. Whenever the pointer wraps up, a new random permutation is generated. This520 is done, as shown in the picture, swapping different parts of the vector based on some random bits: R1, R2 and R3. R1 determines whether the first two elements are (randomly) swapped or not. R2 does the same for the last two elements. Finally, R3 deter-525 mines whether the first pair of elements is swapped or not with the second pair. This simple implementation allows to generate a new permutation quickly and efficiently. LRU, instead, needs being able to extract any element from the list, place it530 at the beginning and shift all leftmost elements one position (dlog2Webits) right. Thus, multiplexers (as for RP) and expensive parametric shifters are needed for LRU which compromises its scalability. Random bits can be easily generated with a single535 low-cost linear feedback shift register [26, 29], which meets the requirements of MBPTA. Although each cache set has its own random permutation, the number of new permutations needed in one cycle in the cache is, at most, as many as cache ports ex-540 ist since, in the worst case, all simultaneous accesses could produce a miss that requires a new random permutation in their respective cache sets. This would require 3 random bits per cache port simultaneously. The PRNG used has been proven capable545 to produce at least 32 bits per cycle if needed, thus making a PRNG able to feed multiple caches. On average, however, each cache port will require one new permutation every Wcache misses, which occur seldom. Thus, usual random bit requirements550 per cycle are very low and a single PRNG could fit all caches in one or several cores. One feature of our implementation is that it generates a subset of all potential permutations (8 of 7 Figure 5: Hardware implementation cost for a 64-set cache of RP for different design choices. the possible 24 in a 4-way cache). For instance,555 w1 and w2 can never be in separate pairs. This means that permutation < w1, w3, w2, w4>can never be produced. Yet our implementation still preserves the properties needed by MBPTA on random replacement: a given way occupies each posi-560 tion in the permutation with identical probabilities and where they are allocated is a purely random choice. The right side of Figure 4 shows an example of the generation of a new random permutation for the replacement of one cache set. Ini-565 tially, we have the permutation < w1, w2, w3, w4>. Given that random bit R1 = 1, w1 and w2 are swapped. Since R2 = 0, w3 and w4 are not swapped. Finally, R3 = 1, so < w2, w1>and < w3, w4>are swapped, leading to the new per-570 mutation < w3, w4, w2, w1>. In Figure 5 we compare the implementation costs of the fully randomized design and our cost efficient one of RP. For caches with 2 or 4 ways, the implementation cost is roughly the same. However, from575 8 ways to 32 the cost of the ideal solution requires a million to 1037 bits respectively, while the efficient solution only needs 2,000 to 10,000 bits. 4.1.3. Controlling pathological scenarios RP controls the pathological scenarios drawn for580 RR, i.e. ps1 and ps2, as presented next. ps1: when Wor fewer lines are (randomly) placed in the same set, they can replace each other a limited number of times. Let us recall the example in Section 3 where addresses Aand Bare585 accessed repeatedly. With RP two scenarios can occur (illustrated in Figure 6): 1. Aand Bare granted access with the same permutation window to take eviction decisions. In this case, Aand Bwill be placed in different590 random ways. 010 1 A B 010 1 A B A & B use the same permutation window A & B use different permutation windows Figure 6: Example of the two different scenarios that can occur in ps1 with RP. 2. Aevicts a line using the last element of one permutation window and Buses the first element of a new permutation window. In this case, again, two scenarios can occur. Firstly,595 Aand Buse different ways. And second, A and Bare randomly mapped to the same way. In the latter case, Bevicts A, but next time that Ais fetched will necessarily use the same permutation window as B, so it will be placed600 in a different way. Thus, at most one mutual eviction will occur. Overall, when 2 different addresses compete for the space in a given cache set, at most 1 mutual eviction will occur. In the general case, if Kdif-605 ferent addresses are accessed, where K≤W, the worst case occurs when K−1 addresses use the last elements of a permutation and the last address uses another permutation so that it evicts one of the other K−1 addresses which, in turn, evicts an-610 other and so on and so forth. However, eventually the Kaddresses produce Kconsecutive evictions using elements of the same permutation, thus being placed in different cache ways and avoiding pathological evictions. Thus, the maximum number of615 pathological evictions can be expressed as: Nmaxevict ≤K−1,∀K≤W(2) ps2: when the number of addresses mapped to a set exceeds the number of ways, i.e. K > W compete for the same cache set, on every miss, RR620 can randomly evict recently touched lines hence decreasing temporal reuse. To show this we run an experiment in which we access a given number of addresses Kin a sequence of size 2 ×Kin which the addresses are randomly selected. We assume625 that all addresses are mapped to the same set and analyze the average hit rate of RR and RP when processing the same random sequence 1,000 times. Figure 7 shows the hit rate, for a 4-way cache (e.g. DL1-like) and a 8-way cache (e.g. L2-like), of RR630 and RP as Kvaries from W+ 1 to W∗3. We 8 (a) DL1 (W= 4) . (b) L2 (W= 8) Figure 7: Miss rate as a function of the number of accessed addresses for cache sizes similar to L1 and L2 respectively. see that RP consistently lowers miss rates for both setups, with the benefit decreasing as the number of addresses increases w.r.t. the way size Wsince the overall miss rate naturally equalizes for high635 address counts, i.e. K >> W, when cache set capacity is largely exceeded. 4.2. Non-Most Recently Used Random Permutations (NMRURP) NMRURP, similar to RP, limits pathological ran-640 dom replacement scenarios by increasing temporal reuse and enforcing random evictions to occur across all cache ways, but additionally, it guarantees that the MRU line cannot be evicted. In particular, it avoids potentially long mutual evictions by645 construction, thus behaving as RP in the example in Figure 3. Whenever the number of cache lines exceeds the space of the corresponding cache set, NMRURP has still some positive effects on reuse, but obviously the impact of replacement policies di-650 minish as the set capacity is increasingly exceeded. In order to introduce NMRURP, we build upon our other proposed randomized replacement policy, RP. First, we show how in specific cases RP may not favor locality sufficiently, and then how NMRURP655 improves over RP. 4.2.1. Locality awareness of RP RP improves locality over RR by avoiding the replacement of a given cache line within a permutation (window). Hence, cache lines recently fetched660 cannot be evicted before crossing the boundary to the next window. However, there are two scenarios where RP may fail to preserve locality: 1. RP places no constraint across arbitration window boundaries. Hence, potentially, the same665 physical cache line could be evicted twice consecutively, which would allow the MRU line to be evicted. This occurs whenever a cache line is the last in a window and the first in the following window.670 2. Also, RP does not keep any history on whether cache lines have been hit recently. Hence, if a given cache line can be the candidate for replacement according to RP, be hit, and then be evicted immediately due to a miss, thus caus-675 ing an eviction of the MRU line. Next, we illustrate those two scenarios with specific examples that serve the purpose to motivate the introduction of NMRURP. RP example 1: window boundaries. Let680 us assume a 4-way cache whose current and next arbitration windows are < w1, w2, w3, w4>and < w4, w2, w3, w1>respectively. Let us further assume that the next eviction is dictated by the last slot of the current window (w4 in the first win-685 dow), and w4 in the cache set contains cache line A. The sequence B1A1B2, where the subscript only indicates access ordering to a given address, would cause 3 misses. First, B1would miss and would evict the line in w4, so address A. The pointer in690 the arbitration window would move to the first position in the next permutation, which is w4 again. Then A1would also miss, thus evicting B. Finally, B2would also miss and would replace the address in w2.695 As shown, RP allows evicting the MRU cache line even if it has just been fetched when crossing arbitration window boundaries if the last slot of one window and the first slot of the following window randomly point to the same cache way, which oc-700 curs with probability 1/W , where Wis the number of cache ways. RP example 2: MRU hit. Let us assume the same example, so the current arbitration window is < w1, w2, w3, w4>, the candidate for eviction is705 w4, and Ais stored in w4. In this case, the sequence A1B1A2would produce 2 misses since A1is a hit, 9 Table 2: Average results for the 10,000 executions and the worst 100 (1%) for the railway case study. All Worst 1% LRU NMRU BT RR RP NMRURP LRU NMRU BT RR RP NMRURP Cycles 3299 3288 3288 3311 3288 3289 3389 3306 3299 3408 3305 3306 IL1 m.r. 0.151 0.151 0.151 0.152 0.151 0.151 0.151 0.151 0.151 0.153 0.151 0.151 DL1 m.r. 0.302 0.302 0.302 0.305 0.302 0.302 0.303 0.314 0.307 0.312 0.315 0.314 L2 m.r. 0.781 0.781 0.781 0.776 0.781 0.781 0.794 0.772 0.776 0.783 0.772 0.772 zero. However, we also observe that hit rates1205 slowly increase with the number of iterations for 4 addresses due to the cases where lines evict each other despite fitting in cache. A similar trend occurs for 2 and 3 addresses, but it is omitted in the plot since visually it is not so1210 obvious. •Finally, Figure 11(c) shows the matching results for RP and NMRURP. We observe that the hit rate grows rapidly with the number of iterations for 4 addresses. It also grows faster1215 than RR for 2 and 3 addresses. However, for larger address counts the hit rate decreases faster than for RR being zero for 8 addresses. However, in that case the real problem is not the replacement policy, but the fact that cache1220 capacity has been largely exceeded. 6.2.2. M¨alardalen Table 1 shows the average number of cycles and miss rates for IL1, DL1 and L2 for the 10,000 executions performed for each replacement policy.1225 For the MBPTA compliant replacement policies, we also show the average of the 1% of simulations that had the highest execution times. The worst 1% runs for RP and NMRURP perform as good as the average of all runs for LRU and the other determin-1230 istic policies. As shown, for the highest 1% execution times, the gap between RR and RP/NMRURP increases due to the bounded pathological evictions with RP/NMRURP. Also, there is a significant gap with LRU, which also triggers some patho-1235 logical cases in some sets for some placements, thus showing that RP and NMRURP are the best MBPTA compliant replacement policies. LRU only performs slightly better than RR but worse than RP/NMRURP. This occurs because it preserves1240 temporal locality better than RR, but its pathological cases make it worse than RP/NMRURP. Note that L2 miss rates are lower for the worst 1% than on average for all runs. This relates to the fact that DL1 accesses dominate execution time, and higher1245 execution times occur for higher DL1 miss rates. Thus, although the number of L2 misses remains barely constant for the worst 1%, the number of accesses increases and hence, the L2 miss rate decreases.1250 Differences between RP and NMRURP in terms of average performance are marginal for the evaluated benchmarks. While differences among them exist and may be relevant in some specific cases, most programs do not exhibit often those specific1255 cases where NMRURP is superior to RP and hence, their average performance is roughly identical. Although NMRU and BT are not compatible with MBPTA, as discussed before, we also include them in this evaluation, showing that their performance,1260 both across all measurements and across the worst 1%, is roughly identical to that of RP and NMRURP, which, however, attain MBPTA compliance. For the sake of completeness, we have also con-1265 sidered 8-way caches, despite the target processor (LEON4 multicore) only implements 4-way caches. However, other embedded processors also implement 8-way L1 caches. Since the L1D cache has shown to be the most sensitive cache to the re-1270 placement policy used for this benchmark suite, we have only varied L1D cache set-associativity (using 8 instead of 4 ways). Results across all benchmarks barely changed, showing less than 1% variation w.r.t. the 4-way setup in terms of execution1275 time. For instance, results for NMRURP with an 8- way DL1 are 44,789 cycles on average, and 45,071 cycles for the worst 1%. Since no further insight was observed, detailed results have been omitted. 6.2.3. Railway case study1280 For the railway case study, average results across input sets are shown in Table 2. As shown, RP and NMRURP provide small gains w.r.t. RR in terms of cycles, DL1 and IL1 miss rates. RP and NMRURP are slightly worse in terms of L2 miss rate. When1285 compared against LRU and the other determinis- 16 bs bsort100 cnt compress cover crc duff fac fdct insertsort jfdctint lcdnum qsort-exam qurt select statemate ud -20% 0% 20% 40% 60% 80% 100% pWCET reduction LRU RP NMRURP Figure 12: pWCET reduction (p= 10−12) for the M¨alardalen benchmarks w.r.t. RR. Figure 13: pWCET for jfdc-tint M¨alardalen Benchmark for all MBPTA compliant replacement policies. 0123456789 -20% -10% 0% 10% 20% 30% pWCET reduction LRU RP NMRURP Figure 14: pWCET reduction (p= 10−12) for the rail case study for all MBPTA compliant replacement policies. tic policies, we also observe negligible differences. However, if we keep only the highest 100 measurements (the worst 1% of them), we observe that differences increase, evidencing that RR may pro-1290 duce pathological scenarios ps1 and ps2, as we have further verified inspecting the sequences of events for the worst RR runs. Conversely, RP and NMRURP limit the maximum number of evictions so that its worst case is better than that of RR. As for1295 M¨alardalen, LRU performs slightly better than RR but worse than RP/NMRURP since LRU produces sporadic but significant pathological cases. Figure 15: pWCET curve for input 9 of the railway case study w.r.t. RR. Analogously to the case of M¨alardalen benchmarks, differences between RP and NMRURP in1300 terms of average performance for the railway case study are marginal, and NMRU and BT, which are not MBPTA compliant, perform roughly as RP and NMRURP. 6.3. Worst-case performance1305 As shown in the previous section, the differences between RR/LRU and RP/NMRURP grow at the tail of the distribution (i.e. for the highest values): for instance, average execution time for RP is 1% lower than for RR and 3% lower for the 1% highest1310 execution times of RR. The latter translates into tighter pWCET estimates for RP/NMRURP. 6.3.1. M¨alardalen For M¨alardalen benchmarks, in Figure 12 we present the reduction of pWCET estimates at 10−12 1315 w.r.t. those of RR. We observe that RP and NMRURP are consistently better than those for RR. The improvement ranges from 1% to 86%, being 17 24% on average for RP and NMRURP. This significant reduction in pWCET evidences the advantage1320 of using RP or NMRURP instead of RR or LRU. LRU is on average 1% better than RR, performing a better on some cases and worse in others. While discrepancies between RP and NMRURP are larger in terms of pWCET estimates than in1325 terms of average performance, they are low across individual benchmarks and marginal on average. In fact, if we consider confidence intervals of 95% for pWCET estimates, intervals overlap for RP and NMRURP, thus indicating that differences are not1330 statistically significant. Part of our future work consists of investigating whether specific patterns causing different behavior between RP and NMRURP exist to a sufficient extent in some industrial programs so that a better selection among RP and1335 NMRURP replacement policies can be performed. Figure 13 shows the pWCET distribution when using RR, LRU, RP and NMRURP for the jfdctint M¨alardalen Benchmark. Red dotted lines and black straight lines represent the CCDF for1340 the measured data and the pWCET curves respectively. RP and NMRURP provide increasingly higher gains as the exceedance threshold decreases due to the fact that RP and NMRURP avoid pathological evictions by construction. Since RR can1345 produce some such pathological evictions with relevant probability, MBPTA accounts for that by smoothening the shape of the curve and shifting it to the right. Analogously, LRU can produce some pathological cases, which has also some significant1350 impact on pWCET estimates. 6.3.2. Railway case study For the rail application Figure 14 shows the pWCET estimates at 10−12 w.r.t. those of RR. We observe that the pWCET estimates of RP and NM-1355 RURP are consistently better than those for RR , while LRU is sometimes better and sometimes worse, although on average LRU performs worse since its pathological cases can occur systematically as opposed to those of RR, which occur with de-1360 creasing probabilities. RP pWCET reduction w.r.t. RR is 11% on average, reaching 22.6% for input set 7. For illustration purposes, Figures 15 shows the pWCET distribution when using LRU, RR, NM-1365 RURP and RP for the railway case study (input set 9). Observed trends are similar to for M¨alardalen benchmarks: the lower the exceedance probability considered, the larger the gap between RP/NMRURP and RR/LRU. Moreover, in this1370 particular case, we observe that LRU is significantly worse than RR (almost 20% worse) due to the systematic nature of its pathological cases. Overall, RP and NMRURP provide slightly better average performance than RR, and similar per-1375 formance as deterministic policies. However, in terms of pWCET estimates, our proposed replacement policies, RP and NMRURP, are consistently better than RR and LRU by preserving locality and avoiding pathological cases by construction.1380 7. Related work Literature on timing analysis is abundant and it is not the purpose of this work describing the different existing approaches. Instead, we refer the interested reader to a detailed survey describing1385 pros and cons of static, measurement-based and hybrid timing analysis approaches [4]. Recently, existing timing analysis approaches together with those based on probabilistic analysis have also been compared taking into account their potential sources of1390 unreliability [36]. Research on replacement policies is abundant, but often targets either improving average performance or achieving deterministic predictability. Among those we find FIFO and LRU replacement1395 policies as well as enhanced versions of them such as protected LRU [37] and pseudo-LRU, which has already been deployed in some IBM processors [38]. A performance comparison of these replacement policies including also NMRU is pre-1400 sented in [39]. Also, an oracle replacement policy has been defined as a reference but not made implementable [40]. Work on optimizing replacement policies for second (L2) and third level (L3) caches is abundant [41, 42, 43, 44, 45]. Those works, ei-1405 ther for uniform [41, 42, 43] or non-uniform [44, 45] cache access architectures, leverage the fact that L1 caches filter many accesses, so that access patterns in L2 and L3 caches differ noticeably from those in L1 caches. In general, those cache policies have1410 systematic pathological cases due to their deterministic nature, thus being unfriendly for MBPTA, as it is the case for LRU. Random replacement (RR) policies have already been used in some COTS processors such as the1415 ARM Cortex R4 [46] and the PowerPC 7450 [47]. These policies, however, have not been shown to meet the degree of randomness needed by MBPTA since they usually build upon low-quality 18 PRNGs. Instead, a LEON-based multicore pro-1420 cessor adapted to be MBPTA-compliant employs a high-quality PRNG, thus meeting MBPTA requirements [8]. However, those conventional random replacement policies, as shown in this paper, may lead to unbounded pathological eviction sce-1425 narios with decreasing probabilities, which impact pWCET estimates. Therefore, RP, by removing by construction those pathological scenarios, provides a significant advantage in terms of pWCET estimates in the context of MBPTA. In this work we1430 have analysed replacement policies in the context of MBPTA. Other works [48, 49] analyse them for Static Timing Analysis. 8. Conclusions MBPTA has been proven to be a powerful tim-1435 ing analysis approach enabling WCET estimation for complex software running on complex hardware. In particular MBPTA enables the use of arbitrarily complex cache hierarchies and placement/replacement policies. In this work we ana-1440 lyze the impact of cache replacement policies showing that deterministic ones can cause systematic pathological cases, thus degrading the quality of the WCET estimates. Conversely, random replacement makes pathological cases non systematic, but they1445 can still occur with decreasing probabilities. This ultimately enforces MBPTA to account for some unfortunate cases with large number of random replacements. We, then, propose two new randomized replace-1450 ment policies, RP and NMRURP. We show that they completely remove pathological cases by preserving cache locality to some extent. This allows avoiding pathological cases and hence, improving WCET estimates drastically. Our evalu-1455 ation on a set of benchmarks and a railway case study show that both policies largely outperform random replacement in terms of WCET estimates, despite average performance gains are rather modest. Whether one of the two randomized replace-1460 ment policies proposed in this paper, namely RP and NMRURP, is superior to the other remains to be proven since differences among them in our evaluation cannot be regarded as statistically significant. Thus, as part of our future work we plan1465 to verify whether large discrepancies among both policies can be found in other applications, as well as extend this analysis to more recently proposed replacement techniques [41, 43]. Acknowledgments1470 This work has been partially supported by the Spanish Ministry of Economy and Competitiveness (MINECO) under grant TIN2015-65316-P, the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation1475 programme (grant agreement No. 772773) and the HiPEACH Network of Excellence. Pedro Benedicte and Jaume Abella have been partially supported by the MINECO under FPU15/01394 grant and Ramon y Cajal postdoctoral fellowship number RYC-1480 2019-14717 respectively. References [1] P. Benedicte et al., RPR: A Random Replacement Policy with Limited Pathological Replacements, in: ACM/SIGAPP Symposium On Applied Computing,1485 2018. [2] D. Buttle, ETAS GmbH, germany, real-time in the prime-time. keynote talk., in: ECRTS, 2012. [3] J. Owens, Delphi automotive, the design of innovation that drives tomorrow. Keynote talk., in: DAC, 2015.1490 [4] R. Wilhelm et al., The worst-case execution-time problem overview of methods and survey of tools, ACM Transactions on Embedded Computing Systems 7 (2008) 1–53. [5] L. Cucu-Grosjean et al., Measurement-based proba-1495 bilistic timing analysis for multi-path programs, in: ECRTS, 2012. [6] J. Abella et al., Measurement-based worst-case execution time estimation using the coefficient of variation, ACM Trans. Des. Autom. Electron. Syst. 22 (4) (2017)1500 72:1–72:29. doi:10.1145/3065924. [7] F. Wartel et al., Timing analysis of an avionics case study on complex hardware/software platforms, in: DATE, 2015. [8] P. Machado et al., Probabilistic timing analysis on time-1505 randomized platforms for the space domain, in: DATE, 2017. [9] E. Mezzetti and T. Vardanega, A rapid cache-aware procedure positioning optimization to favor incremental development, in: RTAS, 2013.1510 [10] L. Kosmidis et al., A cache design for probabilistically analysable real-time systems, in: DATE, 2013. [11] C. Hernandez et al., Random modulo: a new processor cache design for real-time critical systems, in: DAC, 2016.1515 [12] L. Kosmidis, R. Vargas, D. Morales, E. Qui˜nones, J. Abella, F. J. Cazorla, TASA: Toolchain Agnostic Software Randomisation for Critical Real-Time Systems, in: ICCAD, 2016. [13] L. Kosmidis et al., Probabilistic timing analysis on con-1520 ventional cache designs, in: DATE, 2013. [14] COBHAM, LEON3 Processor. Probabilistic platform, http://www.gaisler.com/index.php/products/ processors/leon3. [15] Esterel Technologies, SA, Efficient Developement of1525 Safe Avionics Software with DO-178B Objectives Using SCADE Suite - Methodological Handbook (2006). 19 [16] International Organization for Standardization, ISO/DIS 26262. Road Vehicles – Functional Safety (2009).1530 [17] International Electrotechnical Comission, IEC 61508, Functional Safety of Electrical/Electronic/Programmable Electronic Safety-related Systems, Edition 2.0 (2009). [18] G. Bernat, A. Colin, S. M. Petters, Wcet anal-1535 ysis of probabilistic hard real[hyphen]time systems, in: In Proceedings of the 23rd Real[HYPHEN]Time Systems Symposium RTSS 2002, 2002, p. 279[HYPHEN][HYPHEN]288. [19] G. Bernat, A. Colin, S. Petters, pwcet: a tool for prob-1540 abilistic worst[hyphen]case execution time analysis of real[hyphen]time systems, Tech. rep. (2003). [20] Z. Stephenson, J. Abella, T. Vardanega, Supporting industrial use of probabilistic timing analysis with explicit argumentation, in: INDIN, 2013.1545 [21] S. Kotz, S. Nadarajah, Extreme value distributions: theory and applications, World Scientific, 2000. [22] K. Palma Silva, L. Arcaro, R. Silva de Oliveira, On using gev or gumbel models when applying evt for probabilistic wcet estimation, 2017. doi:10.1109/RTSS.2017.1550 00028. [23] G. Lima, D. Dias, E. Barros, Extreme value theory for estimating task execution time bounds: A careful look, 2016, p. 200[HYPHEN]211. doi:10.1109/ECRTS.2016. 20.1555 [24] J. Abella et al., Heart of Gold: Making the improbable happen to extend coverage in probabilistic timing analysis, in: ECRTS, 2014. [25] K. Kedzierski, M. Moret´o, F. J. Cazorla, M. Valero, Adapting cache partitioning algorithms to pseudo-lru1560 replacement policies, in: 24th IEEE International Symposium on Parallel and Distributed Processing, IPDPS 2010, Atlanta, Georgia, USA, 19-23 April 2010 - Conference Proceedings, 2010, pp. 1–12. doi:10.1109/IPDPS. 2010.5470352.1565 URL https://doi.org/10.1109/IPDPS.2010.5470352 [26] I. Agirre et al., IEC-61508 SIL 3 compliant pseudorandom number generators for probabilistic timing analysis, in: DSD, 2015. [27] J. Jalle et al., Bus designs for time-probabilistic multi-1570 core processors, in: DATE, 2014. [28] K. Lahiri, A. Raghunathan, G. Lakshminarayana, LOTTERYBUS: a new high-performance communication architecture for system-on-chip designs, in: Proceedings of the 38th annual Design Automation Con-1575 ference, DAC ’01, 2001, pp. 15–20. [29] P. Alfke, Efficient Shift Registers, LFSR Counters, and Long Pseudo-Random Sequence Generators, Xilinx (1996). [30] L. Kosmidis et al., Fitting processor architectures for1580 measurement-based probabilistic timing analysis, Elsevier Journal of Microprocessors and Microsystems 47 (B) (2016) 287–302. [31] L. Kosmidis, E. Quiones, J. Abella, T. Vardanega, F. J. Cazorla, Achieving timing compos-1585 ability with measurement-based probabilistic timing analysis, in: 16th IEEE International Symposium on Object/component/service-oriented Real-time distributed Computing (ISORC 2013), 2013, pp. 1–8. doi: 10.1109/ISORC.2013.6913193.1590 [32] SoCLib, -, http://www.soclib.fr/trac/dev (2003-2012). [33] Cobham Gaisler, Quad Core LEON4 SPARC V8 Processor - LEON4-NGMP-DRAFT - Data Sheet and Users Manual (2011). [34] J. Jalle et al., Validating a timing simulator for the1595 NGMP multicore processor, in: DASIA, 2016. [35] J. Gustafsson et al., The M¨alardalen WCET benchmarks-past, present and future, in: WCET Workshop, 2010. [36] J. Abella et al., WCET analysis methods: Pitfalls and1600 challenges on their trustworthiness, in: SIES, 2015. [37] R. Karedla, J. S. Love, B. G. Wherry, Caching strategies to improve disk system performance, Computer 27 (3) (1994) 38–46. [38] T. Chen, P. Liu, K. Stelzer, Implementation of a1605 pseudo-LRU algorithm in a partitioned cache, uS Patent number 7,069,390 (2006). [39] H. Al-Zoubi, A. Milenkovic, M. Milenkovic, Performance evaluation of cache replacement policies for the spec cpu2000 benchmark suite, in: Proceedings of the1610 42Nd Annual Southeast Regional Conference, ACM-SE 42, ACM, New York, NY, USA, 2004, pp. 267–272. doi:10.1145/986537.986601. URL http://doi.acm.org/10.1145/986537.986601 [40] L. A. Belady, A study of replacement algorithms for a1615 virtual-storage computer, IBM Systems Journal 5 (2) (1966) 78–101. [41] M. Qureshi et al., Adaptive insertion policies for high performance caching, in: ISCA, 2007. [42] M. Chaudhuri, Pseudo-LIFO: The foundation of a new1620 family of replacement policies for last-level caches, in: MICRO, 2009. [43] A. Jaleel et al., High performance cache replacement using re-reference interval prediction (RRIP), in: ISCA, 2010.1625 [44] S. Bartolini, P. Foglia, C. A. Prete, Exploring the relationship between architectures and management policies in the design of NUCA-based chip multicore systems, in: Future Generation Computer Systems, 2018. [45] A. Scolari, D. B. Bartolini, M. C. Santambrogio, A1630 Software Cache Partitioning System for Hash-Based Caches, in: ACM Transactions on Architecture and Code Optimization (TACO), 2018. [46] ARM, Cortex-R4 and Cortex-R4F Technical Reference Manual (2006).1635 [47] Freescale Semiconductor, MPC7450 RISC Microprocessor Family Reference Manual. Rev. 5, Freescale Semiconductor (2005). [48] J. Reineke, Randomized caches considered harmful in hard real[hyphen]time systems, Leibniz1640 Transactions on Embedded Systems 1 (1) (2014) 03:1[HYPHEN]03:13. doi:10.4230/LITES[HYPHEN] v001[HYPHEN]i001[HYPHEN]a003. URL http://ojs.dagstuhl.de/index.php/ lites/article/view/LITES[HYPHEN]v001[HYPHEN]1645 i001[HYPHEN]a003 [49] S. Hahn, D. Grund, Relational cache analysis for static timing analysis, in: Real[HYPHEN]Time Systems (ECRTS), 2012 24th Euromicro Conference on, IEEE, 2012, p. 102[HYPHEN][HYPHEN]111.1650 20