




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































By STEPHEN R. HINES
A Dissertation submitted to the Department of Computer Science in partial fulfillment of the requirements for the degree of Doctor of Philosophy
Degree Awarded: Summer Semester, 2008
The members of the Committee approve the Dissertation of Stephen R. Hines defended on June 27, 2008.
David Whalley Professor Co-Directing Dissertation
Gary Tyson Professor Co-Directing Dissertation
Gordon Erlebacher Outside Committee Member
Robert van Engelen Committee Member
Piyush Kumar Committee Member
Andy Wang Committee Member
The Office of Graduate Studies has verified and approved the above named committee members.
ii
I would most like to thank my advisors Gary Tyson and David Whalley for their insightful discussions, support, and guidance throughout the Ph.D. process. Your kind words of encouragement let me know that you understood all too well the pressures of being a graduate student. You have certainly inspired my research career through all the great projects we have worked on together. I would also like to thank the other students that I have worked alongside for these past several years. Whether we were having a heated discussion about multicore, talking about Futurama, or playing a quick game of Magic, each of you certainly helped me to not only survive but thrive in this setting. Being a research assistant in our lab is probably more fun than it should be. I would especially like to thank Prasad Kulkarni for being a great friend and co-worker. It goes without saying that I am grateful for all of the love and support that my wife has given me. I would be pretty lost without you, and I am sure that I would have found a reason to leave this unfinished. I would also really like to thank the rest of my family and friends. Mom, Dad, Frank, Erin, Meena, Nanda, Mugunth,... ; you have always been there for me when I needed you most. I feel truly blessed to have each of you in my life.
iv
List of Tables...................................... vii
List of Figures..................................... viii
Instruction fetch is an important pipeline stage for embedded processors, as it can consume a significant fraction of the total processor energy. This dissertation describes the design and implementation of two new fetch enhancements that seek to improve overall energy efficiency without any performance tradeoff. Instruction packing is a combination architectural/compiler technique that leverages code redundancy to reduce energy consump- tion, code size, and execution time. Frequently occurring instructions are placed into a small instruction register file (IRF), which requires less energy to access than an L1 instruction cache. Multiple instruction register references are placed in a single packed instruction, leading to reduced cache accesses and static code size. Hardware register windows and compiler optimizations tailored for instruction packing yield greater reductions in fetch energy consumption and static code size. The Lookahead Instruction Fetch Engine (LIFE) is a microarchitectural technique designed to exploit the regularity present in instruction fetch. The nucleus of LIFE is the Tagless Hit Instruction Cache (TH-IC), a small cache that assists the instruction fetch pipeline stage as it efficiently captures information about both sequential and non-sequential transitions between instructions. TH-IC provides a considerable savings in fetch energy without incurring the performance penalty normally associated with small filter instruction caches. Furthermore, TH-IC makes the common case (cache hit) more energy efficient by making the tag check unnecessary. LIFE extends TH-IC by making use of advanced control flow metadata to further improve utilization of fetch-associated structures such as the branch predictor, branch target buffer, and return address stack. LIFE enables significant reductions in total processor energy consumption with no impact on application execution times even for the most aggressive power-saving configuration. Both IRF and LIFE (including TH-IC) improve overall processor efficiency by actively recognizing and exploiting the common properties of instruction fetch.
xi
Figure 1.1: Memory Hierarchy and Register Files
compilers promote these frequently used data memory locations to registers in a process known as register allocation. However, there is no such analogue for frequently encountered instructions. Based on our analysis of both static and dynamic instruction redundancy, we developed the Instruction Register File (IRF) to provide a space-efficient and energy- efficient method for accessing these important instructions. Instruction Packing is our joint compiler/architectural technique for placing the most frequently accessed instructions into an IRF. Since the IRF size is small (typically 32 instructions), multiple register references can be packed together in a single instruction, leading to code size reductions. Instruction packing also allows energy to be saved, since some instruction cache accesses can now be replaced by cheaper register file accesses. Execution time is also slightly improved due to a reduction in size of the cache working set. Our research has focused on a prototype implementation of the IRF on top of the MIPS architecture [28]. The initial IRF supported parameterization to help capture greater redundancy in applications. We extended this work to include register windows, which allowed for increased IRF utilization without complicating instruction encoding [31]. The IRF has also been evaluated with other energy saving features such as an L0 instruction cache [30, 32] and a loop cache [31]. We have explored adapting traditional compiler optimizations such as register re-assignment, instruction scheduling, and instruction selection to improve Instruction Packing [33]. The IRF has also been used to decouple instruction fetch from the rest of the pipeline, leading to new energy/performance design points due to the asymmetry of pipeline bandwidth. The combination of these techniques results in an instruction set architecture (ISA) enhancement that reduces fetch energy, code size and execution time without any negative tradeoffs.
Filter or L0 instruction caches (L0-IC) are small, and typically direct-mapped caches placed before the L1 instruction cache (L1-IC) [40, 41]. Due to their small size, these caches reduce the average energy required for fetching an individual instruction. Unfortunately, the small size of the L0-IC can cause additional cache capacity and conflict misses. Any such miss in the L0-IC incurs an additional 1-cycle miss penalty prior to fetching the appropriate line from the L1-IC. The Tagless Hit Instruction Cache (TH-IC) is an alternative configuration for a small cache that allows it to be bypassed on potential misses [34]. Using just a few specialized metadata bits, instruction fetch behavior can be accurately tracked, and TH-IC can supply the fetched instruction when it is “guaranteed” to reside in it. In addition to capturing the majority of small cache hits, these guaranteed hits no longer require a tag comparison, thus further reducing fetch energy consumption. Although caches account for the bulk of energy consumption in the fetch stage, there are, however, other components of instruction fetch that can also have a sizable impact on the processor energy characteristics. In particular, speculation logic can account for a significant percentage of fetch energy consumption even for the limited speculation performed in scalar embedded processors. In fact, with advances in low-power instruction cache design, these other fetch components can dominate instruction fetch energy requirements. To complement TH-IC, we designed the Lookahead Instruction Fetch Engine (LIFE), which is a new approach for instruction fetch that attempts to reduce access to these power-critical structures when it can be determined that such an access is unnecessary [29]. LIFE uses the metadata-tracking capabilities of TH-IC to selectively disable these components when the fetched instruction is guaranteed to be non-speculative. This approach contributes further energy savings and does not negatively impact performance. LIFE can also be used as a filter for later pipeline decisions. We present a case study using next sequential line prefetch to show that LIFE can eliminate a significant fraction of useless prefetches, thereby saving more energy.
The major contributions of this dissertation can be summarized as follows:
The remainder of this dissertation is organized as follows. Chapter 2 discusses the design, implementation and evaluation of Instruction Packing with an Instruction Register File. Chapter 3 describes the design, implementation and evaluation of the Lookahead Instruction Fetch Engine and the Tagless Hit Instruction Cache. Chapter 4 provides an overview of related work in the area of instruction fetch enhancement. Chapter 5 outlines potential areas for further exploration. Finally, Chapter 6 presents our conclusions regarding Instruction Packing and the Lookahead Instruction Fetch Engine.
This chapter presents Instruction Packing, which is a joint compiler/architectural technique that we have developed for improving the overall efficiency of instruction fetch [28]. We also discuss several enhancements that we have made including the addition of hardware register windowing [31], and the adaptation of compiler optimizations [33]. Instruction packing has also been shown to be complementary to several other fetch energy reduction techniques [30, 32].
Instruction fetch is an important pipeline stage for embedded systems, in that it can consume up to one-third of the total processor energy on a StrongARM SA-110 [56]. There are two primary areas for improvement in instruction fetch: enhancements to the instruction fetch mechanism and storage (caching), and enhancements to the instructions being fetched (ISA encoding). Improvements to the fetch mechanism often target energy efficiency and performance, while modifications to the instruction set encoding primarily focus on reducing static code size. These areas are partially related, in that instruction set encoding can often impact the strategies employed for instruction fetch and storage. For example, the complexity of x86 instructions necessitates the use of micro-op encoding and storage in trace caches for the Pentium-4 to maintain an adequate stream of instructions for execution [35]. Caching techniques have greatly improved the fetch of instructions from memory, however, instruction caches still require a significant amount of energy to operate since they are a relatively flat storage method. Caches need to be large enough to hold a significant portion of the working set of an application, and flexible enough to handle divergent control flow. In order to meet these performance goals, designers employ larger
6
approach allows multiple instructions to be packed together and specified (by register index) in a single instruction fetched from the instruction cache (IC). The process of coalescing multiple instruction register references together is known as Instruction Packing. Using a register file not only saves energy by reducing the number of instructions referenced from the IC, but also saves space by reducing the number of instructions stored in memory, and can improve execution time by streamlining instruction fetch and improving the IC hit rate. Instruction packing allows a designer to tighten the encoding of an application’s frequent instructions in an application-independent manner. Two new SRAM structures are required to support this instruction fetch optimization. The first is an Instruction Register File (IRF) to hold common instructions as specified by the compiler. The second is an Immediate Table (IMM) containing the most common immediate values used by instructions in the IRF. The ISA is modified to support fetching multiple instructions from the IRF. By specifying multiple IRF instructions within a single 32-bit instruction fetched from the IC, we can reduce the number of instructions in the program (saving space), reduce references to the IC (saving power), and effectively fetch more instructions per cycle (improving execution time). The IRF can be integrated into the pipeline architecture at the start of instruction decode, since the decode stage is not typically part of the critical path. If this is not the case for a particular pipeline implementation, then the IRF can be modified to hold partially decoded instructions, and IRF access can be overlapped from the end of instruction fetch to the start of instruction decode, reducing cycle time impact. Figure 2.2 shows the integration of the IRF at the beginning of instruction decode. If the instruction fetched from the IC is a packed instruction, instruction index fields select which of the IRF instructions to fetch and pass along to the next pipeline stage. Note that although the diagram only shows a single port, the IRF can be constructed with enough read ports to accommodate the bandwidth of the processor pipeline.
This section describes the changes necessary for an ISA to support references to a 32- instruction register file. We chose the MIPS ISA, since it is commonly known and has a simple encoding [61]. Instructions stored in memory will be referred to as the Memory ISA or MISA. Instructions placed in registers will be referred to as the Register ISA or RISA.
8
IF Stage
Instruction PC Cache (ROM or L1)
IF/ID
First Half of ID Stage
IRF
IMM Figure 2.2: Instruction Register File
6 bits 5 bits 5 bits 5 bits 5 bits opcode inst1 inst2 inst3 inst
5 bits inst
params^ param Figure 2.3: Tightly Packed Format
Note that the MISA and RISA need not use exactly the same instruction formats, however this dissertation presents only minor modifications to the RISA to keep the processor design from becoming too complex. MISA instructions that reference the RISA are designated as being packed.
Figure 2.3 shows the newly added T-type format for tightly packed instructions. This format allows several RISA instructions to be accessed from a single MISA instruction. Since the IRF contains 32 entries, a tightly packed instruction can consist of up to five instructions from the IRF. One IRF entry is always reserved for nop. Tightly packed instructions can support fewer than five RISA instructions by padding with the appropriate number of nop references. Hardware support halts execution of the packed instruction when a nop is encountered so there is no performance degradation. Preliminary studies showed that I-type instructions account for 51.91% of static instruc- tions and 43.45% of dynamic instructions executed. Further examination of immediate values present in these instructions revealed that many common values are used in a variety
9