LEAP Scratchpads: Automatic Memory and Cache Management for Reconfigurable Logic [Extended Version] Michael Adler, Kermin E

LEAP Scratchpads: Automatic Memory and Cache Management for Reconfigurable Logic [Extended Version] Michael Adler, Kermin E

Computer Science and Artificial Intelligence Laboratory Technical Report MIT-CSAIL-TR-2010-054 November 23, 2010 LEAP Scratchpads: Automatic Memory and Cache Management for Reconfigurable Logic [Extended Version] Michael Adler, Kermin E. Fleming, Angshuman Parashar, Michael Pellauer, and Joel Emer massachusetts institute of technology, cambridge, ma 02139 usa — www.csail.mit.edu LEAP Scratchpads: Automatic Memory and Cache Management for Reconfigurable Logic [Extended Version] ‡ Michael Adler† Kermin E. Fleming¶ Angshuman Parashar† Michael Pellauer¶ Joel Emer†¶ †Intel Corporation ¶Massachusetts Institute of Technology VSSAD Group Computer Science and A.I. Laboratory {michael.adler, angshuman.parashar, Computation Structures Group joel.emer}@intel.com {kfleming, pellauer, emer}@csail.mit.edu ABSTRACT 1. INTRODUCTION Developers accelerating applications on FPGAs or other re- FPGAs are increasingly employed as coprocessors along- configurable logic have nothing but raw memory devices side general purpose CPUs. The combination of large memory in their standard toolkits. Each project typically includes and ease of programming a general purpose machine along tedious development of single-use memory management. Soft- with the abundant parallelism and low communication latency ware developers expect a programming environment to in- in an FPGA make the pair attractive for hybrid algorithms clude automatic memory management. Virtual memory pro- that split computation across both engines. vides the illusion of very large arrays and processor caches Memory management in software development is supported reduce access latency without explicit programmer instruc- by a rich set of OS and library features. Describing overlays tions. [6, 16], a method of swapping regions of code or data to fit in LEAP scratchpads for reconfigurable logic dynamically limited physical memory, elicits pitying chuckles from even allocate and manage multiple, independent, memory arrays well-educated computer scientists who began their careers in a large backing store. Scratchpad accesses are cached au- after virtual memory became pervasive. Software design- tomatically in multiple levels, ranging from shared on-board, ers targeting general purpose hardware long ago accepted RAM-based, set-associative caches to private caches stored that the gain in programmer efficiency from using compilers, in FPGA RAM blocks. In the LEAP framework, scratch- support libraries and operating systems outweighs possible pads share the same interface as on-die RAM blocks and performance gains of hand-coding raw instructions. are plug-in replacements. Additional libraries support heap The memory subsystem in general purpose hardware offers management within a storage set. Like software developers, a hierarchy of storage, ranging from fast but small caches accelerator authors using scratchpads may focus more on embedded in the processor to large external RAM arrays on core algorithms and less on memory management. memory buses, and to swap files on disks. Management of Two uses of FPGA scratchpads are analyzed: buffer man- cache state is controlled by fixed hardware algorithms chosen agement in an H.264 decoder and memory management for their overall performance. Explicit, hand-tuned cache within a processor microarchitecture timing model. management instructions are typically added only to the most performance-sensitive programs. Tremendous effort has been spent building compilers capable of automatic cache- Categories and Subject Descriptors management, e.g. [12, 13]. As general purpose processors C.5.m [Computer System Implementation]: Miscella- add more parallel processing, language designers continue to neous add abstract memory management to design tools in order to split algorithmic design from the grunt work of memory management [3]. General Terms The gap between the programming environment on the general purpose half and the reconfigurable half of a hybrid Algorithms, Performance machine is stark. Most FPGA developers still code in low level languages equivalent to assembly language on general purpose machines. Those optimizing a set of loop kernels Keywords may use C or Java-like languages [8, 10, 11, 14] and a handful FPGA, memory management, caches are beginning to use languages such as Bluespec [2, 19] that support language-based static elaboration and polymorphic module definitions. The state of memory management on reconfigurable logic is similarly primitive. FPGA synthesis tools support relatively easy management of on-die memory arrays. The interface to on-die RAM blocks is simple: a method for writing a value to an address and a two-phase pair of read request and response methods. This interface may be made timing insensitive by ‡This is an extended version of a paper presented at FPGA 2011: Proceed- ings of the 19th Annual ACM/SIGDA International Symposium on Field predicating the methods with ready and enable flags and Programmable Gate Arrays (ISFPGA). buffering state on pipeline stalls [5]. to make programming an FPGA more like software develop- ment on general purpose hardware. Programmers target an 1.1 Scratchpad memory hierarchies abstract set of virtual services similar to general purpose ker- nel and user-space libraries. Like general purpose hardware, What if an algorithm needs more memory than is available programmers may get an algorithm working with generic on-die? At best, designers are offered low-level device drivers code and then, optionally, tune their application for specific for embedded memory controllers, PCIe DMA controllers or hardware latencies and sizes. some other bus. Building an FPGA-side memory hierarchy is treated as an application-specific problem. Even methods for 1.2 Related work mapping memory management as basic as malloc and free to Many researchers have considered the problem of cache on-die RAM for C-like synthesis languages are a very recent hierarchies in reconfigurable logic and embedded systems. innovation [22]. On general purpose hardware the memory Automatic generators build a variety of cache types and sizes, hierarchy is invisible to an application, except for timing. treating caches as building blocks [25]. Panda et al. pre- A similar memory abstraction, identical to the interface to sented an algoritm for computing application-specific cache on-die RAM blocks but implementing a full storage hierarchy, hierarchies designed to minimize off-chip references [15]. is equally useful for a range of FPGA-based applications. CoRAM, a current research effort, is an investigation of Our project began as an effort to accelerate processor application interfaces to memory hierarchies within reconfig- microarchitecture timing models using FPGAs. We quickly urable logic [4]. CoRAM defines both a memory API and a realized that some effort writing a general programming control thread model for managing traffic between on-die and framework would make our task more tractable. The resulting off-die memory. The CoRAM model could be implemented platform is in active use for timing models and has been within the LEAP framework. LEAP scratchpads are a struc- adopted for other algorithmic accelerators, such as an H.264 tured, hierarchical cache topology connected to applications decoder. Both of these applications are considered in this through a relatively simple interface. In LEAP, the specific paper. hierarchy instantiated is configurable from building blocks We have written LEAP (Logic-based Environment for Ap- of both direct mapped and set associative caches. Clients plication Programming) [17], a platform for application de- may either accept the default private caches or may plug in velopment on reconfigurable logic. LEAP runs on any set of their own, taking advantage of the sorts of access pattern reconfigurable logic connected to general purpose machines. optimizations considered in [15]. A CoRAM implementation Like an operating system, LEAP is layered on top of device- within LEAP would replace the default, private, on-die cache specific drivers. It presents a consistent virtual platform with a CoRAM memory and control thread. on any hardware. Application writers may then target the Other projects, such as hthreads [1], have also built hybrid virtual platform, rendering their code portable across com- computation frameworks. Hthreads offers a hybrid pthreads- munication fabrics. LEAP presents the same interface over style thread management environment layered on coherent connections as diverse as FPGAs plugged directly into Intel memory. The automatic instantiation of cached memory hier- Front Side Bus sockets and FPGAs connected to a host over archies we describe for LEAP scratchpads could be inserted a JTAG cable. The virtual platform provides a rich set of into an hthreads stack as well. services, including streaming I/O devices, application control primitives, and an asynchronous hybrid procedural interface similar to remote procedure calls [18]. The platform also 2. SCRATCHPAD ARCHITECTURE provides automatic instantiation of processor-like memory hi- erarchies, ranging from private caches, through shared caches 2.1 FPGA On-Die RAM Blocks and down to host memory. In this paper we focus on the On-die FPGA RAM blocks can be configured quite flexibly. automatically constructed memory stack. Xilinx RAM blocks are organized as 18Kb or 36Kb blocks LEAP defines a single, timing insensitive, interface to in data widths of 1, 2, 4, 9, 18 or 36 bits [24]. Altera RAM scratchpad memory hierarchies. The same write, read re- blocks have similar widths. Synthesis tools automatically

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    13 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us