3.4.3.6.3 Factors Affecting PBU Efficacy

PBU efficacy is not a constant value. For a given code segment such as function call, the efficacy of the PBU will be very much dependent on these factors:

  • The code that was executed prior to a given code segment
  • The size of the code
  • The specific location of this code in memory
  • Flow changes that occur during the execution of a specific code segment

Different performance results are possible when a specific segment of code is executed in one context vs. another context. The prior code executed will determine what code data is present in the cache memory. The prior code may have evicted all program data associated with the segment of interest. However, if the segment of interest is repetitively executed, then there is a strong possibility that program data associated with this segment will remain in the cache memory without eviction.

In general, a small segment of code which is repetitively executed will produce the best PBU performance results. This is because the code size is small enough to fit within the cache memory and the repetitive nature of the code will maximize the reuse of the cache contents with a minimum of evictions. The absolute location of a code segment within memory will impact the PBU performance. This is closely related to how the code is compiled, optimized, and linked during the software development process.

Two different program data words in a segment of code could have the same address tags. If these program data words are executed often, then numerous cache evictions and NVM fetches will result during code execution. A larger cache memory and/or increased cache associativity can both help this issue. A larger cache memory increases the number of available address tags, while increased associativity increases the number of location options where a specific program data word could be stored. The more flow changes that occur in each segment of code, the higher the possibility that PBU performance will be reduced.