A Multiprocessor Self-reconfigurable JPEG2000 Encoder

Similar documents
A Pipelined Fast 2D-DCT Accelerator for FPGA-based SoCs

Politecnico di Milano

A Dual-Priority Real-Time Multiprocessor System on FPGA for Automotive Applications

An Interrupt Controller for FPGA-based Multiprocessors

Multi MicroBlaze System for Parallel Computing

A Hardware Task-Graph Scheduler for Reconfigurable Multi-tasking Systems

Politecnico di Milano

A Partitioning Flow for Accelerating Applications in Processor-FPGA Systems

AN OCM BASED SHARED MEMORY CONTROLLER FOR VIRTEX 4. Bas Breijer, Filipa Duarte, and Stephan Wong

Cost-and Power Optimized FPGA based System Integration: Methodologies and Integration of a Lo

FPGA: What? Why? Marco D. Santambrogio

Exploring Hardware Support For Scaling Irregular Applications on Multi-node Multi-core Architectures

Co-synthesis and Accelerator based Embedded System Design

ECE 448 Lecture 15. Overview of Embedded SoC Systems

A Low Power and High Speed MPSOC Architecture for Reconfigurable Application

Soft-Core Embedded Processor-Based Built-In Self- Test of FPGAs: A Case Study

A Novel Design Framework for the Design of Reconfigurable Systems based on NoCs

Supporting the Linux Operating System on the MOLEN Processor Prototype

FPGA. Agenda 11/05/2016. Scheduling tasks on Reconfigurable FPGA architectures. Definition. Overview. Characteristics of the CLB.

SyCERS: a SystemC design exploration framework for SoC reconfigurable architecture

Performance Tuning on the Blackfin Processor

ReconOS: Multithreaded Programming and Execution Models for Reconfigurable Hardware

Designing Embedded AXI Based Direct Memory Access System

A software platform to support dynamically reconfigurable Systems-on-Chip under the GNU/Linux operating system

Fast dynamic and partial reconfiguration Data Path

Mapping real-life applications on run-time reconfigurable NoC-based MPSoC on FPGA. Singh, A.K.; Kumar, A.; Srikanthan, Th.; Ha, Y.

Leso Martin, Musil Tomáš

EECS150 - Digital Design Lecture 13 - Accelerators. Recap and Outline

A Study of the Speedups and Competitiveness of FPGA Soft Processor Cores using Dynamic Hardware/Software Partitioning

ReconOS: An RTOS Supporting Hardware and Software Threads

A Device-Controlled Dynamic Configuration Framework Supporting Heterogeneous Resource Management

System-on-Chip Architecture for Mobile Applications. Sabyasachi Dey

ESE Back End 2.0. D. Gajski, S. Abdi. (with contributions from H. Cho, D. Shin, A. Gerstlauer)

Lecture 7: Introduction to Co-synthesis Algorithms

HIGH LEVEL SYNTHESIS OF A 2D-DWT SYSTEM ARCHITECTURE FOR JPEG 2000 USING FPGAs

Dynamic Partial Reconfiguration of FPGA for SEU Mitigation and Area Efficiency

The S6000 Family of Processors

Modeling and Simulation of System-on. Platorms. Politecnico di Milano. Donatella Sciuto. Piazza Leonardo da Vinci 32, 20131, Milano

An adaptive genetic algorithm for dynamically reconfigurable modules allocation

Embedded Systems. 7. System Components

A FPGA-based Soft Multiprocessor System for JPEG Compression

Applications to MPSoCs

RED: A Reconfigurable Datapath

A DYNAMICALLY RECONFIGURABLE PARALLEL PIXEL PROCESSING SYSTEM. Daniel Llamocca, Marios Pattichis, and Alonzo Vera

Scalable Memory Hierarchies for Embedded Manycore Systems

4. Hardware Platform: Real-Time Requirements

Karthik Narayanan, Santosh Madiraju EEL Embedded Systems Seminar 1/41 1

Supporting Multithreading in Configurable Soft Processor Cores

A Light Weight Network on Chip Architecture for Dynamically Reconfigurable Systems

System Architecture Directions for Networked Sensors[1]

SECURE PARTIAL RECONFIGURATION OF FPGAs. Amir S. Zeineddini Kris Gaj

FPGA based Design of Low Power Reconfigurable Router for Network on Chip (NoC)

USING C-TO-HARDWARE ACCELERATION IN FPGAS FOR WAVEFORM BASEBAND PROCESSING

An Adaptive Cryptographic and Embedded System Design with Hardware Virtualization

Keywords - DWT, Lifting Scheme, DWT Processor.

RUN-TIME PARTIAL RECONFIGURATION SPEED INVESTIGATION AND ARCHITECTURAL DESIGN SPACE EXPLORATION

Implementation of Lifting-Based Two Dimensional Discrete Wavelet Transform on FPGA Using Pipeline Architecture

Hardware Design. MicroBlaze 7.1. This material exempt per Department of Commerce license exception TSU Xilinx, Inc. All Rights Reserved

Programmable Memory Blocks Supporting Content-Addressable Memory

Shared Address Space I/O: A Novel I/O Approach for System-on-a-Chip Networking

Parameterized System Design

Portland State University ECE 588/688. Graphics Processors

Multiprocessor Systems. Chapter 8, 8.1

New System Solutions for Laser Printer Applications by Oreste Emanuele Zagano STMicroelectronics

PS2 VGA Peripheral Based Arithmetic Application Using Micro Blaze Processor

Interfacing Operating Systems and Polymorphic Computing Platforms based on the MOLEN Programming Paradigm

Rapid-Prototyping Emulation System using a SystemC Control System Environment and Reconfigurable Multimedia Hardware Development Platform

Creation of Partial FPGA Configurations at Run-Time

Linköping University Post Print. epuma: a novel embedded parallel DSP platform for predictable computing

A Dynamic Computing Platform for Image and Video Processing Applications

Five Ways to Build Flexibility into Industrial Applications with FPGAs

EC EMBEDDED AND REAL TIME SYSTEMS

A PORTABLE ABSTRACTION LAYER FOR HARDWARE THREADS. University of Paderborn, Germany {enno.luebbers,

Design of a Network Camera with an FPGA

QUKU: A Fast Run Time Reconfigurable Platform for Image Edge Detection

A Configurable Multi-Ported Register File Architecture for Soft Processor Cores

Accelerated Library Framework for Hybrid-x86

Improving Reconfiguration Speed for Dynamic Circuit Specialization using Placement Constraints

Multithreaded Coprocessor Interface for Dual-Core Multimedia SoC

RiceNIC. Prototyping Network Interfaces. Jeffrey Shafer Scott Rixner

Design of 2-D DWT VLSI Architecture for Image Processing

Hardware Implementation of TRaX Architecture

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University

Towards a Dynamically Reconfigurable System-on-Chip Platform for Video Signal Processing

ARM Processors for Embedded Applications

RUN-TIME RECONFIGURABLE IMPLEMENTATION OF DSP ALGORITHMS USING DISTRIBUTED ARITHMETIC. Zoltan Baruch

DESIGN AND IMPLEMENTATION OF 32-BIT CONTROLLER FOR INTERACTIVE INTERFACING WITH RECONFIGURABLE COMPUTING SYSTEMS

Processor Architectures At A Glance: M.I.T. Raw vs. UC Davis AsAP

Hardware Design. University of Pannonia Dept. Of Electrical Engineering and Information Systems. MicroBlaze v.8.10 / v.8.20

Implementation of Pipelined Architecture Based on the DCT and Quantization For JPEG Image Compression

RISPP: Rotating Instruction Set Processing Platform

Interfacing a High Speed Crypto Accelerator to an Embedded CPU

Module 11: I/O Systems

Using Industry Standards to Exploit the Advantages and Resolve the Challenges of Multicore Technology

Observability in Multiprocessor Real-Time Systems with Hardware/Software Co-Simulation

NEW APPROACHES TO HARDWARE ACCELERATION USING ULTRA LOW DENSITY FPGAs

All MSEE students are required to take the following two core courses: Linear systems Probability and Random Processes

MULTI-PROCESSOR SYSTEM-LEVEL SYNTHESIS FOR MULTIPLE APPLICATIONS ON PLATFORM FPGA

Reconfigurable Architecture Requirements for Co-Designed Virtual Machines

Hardware Accelerators

Transcription:

A Multiprocessor Self-reconfigurable JPEG2000 Encoder Antonino Tumeo 1 Simone Borgio 1 Davide Bosisio 1 Matteo Monchiero 2 Gianluca Palermo 1 Fabrizio Ferrandi 1 Donatella Sciuto 1 1 Politecnico di Milano - DEI 2 HP Labs Via Ponzio 34/5 1501 Page Mill Rd. 20133 Milano, Italy Palo Alto 94304 CA, USA Abstract This paper presents a multiprocessor architecture prototype on a Field Programmable Gate Arrays (FPGA) with support for hardware and software multithreading. Thanks to partial dynamic reconfiguration, this system can, at run time, spawn both software and hardware threads, sharing not only the general purpose soft-cores present in the architecture but also area on the FPGA. While on a standard single processor architecture the partial dynamic reconfiguration requires the processor to stop working to instantiate the hardware threads, the proposed solution hides most of the reconfiguration latency through the parallel execution of software threads. We validate our framework on a JPEG 2000 encoder, showing how threads are spawned, executed and joined independently of their hardware or software nature. We also show results confirming that, by using the proposed approach, we are able to hide the reconfiguration time. I. INTRODUCTION MultiProcessor Systems-on-Chip (MPSoCs) have emerged as the standard for embedded systems design. These architectures, composed of multiple homogeneous and heterogeneous processing units tightly interconnected with memory controllers and storage elements, offer the high performance required by today s multimedia and communication applications. Thanks to their flexibility, Field Programmable Gate Arrays (FPGAs) are now considered an important alternative to Application-specific Integrated Circuit (ASIC) designs for this class of systems [1], [2]. Nevertheless, if the relatively lower performance when compared to ASIC are tolerable thanks to the possibility to adapt the same initial system for several different target applications by designing custom accelerators, their area cost is still appreciable. Depending on the technology, several FPGA devices can be not only configurable, but they are also reconfigurable. Reconfiguring a FPGA consists of writing on the configuration memory of the device the bitstream which contains the information on how configurable logic blocks and switch matrices should be reprogrammed. Reconfiguration can be static (performed when the device is still inactive) or dynamic (performed when the FPGA is running), full (concerns all the FPGA) or partial (concerns just some portion of the device), external (when it is reprogrammed by another device) or internal (when the FPGA itself loads the new configuration). Dynamic-partial reconfiguration allows performing time-sharing of a portion of the area available on the FPGA by multiple hardware components, while the other parts continue to work. Specific hardware components can be instantiated on the reconfigurable area only when required, reducing the total area of the whole system. Furthermore, hardware components can be changed and updated during the lifetime of the system without interrupting its operations. In application specific systemson-chip, where these hardware components correspond to accelerators to which the operations of computation intensive routines are offloaded, the reconfiguration can be intended as the creation of a hardware thread. We define a hardware thread the part of a process performed by a hardware accelerator and composed by data loading, computation execution and data output. Data loading and output may be managed by a software processor supported by other hardware devices, or by mastering features of the accelerators themselves. Unfortunately, reconfiguration incurs in a latency, which corresponds to the time necessary to upload the new (partial) bistreams to the configurable logic blocks. Also, when the reconfiguration is internal, processing resources on the FPGA are required to read and write the bitstreams, severely limiting its benefits. Many previous works are focused around technology issues of dynamic reconfiguration. With this work we try to propose a different point of view, integrating the support for this technology in a multiprocessor environment and analyzing its behavior from the application and the architectural point of view. Our starting point is a multiprocessor prototyping platform developed on the FPGA itself, representative of nowadays MPSoCs. This platform can manage multiple software threads running concurrently on the MicroBlaze soft-core processors composing our multiprocessor architecture. We extend the platform to support the seamless management of

hardware accelerators, and thus hardware threads, along with the software threads. We also introduce the support for dynamic-partial-internal reconfiguration (a.k.a. selfreconfiguration) in the system, allowing the system to fork and join hardware threads, sharing a portion of the FPGA area. Through the use of the multiprocessor platform, we can hide the reconfiguration latency and enable the system to continue to work by using the available resources, even while it is reconfiguring itself. We validate and evaluate the platform with a typical application for embedded system, the JPEG2000 image compression algorithm, spawning multiple threads for the RGB-to-YUV color space conversion and the Two Dimensional Discrete Wavelet Transform (2D-DWT) both in software and hardware, alternating the hardware threads in the same area of the FPGA. The paper proceeds as follows. Section II introduces the Related Work, while Section III gives the basic notions to develop a self-reconfigurable architecture. Section IV presents our multiprocessor architecture and details how support for hardware threads and reconfiguration has been introduced. Section V presents our case study on the JPEG2000 image compression algorithm, showing how the application has been partitioned, and discusses the experimental evaluation. Finally, Section VI concludes the paper. II. RELATED WORK In recent years, many works about reconfigurable hardware systems have appeared. Most focus on technologies and design techniques to better support reconfiguration. Up to our knowledge, Xilinx is the only vendor supporting dynamic reconfigurability, from the point of view of the FPGAs devices and the implementation tools. ALTERA, at present times, does not support internal partial dynamic reconfiguration for reliability issues. Lysaght et al. [3] describe the enhancements to the latest Xilinx devices related to reconfiguration latencies, modular design and static/dynamic region interfaces. Some other papers propose techniques that address modular design for 1D and 2D reconfiguration [4] and on-demand partial reconfiguration approaches [5]. Several projects try to couple microprocessors with programmable elements. Hauser and Wawrzynek [6] propose Garp, an architecture that combines reconfigurable hardware with a standard MIPS processor on the same die. Hauck et al. [7] describe a system (Chimaera), in which the reconfigurable logic has direct access to the host processor s register file. Vassiliadis et al. [8] present MOLEN: a polymorphic processor paradigm, that allows the connection of run-time programmable units to the processor. Bauer et al. introduce RISPP [9], a rotating instruction set processing platform that allows resources sharing in a highly flexible scheme of compatible components. These approaches are focused towards extending the processor architecture with arbitrary configurable units through limited changes to the instruction set. Our approach is different, since our objective is not to propose a mechanism to augment the features of a single processor. Shimoo et al. [10] introduce the concept of hardware threads and describes several hardware mechanisms to manage them. Anderson et al. [11] focus instead on the hardware-software interface, proposing a unified programming model which adopts the same interface for specifying application threads running within a hybrid CPU/FPGA. Our work starts from these basis but adds the support to partial-dynamic-reconfiguration (area sharing among hardware cores) trying to address the problems posed by reconfiguration latency. Several methodologies to deal with the problems posed by application partitioning in software and hardware parts in a reconfigurable environment have been discussed. Banerjee et al. [12] present a HW/SW codesign framework for partial (external) dynamic reconfiguration, that consider configuration prefetch and minimization of reconfiguration latencies. Santambrogio et al. [13] propose a design methodology that takes in account overheads associated with reconfiguration and interfaces during the design exploration phase. Our work is orthogonal to these, and does not introduce an offline exploration method to hide the latencies but instead focuses on the runtime mechanisms used to distribute the workload to multiple processing elements that allow the system to do some useful work even when it is reconfiguring. The solutions presented in this paper may resemble some of our previous works. However, in [14] we limited our exploration on reconfiguration to single processor solutions, while in [15] we used the multiprocessor interrupt controller to support a real-time scheduling algorithm, without considering partial dynamic reconfiguration. III. IMPLEMENTING PARTIAL DYNAMIC RECONFIGURATION The standard hardware-software codesign flow starts with the profiling of the application. The performance profiles of the functions allow the designer to decide which routines could be implemented in hardware and what benefits there are in doing so. However, thanks to partial dynamic reconfiguration, it is not necessary to allocate area on the FPGA for all the functions selected. If the application benefits from multiple accelerators, but area constraints rise, when hardware modules are not used at the same time it is possible to reuse for them the same FPGA resources. If an application can be parallelized not only at the software, but also at the hardware level, several trade-offs among the number of the accelerators allocated and the number of software

threads executed can be found, depending on the performance requirements and the area limits. Implementing internal partial dynamic reconfiguration on FPGAs is not a fully automatic process yet. However, through the Early Access Partial Reconfiguration Flow [16], Xilinx now offers a more comprehensive support for its Virtex-II, 4 and 5 devices if compared to the previous module and difference based flows. To obtain a working self reconfigurable architecture, it is necessary to perform three steps: Initial Budgeting, Implementation and Assembly. The initial budgeting means to define the area constraints for each reconfigurable module in the design. This decision is highly application dependent, since if the two hardware components can share the same area, the size is determined by the biggest one. Furthermore, fixed communications paths (known as bus macros) between the static part of the design and the reconfigurable zones should be placed. The implementation is concerned with the separate placing and routing of the static part and of all the reconfigurable modules for all the available zones. Finally, during the last step, the static part and the reconfigurable components are assembled to form all the possible permutations of full bitstreams, while partial and blanking bitstreams are generated to allow self reconfiguration. The bigger the area for a reconfigurable zone is, the bigger the partial bitstreams are and the longer the reconfiguration time is. Self reconfiguration is obtained by sending the partial bitstreams to an internal port on the FPGA, the so called Internal Configuration Access Port (ICAP). Virtex 4 and 5 support 2D based reconfiguration, while Virtex-II reconfigures in a 1D fashion along a full column of Configurable Logic Blocks. However, 2D reconfiguration is obtained thanks to the glitch less nature of these devices: if reconfigured with exactly the same bits, the circuits continue to work unaltered. The only limitation for Virtex-II is that, transmitting entire groups of columns, the partial bitstreams are bigger and thus reconfiguration is slower. Consider also that, while the ICAP of the Virtex-4 has a 32 bit datapath, on Virtex-II it uses a 8 bit datapath. Finally, reconfiguration performances can be limited by the way the ICAP is reached. If the bitstreams are read from a slow memory, or if they are sent to the port through a bandwidth constrained bus, reconfiguration times cannot be minimized. Thus, even if the hardware accelerators are really fast, reconfiguration time can become a bottleneck for an area time-sharing paradigm, increasing too much the spawn time of the hardware threads and reducing the maximum speed-up. IV. ARCHITECTURE This section presents our base system, the software layer and the hardware support to manage the hardware threads. Fig. 1. A. Base System Overview of the architecture Figure 1 shows our base architecture. It is created with the Xilinx Embedded Developer Kit (EDK) 8.2 and composed by several MicroBlaze 5.00c soft-core processors. An architecture with three processors is shown in the figure, but the framework easily allows to use an arbitrary number of processors. Each processor is connected to a local memory through the specific Local Memory Bus (LMB) in which stack and heap of the threads are saved. The processing elements are interconnected through a shared bus, the On-chip Peripheral Bus (OPB) which is compliant with the IBM Core Connect standard. Instructions and shared data are allocated on the external, shared Double Data Rate (DDR) RAM. Instructions are cached on each processor, while data are moved in and out of the local memories for processing. This allows us to not implement data caches, which would require a substantial and expensive re-design of the system, since the MicroBlaze cores do not support cache coherency. Connected to the shared OPB we find the SysAce controller, that allows reading and saving of files and bitstreams from a Compact Flash card, the reconfigurable area in which the hardware cores can be allocated and the multiprocessor interrupt controller which, in combination with the software layer, allows the management of the reconfigurable cores. Also connected to the OPB there is the wrapper for the Internal Configuration Access Port (ICAP) through which the processors can send the partial bitstreams that reconfigure the allowed area. The Microprocessor Debug Module (MDM), the timer peripheral, and the UART controller for the Serial port are also connected to the shared bus, but they are not shown in the figure for clarity since they are exclusively used to debug and profile the system and not for operative purposes. Each MicroBlaze processor is connected, through two Fast Simplex Link (FSL) master/slave ports, to a synchronization module (Synchronization Engine), which introduces hardware support for mutual exclusion and barriers, and to a communication module (Cross Bar) which allows point-to-point communication among the processors for small data, reducing the traffic on

the shared bus. MicroBlaze supports bus locking mechanisms through a specific instruction, but we prefer to adopt a dedicated hardware module which makes synchronization faster and does not interfere with other memory operations. B. Software Layer On top of this architecture we developed a thin software layer which allows to dynamically schedule and launch threads on its processing elements. This light kernel implements a fork/join, run-to-completion thread model similar to OpenMP. When the developer wants to spawn a thread, he or she calls a specific software primitives that performs the thread creation. The kernel checks the free processors table and, if there is any, it directly sends the address of the new thread to the first processor in the list through the Cross Bar module. If no processors are free, the new thread is added to the ready thread table. When a processor ends its current thread, it looks the ready threads table, and if there are any, it starts the first available. If not, it adds itself to the free processors table and sets itself in blocking receive on the Cross Bar module port. Thread data structures are synchronized through the Synchronization Engine, while joins use the hardware barrier mechanisms. C. Support for hardware threads Support for hardware threads is implemented leveraging a purposely developed multiprocessor interrupt controller [17]. This component forwards the interrupt signals from hardware components and peripherals to all the processors in the system. When an accelerator ends its computation, it triggers an interrupt which allows a general purpose core to fetch its results from the registers. The multiprocessor interrupt controller distributes this interrupt to a processor which is not executing other interrupt handlers, allowing faster response times. The controller also supports a booking mechanism which allows the programmer to tie interrupt signals only to a specific processor, so to make sure that only a dedicated processing element answers to such interrupts. Furthermore, it permits to multicast the same interrupt signal to multiple processors or to broadcast to all the processors in the architecture. Last, but not least, it can be used to easily generate interprocessor interrupts for synchronization purposes. Thanks to the multiprocessor interrupt controller, several mechanisms to interact with hardware units are possible. A hardware unit can implement the same functionality of a software thread, thus it can be considered as a hardware instance of that thread, or it can implement a task which is more efficient in hardware and has not a software instance. Loading the data and starting the hardware unit can be considered as spawning the thread, while the join coincides with the generation of the interrupt signaling the end of the computation and triggering the readback of the results. The interrupt controller allows the system to simply offload all the computation of a thread to the hardware cores, if they are really fast, taking care of all the synchronization, or it can start the hardware threads as parallel tasks to software threads at fork points, permitting then the management of the readback of the results to any of the processors. The readback of the results is distributed to processors which are not managing other interrupt handlers with a timeout mechanisms. When an interrupt is generated, it is forwarded to a processor following a priority rule. If the acknowledgment of the launch of the interrupt service routine does not arrive before a pre-determined deadline, the signal is then forwarded to the next processor. With the booking mechanism, instead, a hardware thread can be tied to a specific processor and consequently to the software thread the processor is executing. This allows a behavior similar to a functional offload mechanism, where a child hardware thread that manages a part of the task is spawned and its join is executed through the results readback before its father software thread ends. Our thin kernel layer hides the syntax of the data passing mechanisms required to start the hardware computation and takes care of the interrupt handling for data readback, virtualizing the creation of threads independently of their hardware or software implementations. D. Integrating FPGA area time-sharing Without support for partial dynamic reconfiguration, only hardware threads within the area budget of the FPGA can be executed. Figure 2-A, shows how our architecture can manage the threading with a single hardware core. At design time, the developer of the system establishes which are the preferred functions to offload to hardware by profiling the target applications and then instances the modules in the architecture. However, if only a module fits within the area constraints, and more threads would benefit from hardware execution, a choice should be made. Partial dynamic reconfiguration removes this limit. Reconfiguring the FPGA allows multiple hardware modules to share the same area. At run time, without shutting itself off, the system can reconfigure a pre-determined area with the required functions. Partial dynamic reconfiguration, however, requires the execution of a specific function that sends the partial bitstream implementing the hardware function to the internal reconfiguration port (ICAP). This function not only requires to access the ICAP, but also ties a processor to move the bitstreams from a memory to the internal reconfiguration port, as shown in Figure 2-B. So, even if after reconfiguration a hardware thread can work in parallel with a software thread, on a single processor architecture reconfiguration time is lost. Depending on the size of the reconfigured area and on

the location of the bitstreams (local memories, shared memories, compact flash memories), the time required to execute this task can be very long, penalizing the global performance of the whole system. To reduce it, it is common to cache the files from mass supports to faster memories, at system boot time. It is difficult to implement pseudo-dma mechanisms to download the bitstreams: the ICAP, in fact, has a memory buffer of 4 KB which is alternatively filled in chunks of 2 KB. When a block of 2 KB is ready, the FPGA is reconfigured with it. The standard Xilinx wrapper for letting Core Connect compliant devices access the reconfiguration port has no bus mastering features or connections with the DMA controllers. It is possible to extend it, but it would require a substantial redesign, since handshaking mechanisms to correctly manage the flow would be necessary. Nevertheless, leveraging our multiprocessor architecture, the reconfiguration latency can be hidden with the parallel execution of software tasks, as Figure 2-C, shows. When the reconfiguration is required, a thread is generated to execute it. A processor thus performs the reconfiguration, while the others can start working on software instances of that thread or proceed with the application executing other parallel threads, covering the reconfiguration latency. At the end of the reconfiguration, the hardware thread can be started and the processor driving the reconfiguration can start in parallel another software thread. The net result is that the overall execution is faster since it can leverage both the software and the hardware threads, the same FPGA area can be exploited by different hardware threads and the reconfiguration latency can be completely hidden with the execution of software threads. V. CASE STUDY: THE JPEG 2000 In this section the case study on which our framework has been verified and benchmarked will be presented. The application chosen for benchmarking is the JPEG2000 image compression standard algorithm [18]. The JPEG2000 is commonly used as a reference benchmark for multiprocessor systems [19] and for multiprocessor implementations on FPGA [20]. It is an evolution of the previous JPEG standard, in which the main compression phase is performed through a Discrete Wavelet Transform (DWT) instead of the Discrete Cosine Transform (DCT). The DWT allows to obtain higher quality at the same compression factor. A. Application Partitioning and Mapping Our JPEG2000 compression algorithm is composed of several phases. After the reading of the original image (for our application, a PPM file), there is a preprocessing phase during which the image is subdivided in equally dimensioned tiles. Each tile is then converted from the RGB to the YUV color space. Then the Y = ((66 R + 129 G + 25 B + 128) >> 8) + 16 U = (( 38 R 74 G + 112 B + 128) >> 8) + 128 V = ((112 R 94 G 18 B + 128) >> 8) + 128 Fig. 3. The 8 bit math fixed point approximation used for the RGB to YUV color space conversion two dimensional Discrete Wavelet Transform (2D-DWT) can be applied. The transformed data are quantized, and encoded through the Embedded Block Coding with Optimal Truncation (EBCOT). The last two steps are known as post-processing phases: they manipulate data to reach the desired bitrate (Rate Control) and organize them by relevance (Bitstream Organization). The result is finally encapsulated in a JP2 file and saved. The application running on our system is partitioned following this organization in phases. After image reading, performed by a single software thread, the starting image is saved to the shared memory. We tile the image in 4x4 pixels block, where each pixel is a 24 bits value composed of three 8 bits color components. Parallel threads to perform the color space conversion, following the 8 bit math fixed point approximation reported in Figure 3, are spawned. A hardware core that executes the RGB to YUV space conversion has been implemented. The core features input and output queues of 16 pixels each. In these queues, the starting Red, Green and Blue component values for a tile of the image and the resulting Y, U, V values after conversion are respectively stored. A group of 9 multipliers, 3 shifters and 12 adders/subtractors then executes the conversion for a single pixel. When all the 16 pixels of a block have been processed, an interrupt is generated for data readback. We integrated an OPB compliant interface to connect this core to our architecture and thus to support a hardware thread to which we can delegate some of the color conversion workload. After joining the RGB to YUV conversion threads, the 2D-DWT threads are spawned. The 2D-DWT decomposes the samples from each component of the YUV color space of the image into its high and low sub-bands. To perform JPEG2000 compression, several formulations can be used for the 2D-DWT. We implemented the 5/3 reversible integer to integer 2D-DWT. Also for this phase, we developed a hardware component to allow the spawning of a hardware thread if required. Like the software implementation, the hardware component performs the decomposition on a square matrix of 16 samples in three stages. The first stage (VER SD) filters each column of the input matrix, the second (HOR SD) applies the same filtering on the rows obtained from the resulting matrix of the previous stage. Finally, the 2D DEINTERLIVE stage organizes the samples in four groups of sub-bands coefficients (LL, HL, LH and HH). The odd coefficients of the output signal (Y) are com-

Fig. 2. Software and hardware thread synchronization. A) shows our multiprocessor architecture without reconfiguration. A) shows a single processor architecture with reconfiguration. Finally C) illustrates our methodology with support for FPGA reconfiguration and multithreading. Fig. 4. ONED component puted from the even samples of the input signal (X) as follows: X(0) + X(2) Y (1) = X(1) 2 X(2) + X(2) Y (3) = X(3) 2 The even coefficients of the output signal are computed from the even values of the input signal (X) and the resulting odd coefficients: Y (1) + Y (1) + 2 Y (0) = X(0) + 4 Y (1) + Y (3) + 2 Y (2) = X(2) + 4 The VER SD and the HOR SD blocks are formed by four components (ONED) that perform the one - dimensional Wavelet Transform. Each ONED component, as shown in Figure 4, is composed of two ODDY blocks that calculate the odd coefficients of the transformed signal and two EVENY blocks that calculate the even coefficients of the output signal. A 2D-DWT is executed for each color component of a tile. Thus, sixteen 8 bits values are taken in input and sixteen 16 bits values (since the transform involves the amplification of the range) are generated in output. The whole hardware component is interfaced to the OPB and generates an interrupt when the results are ready for readback, so our interrupt controller and our kernel layer can take care of the hardware thread management. After joining the software and the hardware threads of the 2D-DWT, quantization, tier 1 coding and tier 2 coding (EBCOT), with the ordering of the packets in layer-resolution-component-position, take place in a single thread. As packets are ordered, they are encapsulated and saved on the compact flash card in the JP2 file format, and this is why this phase is sequential. Reconfiguration is inserted when spawning the RGB to YUV parallel threads and the 2D-DWT threads. At the fork points, in a three processor architecture, two parallel threads performing the software routines are created along with a reconfiguration thread that runs on the third processor. At the end of the reconfiguration, while the two other software threads continue their work, the third software thread and the hardware thread on the reconfigured hardware component are started. In the experimental results we show several different execution models. We firstly show execution performed with 4 software threads. We then benchmark an architecture with three processors and both the RGB to YUV and the 2D-DWT hardware accelerator installed. In this way, we substitute a software thread with a hardware thread. The workload is balanced to exploit the hardware modules, which are faster than the software implementations. The third and fourth sets of benchmark are performed inserting dynamic reconfiguration. With this solution, the same area is alternatively used by the two hardware accelerators when requested. In the third group, the reconfiguration is performed before spawning all the threads. In the fourth group, instead, the reconfiguration

Fig. 5. The execution delays of the RGB to YUV color space conversion on our architecture, varying the size of the image. Delays are normalized to the performance of a 3-MicroBlaze architecture is launched in parallel with the spawning of the software threads and, at the end of the reconfiguration, the hardware thread is executed. B. Experimental Evaluation The architecture has been implemented on a Virtex-II PRO XC2VP30 FF896 Speed Grade -7 FPGA, targeting a frequency of 50 MHz. Even if Virtex-II can reach higher frequencies, the architecture is quite big and thus not cannot be easily routed by the tools to guarantee better timings. Our analysis concentrates on the two phases of the JPEG2000 for which we have parallel execution and the hardware implementation of the accelerators. If before the creation of a hardware thread, phases not involving all the processors are executed, it is possible to anticipate the launch of the reconfiguration. This is like performing prefetch of the hardware thread, preconfiguring the FPGA before the actual spawning of the thread. In our analysis, however, we want to underline the concept of reconfiguration as the spawning of a hardware thread. Thus, even if image reading is purely sequential, reconfiguration of the RGB to YUV core is performed when the forking of all the RGB to YUV threads happens. Figure 5 and Figure 6 show the execution delays of the RGB to YUV and the DWT parallel phases respectively. The values are normalized to the execution times of 3 software threads on a 3 processors architecture. The first column for each image size shows the performance of a pure software architecture with 4 MicroBlaze processors and 4 threads running. It is easy to see that the system scale adequately, being almost 25% faster than the 3 threads solution, with both the two routines. With smaller images, which mean less contention on the shared memory, the system scales better. Substituting a software thread with a hardware thread, and re-balancing the workload assigned to the different processing elements to cope with the higher performance of the hardware accelerator, it is possible to notice a speed up over the full software 4 processors solution. Re-balancing the workload means to distribute more 4x4 tiles to the hardware thread than to the software ones. We assign the same number of tiles to all the software threads, even if further optimizations could be obtained taking in consideration the fact that one processor must also manage the overheads of data loading and readback for the hardware accelerator. The RGB to YUV has the most benefits from the inclusion of a hardware thread, reducing execution times up to the 15%, while the 2D-DWT remains around 7% better. This is due to the fact that the hardware RGB to YUV is almost 2 times faster than the software implementation, while the hardware 2D-DWT gives slightly less than 1.5 times the performance offered by the software transform. The introduction of reconfiguration slightly changes the scenario. Reconfiguring the area assigned to the hardware accelerators means transferring to the internal reconfiguration port around 270 KB of data, which takes 700.000 clock cycles. With small images, reconfiguration has almost the same execution delay of the complete execution of the parallel RGB2YUV on a 4 processor architecture. Supporting it serially means to stop the system, and lose all the speed ups obtained with the use of 4 threads. With bigger images, instead, this latency becomes too little to be noticed. Parallel execution of reconfiguration, plus a little re-balancing of the workload to cover for the later availability of the hardware thread, allows again to obtain a speed up with respect to the 3 processor solution with the smallest image. Performance starts to be competitive with the static solution with smaller images. With the 128 x 128 pixel image, in particular, the 3% overhead of the serial reconfiguration, is reduced to only 1% with parallel execution. With the 256 x 256 image, if for serial reconfiguration there is still an overhead of 1% on the overall execution, parallel reconfiguration definitely hides it. Advantages given in terms of area occupation by reconfiguration should also be taken in account: if using two separated RGB to YUV and 2D-DWT accelerators takes around 1800 slices (a slice, on the Virtex-II PRO, is made by two 4-inputs look up tables and two flip flops) of the reconfigurable device, 1100 for the 2D-DWT and 700 for the RGB to YUV, sharing the same area reduces the occupation to only the size of the bigger hardware core. Thus, the area allocated for hardware accelerators is 40% less, and 5% more area is available on the FPGA (which has 13500 slices in total) for other components. This is particularly interesting if we consider that a single MicroBlaze v5.0, without any special feature configured, occupies almost that space.

Fig. 6. The execution delays of the 2D-DWT on our architecture, varying the size of the image. Delays are normalized to the performance of a 3-MicroBlaze architecture VI. CONCLUSIONS This paper presented a reconfigurable multiprocessor prototype architecture on FPGA. This solution allows the seamless creation of hardware and software threads through specific components and a carefully organized software support. Thanks to the possibility offered by partial, dynamic internal reconfiguration, this architecture can use the same portion of the reconfigurable device to instance, in different times, different hardware accelerators. This allows to bring higher performance to more parts of the application, without increasing the area of the architecture. Furthermore, the multithreaded nature of the architecture allows, through careful load balacing, the execution of self-reconfiguration while processing other software threads, hiding the time and resource overheads. The architecture has been tested and validated with a case study on a standard multimedia benchmark, the JPEG 2000, proving its functionality and providing interesting speed ups. REFERENCES [1] F. Vahid, The softening of hardware, Computer, vol. 36, no. 4, pp. 27 34, 2003. [2] K. Compton and S. Hauck, Reconfigurable computing: a survey of systems and software, ACM Comput. Surv., vol. 34, no. 2, pp. 171 210, 2002. [3] P. Lysaght, B. Blodget, J. Mason, J. Young, and B. Bridgford, Invited paper: Enhanced architectures, design methodologies and CAD tools for dynamic reconfiguration of xilinx FPGAs, in FPL 06: International Conference on Field Programmable Logic and Applications, Madrid,, Aug. 2006, pp. 1 6. [4] P. Sedcole, B. Blodget, J. Anderson, P. Lysaght, and T. Becker, Modular partial reconfigurable in Virtex FPGAs, in FPL 05: International Conference on Field Programmable Logic and Applications, 2005, pp. 211 216. [5] M. Hubner, C. Schuck, M. Kuhnle, and J. Becker, New 2- dimensional partial dynamic reconfiguration techniques for realtime adaptive microelectronic circuits, in ISVLSI 06: Annual Symposium on Emerging VLSI Technologies and Architectures, 2006, p. 97. [6] J. R. Hauser and J. Wawrzynek, Garp: a MIPS processor with a reconfigurable coprocessor, in FCCM 97: 5th Annual IEEE Symposium on FPGAs for Custom Computing Machines., Napa Valley, CA, USA, Apr. 1997, pp. 12 21. [7] S. Hauck, T. W. Fry, M. M. Hosler, and J. P. Kao, The chimaera reconfigurable functional unit, in FCCM 97: 5th IEEE Symposium on FPGA-Based Custom Computing Machines, 1997, p. 87. [8] S. Vassiliadis, S. Wong, G. Gaydadjiev, K. Bertels, G. Kuzmanov, and E. Panainte, The MOLEN polymorphic processor, IEEE Transactions on Computers, vol. 53, no. 11, pp. 1363 1375, Nov. 2004. [9] L. Bauer, M. Shafique, S. Kramer, and J. Henkel, Rispp: rotating instruction set processing platform, in DAC 07: Proceedings of the 44th annual conference on Design automation. New York, NY, USA: ACM, 2007, pp. 791 796. [10] K. Shimoo, A. Yamawaki, and M. Iwane, A new parallel processing paradigm using a reconfigurable computing system, in ISCIT 2004: IEEE International Symposium on Communications and Information Technology, vol. 2, Oct. 2004, pp. 797 800. [11] E. Anderson, J. Agron, W. Peck, J. Stevens, F. Baijot, E. Komp, R. Sass, and D. Andrews, Enabling a uniform programming model across the software/hardware boundary, in FCCM 06: 14th Annual IEEE Symposium on Field-Programmable Custom Computing Machines, Napa, CA,, Apr. 2006, pp. 89 98. [12] S. Banerjee, E. Bozorgzadeh, and N. D. Dutt, Integrating physical constraints in hw-sw partitioning for architectures with partial dynamic reconfiguration, IEEE Transactions on Very Large Scale Integration (VLSI) Systems, vol. 14, no. 11, pp. 1189 1202, 2006. [13] M. D. Santambrogio, V. Rana, S. O. Memik, U. A. Acar, and D. Sciuto, A novel soc design methodology combining adaptive software and reconfigurable hardware, in ICCAD 2007: IEEE/ACM International Conference on Computer-Aided Design, San Jose, CA, USA, Nov. 2007, pp. 303 308. [14] A. Tumeo, M. Monchiero, G. Palermo, F. Ferrandi, and D. Sciuto, A Self Reconfigurable Implementation of the JPEG Encoder, in ASAP 07: 18th International Conference on Application-specific Systems, Architectures and Processors, 2007, pp. 24 29. [15] A. Tumeo, M. Branca, L. Camerini, M. Ceriani, M. Monchiero, G. Palemo, F. Ferrandi, and D. Sciuto, A Dual-Priority Real- Time Multiprocessor System on FPGA for Automotive Applications, in DATE 2008: Design, Automation and Test in Europe, March 10-14 2008, pp. 1039 1044. [16] Xlinx. Early access partial reconfiguration guide. UG208. Xilinx, 2006. [17] A. Tumeo, M. Branca, L. Camerini, M. Monchiero, G. Palermo, F. Ferrandi, and D. Sciuto, An interrupt controller for fpgabased multiprocessors, in IC-SAMOS 2007: International Conference on Embedded Computer Systems: Architectures, Modeling and Simulation, 2007, pp. 82 87. [18] ISO/IEC 15444-1:2004 Information technology JPEG 2000 image coding system: Core coding system. [19] P. Meerwald, R. Norcen, and A. Uhl, Parallel JPEG2000 image coding on multiprocessors, in IPDPS 2002: International Parallel and Distributed Processing Symposium., Ft. Lauderdale, FL, 2002, pp. 2 7. [20] P. James-Roxby, P. Schumacher, and C. Ross, A single program multiple data parallel processing platform for fpgas, in FCCM 04: 12th Annual IEEE Symposium on Field-Programmable Custom Computing Machines, 2004, pp. 302 303.