next up previous
Next: Calculation of Abstract Cache Up: Static Cache Simulation Previous: Static Cache Simulation

Instruction Categorization

Static cache simulation calculates the abstract cache states associated with UPs. The calculation is performed by repeated traversal of the function-instance graph and the UPPA of each function.
definition259

definition261
The notion of an abstract cache state is a compromise between a feasible storage complexity of the static cache simulation and the alternative of an exhaustive set of all cache states that may occur at execution time with an exponential storage complexity.

Based on the abstract cache state, it becomes possible to statically predict the caching behavior of each instruction of a program. Instructions may be categorized as always-hit, always-miss, first-miss, or conflict. The semantics for each category is as follows. Always-hit (always-miss) instructions will always result in a cache hit (miss) during program execution. First-miss instructions will result in a cache miss on the first reference to the instruction and in a cache hit for any consecutive references. Conflict instructions may result in a cache hit or a cache miss during program execution, i.e. their behavior cannot be predicted statically through this simulation method. The different categories are defined below after introducing the notion of a reaching state.


 definition268


 definition271
An always miss occurs when instruction tex2html_wrap_inline1233 is the first instruction encountered in program line l and l is not in the abstract cache state s. An always hit occurs either if tex2html_wrap_inline1233 is not the first instruction in l or l is the only program line in s mapping into c. A first miss occurs if the following conditions are met. First, tex2html_wrap_inline1233 is first in l and if l and at least one other program line m (which maps into c) are in s. Second, if one such line m is in s, then the line must not be reachable anymore from the current UP. Third, all other instructions in the program line have to be either always hits or first misses. A conflict occurs in all other cases.

This categorization results in some interesting properties. If the size of the program does not exceed the size of the cache, hardly any instructions will be categorized as conflicts. Thus, the cache behavior can mostly be statically predicted.gif As the program becomes much larger than the cache, the number of conflicts increases to a certain point. This point depends on the ratio between program size and cache size. After this point, conflicts start to decrease again while first misses increase.


next up previous
Next: Calculation of Abstract Cache Up: Static Cache Simulation Previous: Static Cache Simulation

Robert Palmer
Mon May 19 10:38:07 EDT 1997