Efficient Placement of Compressed Code for Parallel Decompression

Similar documents
MEMORY is one of the most constrained resources in an

An Efficient Code Compression Technique using Application-Aware Bitmask and Dictionary Selection Methods

MEMORY is one of the key driving factors in embeddedsystem

GOLOMB Compression Technique For FPGA Configuration

A Study on Algorithm for Compression and Decompression of Embedded Codes using Xilinx

Profile-driven Selective Code Compression

Reduction of Bitstream Transfer Time in FPGA

A Novel Decode-Aware Compression Technique for Improved Compression and Decompression

A Hybrid Code Compression Technique using Bitmask and Prefix Encoding with Enhanced Dictionary Selection

EMBEDDED systems have become more and more important

EMBEDDED computing systems are space and cost sensitive.

Instruction Cache Compression for Embedded Systems by Yujia Jin and Rong Chen

Design and Simulation of a Pipelined Decompression Architecture for Embedded Systems

Fast Software-managed Code Decompression

Compression of FPGA Bitstreams Using Improved RLE Algorithm

Reducing Code Size with Run-time Decompression

Evaluation of a High Performance Code Compression Method

International Journal of Engineering Trends and Technology (IJETT) Volume 18 Number2- Dec 2014

COMPRESSION OF FPGA BIT STREAMS USING EFFECTIVE RUN LENGTH ENCODING TECHIQUES AND ITS PERFORMANCE ESTIMATION

Fast Floating Point Compression on the Cell BE Processor

Code Compression for Low Power Embedded System Design

Compact Binaries with Code Compression in a Software Dynamic Translator

Compact Binaries with Code Compression in a Software Dynamic Translator

ENHANCED PARKWAY STUDY: PHASE 2 CONTINUOUS FLOW INTERSECTIONS. Final Report

Reducing Code Size with Run-time Decompression

An Architecture of Embedded Decompressor with Reconfigurability for Test Compression

AddressBus 32. D-cache. Main Memory. D- Engine CPU. DataBus 1. DataBus 2. I-cache

An Architecture for Combined Test Data Compression and Abort-on-Fail Test

Matrix-based software test data decompression for systems-on-a-chip

Decompression Method For Massive Compressed Files In Mobile Rich Media Applications

A Chiller Control Algorithm for Multiple Variablespeed Centrifugal Compressors

A Novel Gear-shifting Strategy Used on Smart Bicycles

The Implementation and Evaluation of Dynamic Code Decompression Using DISE

Arithmetic Coding Modification to Compress SMS

Author s Name Name of the Paper Session. Positioning Committee. Marine Technology Society. DYNAMIC POSITIONING CONFERENCE September 18-19, 2001

SUPPLEMENT MATERIALS

The system design must obey these constraints. The system is to have the minimum cost (capital plus operating) while meeting the constraints.

PEPSE Modeling of Triple Trains of Turbines Sending Extraction Steam to Triple Trains of Feedwater Heaters

Design-for-Testability for Path Delay Faults in Large Combinational Circuits Using Test-Points

Transitional Steps Zone in Steeply Sloping Stepped Spillways

A 64 Bit Pipeline Based Decimal Adder Using a New High Speed BCD Adder

Queue analysis for the toll station of the Öresund fixed link. Pontus Matstoms *

Lab 4: Root Locus Based Control Design

Code Compression for VLIW Processors Using Variable-to-fixed Coding

A SEMI-PRESSURE-DRIVEN APPROACH TO RELIABILITY ASSESSMENT OF WATER DISTRIBUTION NETWORKS

Data Extraction from Damage Compressed File for Computer Forensic Purposes

A Novel Approach to Predicting the Results of NBA Matches

CS 221 PROJECT FINAL

Software Design of the Stiquito Micro Robot

Quantifying the Bullwhip Effect of Multi-echelon System with Stochastic Dependent Lead Time

Post-Placement Functional Decomposition for FPGAs

Algorithm for Line Follower Robots to Follow Critical Paths with Minimum Number of Sensors

Energy Savings Through Compression in Embedded Java Environments

Evaluating and Preventing Capacity Loss when Designing Train Control to Enforce NFPA 130 Compliance

Chapter 5 5. INTERSECTIONS 5.1. INTRODUCTION

Lossless Comparison of Nested Software Decompositions

INTRODUCTION TO PATTERN RECOGNITION

Tokyo: Simulating Hyperpath-Based Vehicle Navigations and its Impact on Travel Time Reliability

Modeling of Hydraulic Hose Paths

Application of Bayesian Networks to Shopping Assistance

The Incremental Evolution of Gaits for Hexapod Robots

Integrating Best of Breed Outage Management Systems with Mobile Data Systems. Abstract

Operational Comparison of Transit Signal Priority Strategies

Satoshi Yoshida and Takuya Kida Graduate School of Information Science and Technology, Hokkaido University

Provably Secure Camouflaging Strategy for IC Protection

MoPac South: Impact on Cesar Chavez Street and the Downtown Network

Linear Compressor Suction Valve Optimization

PREDICTING THE ABILITY OF SURVIVAL AFTER DAMAGE IN TANKERS. José Poblet Martínez - SENER, (Spain) José Javier Díaz Yraola - SENER, (Spain)

Application of Computational Fluid Dynamics to Compressor Efficiency Improvement

Predicting Horse Racing Results with Machine Learning

The Future of Hydraulic Control in Water-Systems

A General, Flexible Approach to Certificate Revocation Dr. Carlisle Adams & Dr. Robert Zuccherato Entrust, Inc.

i) Linear programming

67. Sectional normalization and recognization on the PV-Diagram of reciprocating compressor

LOCOMOTION CONTROL CYCLES ADAPTED FOR DISABILITIES IN HEXAPOD ROBOTS

NCSS Statistical Software

A Hare-Lynx Simulation Model

Road Data Input System using Digital Map in Roadtraffic

Optimizing Cyclist Parking in a Closed System

An Analysis of Reducing Pedestrian-Walking-Speed Impacts on Intersection Traffic MOEs

Second Generation Bicycle Charging Station. Engineering Analysis

A Model for Tuna-Fishery Policy Analysis: Combining System Dynamics and Game Theory Approach

Product Decomposition in Supply Chain Planning

C. Mokkapati 1 A PRACTICAL RISK AND SAFETY ASSESSMENT METHODOLOGY FOR SAFETY- CRITICAL SYSTEMS

PIG MOTION AND DYNAMICS IN COMPLEX GAS NETWORKS. Dr Aidan O Donoghue, Pipeline Research Limited, Glasgow

AGA Swiss McMahon Pairing Protocol Standards

Implementing Mid Ranging in a DCS Environment

Analyzing WMDD on Parallel Machines. Harrisen Egly, Alyssa Estrada, Kelcie Gerson, Sarah Murray

Breaking Up is Hard to Do: An Investigation of Decomposition for Assume-Guarantee Reasoning

Figure 1 Figure 1 shows the involved forces that must be taken into consideration for rudder design. Among the most widely known profiles, the most su

OPTIMIZATION OF A WAVE CANCELLATION MULTIHULL SHIP USING CFD TOOLS

CHAPTER 1 INTRODUCTION TO RELIABILITY

At each type of conflict location, the risk is affected by certain parameters:

#19 MONITORING AND PREDICTING PEDESTRIAN BEHAVIOR USING TRAFFIC CAMERAS

Application Block Library Fan Control Optimization

EVOLVING HEXAPOD GAITS USING A CYCLIC GENETIC ALGORITHM

CONDUITS DST-Tel Aviv-Yafo Case Study

Evaluating the Influence of R3 Treatments on Fishing License Sales in Pennsylvania

Replay using Recomposition: Alignment-Based Conformance Checking in the Large

The Walkability Indicator. The Walkability Indicator: A Case Study of the City of Boulder, CO. College of Architecture and Planning

Transcription:

Efficient Placement of Compressed Code for Parallel Decompression Xiaoke Qin and Prabhat Mishra Department of Computer and Information Science and Engineering University of Florida, Gainesville FL 32611-6120, USA {xqin, prabhat}@ciseufledu Abstract Code compression is important in embedded systems design since it reduces the code size (memory requirement) and thereby improves overall area, power and performance Existing researches in this field have explored two directions: efficient compression with slow decompression, or fast decompression at the cost of compression efficiency This paper combines the advantages of both approaches by introducing a novel bitstream placement method The contribution of this paper is a novel code placement technique to enable parallel decompression without sacrificing the compression efficiency The proposed technique splits a single bitstream (instruction binary) fetched from memory into multiple bitstreams, which are then fed into different decoders As a result, multiple slow-decoders can work simultaneously to produce the effect of high decode bandwidth Our experimental results demonstrate that our approach can improve decode bandwidth up to four times with minor impact (less than 1%) on compression efficiency 1 Introduction Memory is one of the most constrained resources in an embedded system, because a larger memory implies increased area (cost) and higher power/energy requirements Due to dramatic complexity growth of embedded applications, it is necessary to use larger memories in today s embedded systems to store application binaries Code compression techniques address this problem by reducing the storage requirement of applications by compressing the application binaries The compressed binaries are loaded into the main memory, then decoded by a decompression hardware before it s execution in a processor Compression ratio is widely used as a metric of the efficiency of code compression It is defined as the ratio (CR) between the compressed program size (CS) and the original program size (OS) ie, CR = CS / OS Therefore, a smaller compression ratio implies a better compression technique There are two major challenges in code compression: i) how to compress the code as much as possible; and ii) how to efficiently decompress the code without affecting the processor performance The research in this area can be divided into two categories based on whether it primarily addresses the compression or decompression challenges The first category tries to improve code compression efficiency using the state-of-the-art coding methods such as Huffman coding [1] and arithmetic coding [2] Theoretically, they can decrease the compression ratio to its lower bound governed by the intrinsic entropy of code, although their decode bandwidth usually is limited to 6-8 bits per cycle These sophisticated methods are suitable when the decompression unit is placed between the main memory and cache (pre-cache) However, recent research [3] suggests that it is more profitable to place the decompression unit between the cache and the processor (post-cache) In this way the cache retains data still in a compressed form, increasing cache hits, therefore achieving potential performance gain Unfortunately, this post-cache decompression unit actually demands much more decode bandwidth than what the first category of techniques can offer This leads to the second category of research that focuses on higher decompression bandwidth by using relatively simple coding methods to ensure fast decoding However, the efficiency of the compression result is compromised The variable-to-fixed coding techniques [12] are suitable for parallel decompression but it sacrifices the compression efficiency due to fixed encoding In this paper, we combine the advantages of both approaches by developing a novel bitstream placement technique which enables parallel decompression without sacrificing the compression efficiency This paper makes two important contributions First, it is capable of increasing the decode bandwidth by using multiple decoders to work simultaneously to decode a single/adjacent instruction(s) Second, our methodology allows designers to use any existing compression algorithms including variable-length encodings with little or no impact on compression efficiency The rest of the paper is organized as follows Section 2 introduces related work addressing code compression for embedded systems Section 3 describes our code compression and bitstream placement methods Section 4 presents our experimental results Finally, Section 5 concludes the paper 2 Related Work A great deal of work has been done in the area of code compression for embedded systems The basic idea is to take one or more instruction as a symbol and use common coding methods to compress the code Wolfe and Chanin [1] first proposed the Huffman-coding based code compression approach A Line Address Table (LAT) is used to handle the addressing of branching within compressed code Lin et al [4] uses LZW-based code compression by applying it to variable-sized blocks of VLIW codes Liao [5] explored dictionary-based compression techniques Lekatsas et al [2] constructed SAMC using arithmetic coding based compression These approaches significantly re-

duces the code size but their decode (decompression) bandwidth is limited To speed up the decode process, Prakash et al [6] and Ros et al [7] improved conventional dictionary based techniques by considering bit changes of a 16-bit or 32-bit vectors Seong et al [8] further improved these approaches using bitmask based code compression These techniques enable fast decompression but they achieve inferior compression efficiency compared to those based on well established coding theory Instead of treating each instruction as a single symbol, some researchers observed that the number of different opcodes and operands are quite smaller than that of entire instructions Therefore, a division of a single instruction into different parts may lead to more effective compression Nam et al [9] and Lekatsas et al [10] broke instructions into several fields then employed different dictionary to encode them CodePack [11] divided each MIPS instruction at the center, applied two prefixdictionary to each of them, then combined the encoding results together to create the finial result However, in their compressed code, all these fields are simply stored one after another (in a serial fashion) The variable-to-fixed coding technique [12] is suitable for parallel decompression but it sacrifices the compression efficiency due to fixed encoding The variable size encodings (fixed-to-variable and variable-to-variable) can achieve the best possible compression However, it is impossible to use multiple decoders to decode each part of the same instruction simultaneously, when variable length coding is used The reason is that the beginning of next field is unknown until the decode of the current field ends As a result, the decode bandwidth cannot benefit very much from such an instruction division Our approach allows variable length encoding for efficient compression and proposes a novel placement of compressed code to enable parallel decompression 3 Efficient Placement of Compressed Binaries Our work is motivated by previous variable length coding approaches based on instruction partitioning [9, 10, 11] to enable parallel compression of the same instruction The only obstacle preventing us from decoding all fields of the same instruction simultaneously is that the beginning of each compressed field is unknown unless we decompress all previous fields 32bits } 32bits } A B A B (a) Uncompressed code (b) Compressed code Figure 1 Intuitive placement for parallel decompression One intuitive way to solve this problem, as shown in Figure 1, is to separate the entire code into two parts, compress each of them separately, then place them separately Using such a placement, the different parts of the same instruction can be decoded simultaneously using two pointers However, if one part of the code (part B) is more effectively compressed than the other one (part A), the remaining unused space for part B will be wasted Therefore, the overall compression ratio will be hampered remarkably Furthermore, the identification of branch targets will also be a problem due to the unequal compression As mentioned earlier, fixed length encoding methods are suitable for parallel decompression but it sacrifices the compression efficiency due to fixed encoding The focus of our research is to enable parallel decompression for binaries compressed with variable length encoding methods The basic idea of our approach to handle this problem is to develop an efficient bitstream placement method Our method enables the compression algorithm to make maximum usage of the space automatically At the same time, the decompression mechanism will be able to determine which part of the newly fetched 32 bits should be sent to which decoder In this way, we exploit the benefits of instruction division in both compression efficiency and decode bandwidth 31 Overview of Our Approach In our approach, we use branch blocks 1 [4] as the basic unit of compression In other words, our placement technique is applied to each branch blocks in the application Figure 2 shows the block diagram of our proposed compression framework It consists of four main stages: compression (encode), bitstream merge, bitstream split and decompression (decode) During compression (Figure 2a), we first break every input storage block (containing one or more instructions) into several fields, then apply specific encoders to each one of them The resultant compressed streams are combined together by a bitstream merge logic based on a carefully designed bitstream placement algorithm Note that the bitstream placement cannot rely on any information invisible to the decompression unit In other words, the bitstream merge logic should merge streams based on only the binary code itself and the intermediate results produced during the encoding process During decompression (Figure 2b), the scenario is exactly the opposite of compression Every word fetched from the cache is first split into several parts, each of which belongs to a compressed bitstream produced by some encoder Then the split logic dispatches them to the buffers of correct decoders, according to the bitstream placement algorithm These decoders decode each bitstream and generate the uncompressed instruction fields After combining these fields together, we obtain the final decompression result, which should be identical to the corresponding original input storage block (containing one or more instructions) From the viewpoint of overall performance, the compression algorithm affects the compression ratio and decompression speed in an obvious way Nevertheless, the bitstream placement actually governs whether multiple decoders are capable to work in parallel In previous works, researchers tend to use a very simple placement technique: they appended the compressed code for each symbol one after the other When variable length coding is used, symbols must be decoded in order In this paper, 1 The instructions between two consecutive branch targets

Uncompressed Binary Code Compressed Code from Cache Encoder 1 Bitstream Split Logic Decode Buffer Decoder 1 Input Buffer Encoder 2 Bitstream Merge Logic (a) Compression technique Decode Buffer Decoder 2 Output Buffer Encoder N Decode Buffer Decoder N (b) Decompression mechanism Figure 2 Proposed code compression framework we demonstrate how a novel bitstream placement enables parallel decoding and boosts the overall decode performance The remainder of this section describes the four important stages in our framework: compression, bitstream merge, bitstream split and decompression 32 Compression Algorithm In our current implementation, we use Huffman coding as the compression algorithm of each single encoder (Encoder 1 - Encoder N in Figure 2 (a)), because Huffman coding is optimal for a symbol-by-symbol coding with a known input probability distribution To improve its performance on code compression, we modify the basic Huffman coding method [1] in two ways: i) instruction division and ii) selective compression As mentioned earlier, any compression technique can be used in our framework Similar to previous works [9, 10, 11], we believe that compressing different parts of a single instruction separately is profitable, because the number of distinct opcodes and operands is far less than the number of different instructions We have observed that for most applications it is profitable to divide the instruction at the center In the rest of this paper, we will use this division pattern, if not stated otherwise Selective compression is a common choice in many compression techniques [8] Since the alphabet for binary code compression is usually very large, Huffman coding may produce many Compressed Code Decompressed Code to Processor dictionary entries with quite long keywords This is harmful to the overall compression ratio, because the size of the dictionary entry must also be taken into account Instead of using bounded Huffman coding, we address this problem using selective compression First, we create the conventional Huffman coding table Then we remove any entry e which does not satisfy Equation 1 (Length(Symbol e ) Length(Key e )) T ime e > Size e, (1) Here, Symbol e is the uncompressed symbol (one part of an instruction), Key e is the key of Symbol e created by Huffman coding, T ime e is the total time for which Symbol e occurs in the uncompressed code, and Size e is the space required to store this entry For example, two unprofitable entries from Dictionary II (Figure 3) are removed Original Program 00001110 00000100 10000000 10001110 10000000 Stream1 Compressed Program 0 1 1 1110 0 1 1 0100 0 0 0 0 0 0 1 1110 0 0 0 0 0 = compressed 1 = uncompressed Dictionary I Dictionary II Key Symbol Key Symbol 1 0000 0 0000 0 1000 10 0100 11 1110 Stream2 Figure 3 Code compression using modified Huffman coding Once the unprofitable entries are removed, we use remaining entries as the dictionary for both compression and decompression Figure 3 shows an illustrative example of our compression algorithm For the simplicity of illustration, we use 8-bit binaries instead of 32 bits used in real applications We divide each instruction in half and use two dictionaries, one for each part The final compressed program is reduced from 72 bits to 45 bits The dictionary requires 15 bits The compression ratio for this example is 833% The two compressed bitstreams (Stream1 and Stream2) are also shown in Figure 4 Stream1 Stream2 Symbol Value Symbol Value A 1 01 B 1 11110 A 2 01 B 2 10100 A 3 01 B 3 00 A 4 00 B 4 00 A 5 01 B 5 00 A 6 00 B 6 11110 A 7 01 B 7 00 A 8 01 B 8 00 A 9 00 B 9 00 Figure 4 Two compressed bitstreams from the code compression example in Figure 3 33 Bitstream Merge The bitstream merge logic merges multiple compressed bitstreams into a single bitstream for storage We first explain

Stream 1 Stream 2 A 1 A 2 A 9 B 1 B 2 B 9 A 3 A 4 A 9 B 1B 2 B 9 A 5 A 6 A 9 B 2B 3 B 9 A 5 A 6 A 9 B 6 B 7 B 8 B 9 A 9 B 6 B 7 B 8 B 9 A 9 B 8B 9 Step 1 Step 2 Step 6 Slot 1 (4bits) Slot 2 (4bits) A 1 (2bits) A 2 (2bits) B 1(4bits) A 3 (2bits) A 4(2bits) B 1 B 2 (3bits) B 2(2bits) B 3 (2bits) B 4 (2bits) B 5 (2bits) A 5 (2bits) A 6 (2bits) A 7(2bits) A 8 (2bits) B 6 (5bits) B 7 (2bits) B 8 A 9 (2bits) B 8 B 9 (2bits) Cycle 1 Cycle 2 Cycle 6 Decoder1 Decoder2 Input Buffer Len1 Decoding Input Buffer Len2 Decoding A 1 A 2 4 Null B 1 4 Null A 2 A 3 A 4 6 A 1 B 2 3 B 1 A 3 A 4 4 A 2 B 3 B 4 B 5 6 B 2 A 4 A 5 A 8 10 A 3 B 4 B 5 4 B 3 A 5 A 6 A 7 A 8 8 A 4 B 5 B 6 B 7B 8 10 B 4 A 6 A 7 A 8 A 9 8 A 5 B 6 B 7 B 8 B 9 11 B 5 A 7 A 8 A 9 6 A 6 B 7 B 8 B 9 6 B 6 A 8 A 9 4 A 7 B 8 B 9 4 B 7 A 9 2 A 8 B 9 2 B 8 (a) (b) (c) 0 A 9 0 B 9 Figure 5 Bitstream placement using two bitstreams in Figure 4 (a) Unplaced data remaining in the input buffer of merge logic, (b) Bitstream placement result, (c) Data within Decoder 1 and Decoder 2 when current storage block is decompressed 2 some basic models and terms which we will use in the following discussion Next, we describe the working principle of our bitstream merge logic Definition 1: Storage block is a block of memory space, which is used as the basic input and output unit of our merge and split logic Informally, a storage block contains one or more consecutive instructions in a branch block Figure 6 illustrates the structure of a storage block We divide it into several slots Each of them contains adjacent bits extracted from the same compressed bitstream In our current implementation, all slots within a storage block have the same size Slot 1 Slot 2 Slot N Figure 6 Storage block structure Definition 2: Sufficient decode length (SDL) is the minimum number of bits required to ensure that at least one compressed symbol is in the decode buffer In our implementation, this number equals one plus the length of an uncompressed instruction field Our bitstream merge logic performs two tasks to produce each output storage block filled with compressed bits from multiple bitstreams: i) use the given bitstream placement algorithm (BPA) to determine the bitstream placement within current storage block; ii) count the numbers of bits left in each buffer as if they finish decoding current storage block We pad extra bits after the code at the end of the stream to align on a storage block boundary Algorithm 1 is developed to support parallel decompression of two bitstreams The goal is to guarantee that each decoder has enough bits to decode in the next cycle after they receive the current storage block Figure 5 illustrates our bitstream merge procedure using previous code compression example in Figure 3 The size of storage blocks and slots are 8 bits and 4 bits respectively In other words, each storage block has two slots The SDL is 5 When the merge process begins (translates Figure 5a to Figure 5b), the merge logic gets A 1, A 2 and B 1, then assigns them to the first and second slots 2 Similarly, A 3, A 4, 2 We use and to indicate the first and second parts of the same compressed instruction in case it does not fit in the same storage block B 1 and B 2 are placed in the second iteration (step 2) When it comes to the third output block, the merge logic finds that after Decoder 2 receives and processes the first two slots, there are only 3 bits left in its buffer, while Decoder 1 still has enough bits to decode in the next cycle So it assigns both slots in the third output block from Stream 2 This process repeats until both input (compressed) bitstreams are placed The Full() checks are necessary to prevent the overflow of decoders input buffers Our merge logic automatically adjusts the number of slots assigned to each bitstream, depending on whether they are effectively compressed Algorithm 1: Placement of Two Bitstreams Input: Every Storage Block Output: Placed Bitstreams if this is the first block then Assign Stream 1 to Slot 1 and Stream 2 to Slot 2 else if!ready(1) and!ready(2) then Assign Stream 1 to Slot 1 and Stream 2 to Slot 2 else if!ready(1) and Ready(2) then Assign Stream 1 to Slot 1 and 2 else if Ready(1) and!ready(2) then Assign Stream 2 to Slot 1 and 2 else if!full(1) and!full(2) then Assign Stream 1 to Slot 1 and Stream 2 to Slot 2 end Ready(i) checks whether the i th decoder s buffer contains at least SDL bits F ull(i) checks whether corresponding buffer has enough space to hold more slots 34 Bitstream Split The bitstream split logic uses the reverse procedure of the bitstream merge logic The bitstream split logic divides the single compressed bitstream into multiple streams using the following guidelines: Use the given BPA to determine the bitstream placement within current compressed storage block, then dispatch dif-

ferent slots to the corresponding decoder s buffer If all the decoders are ready to decode the next instruction, start the decoding If the end of current branch block is encountered, force all decoders to start We use the example in Figure 5 to illustrate the bitstream split logic When the placed data in Figure 5b is fed to the bitstream split logic (translates Figure 5b to Figure 5c), the length of the input buffers for both streams are less than SDL So the split logic determines the first and the second slot must belong to Stream1 and Stream2 respectively in the first two cycles At the end of the second cycle, the number of bits in the Decoder 1 buffer, Len 1 (ie, 6), is greater than SDL (ie, 5), but Len 2 (ie, 3) is smaller than SDL This indicates that both slots must be assigned to the second bitstream in the next cycle Therefore, the split logic dispatches both slots to the input buffer of Decoder 2 This process repeats until all placed data are split 35 Decompression Mechanism The design of our decoder is based on the Huffman decoder hardware proposed by Wolfe et al [1] The only additional operation is to check the first bit of an incoming code, in order to determine whether it is compressed using Huffman coding or not If it is, decode it using the Huffman decoder; otherwise send the rest of the code directly to the output buffer Therefore, the decode bandwidth of each single decoder (Decoder 1 to Decoder N in Figure 2 (b)) should be similar to the one given in [1] Since each decoder can decode 8 bits per cycle, two parallel decoders can produce 16 bits per cycle Decoders are allowed to begin decoding only when i) all decoders decoder buffers contains more bits than SDL; or ii) bitstream split logic forces it to begin decoding After combining the outputs of these parallel decoders together, we obtain the final decompression result 36 Bitstream Placement for Four Streams In order to further boost the output bandwidth, we have also developed a bitstream placement algorithm which enables four Huffman decoders to work in parallel During compression, we take every two adjacent instructions as a single input storage block Four compressed bitstreams are generated by high 16 bits and low 16 bits of all odd instructions, as well as high 16 bits and low 16 bits of all even instructions We also change the slot size within each output storage block to 8 bits, so that there are 4 slots in each storage block We omit the complete description of this algorithm here due to the lack of space However, the basic idea remains the same and it is a direct extension of Algorithm 1 The goal is to provide each decoder with sufficient number of bits so that none of them are idle at any point Since each decoder can decode 8 bits per cycle, four parallel decoders can produce 32 bits per cycle Although we can still employ more decoders, the overall increase of output bandwidth will slow down by more start up stalls For example, we have to wait 2 cycles to decompress the first instruction using four decoders in the worst case As a result, high sustainable output bandwidth using too many parallel decoders may not be feasible, if its start up stall time is comparable with the execution time of the code block itself 4 Experiments The code compression and parallel decompression experiments of our framework are carried out using different application benchmarks compiled using a wide variety of target architectures 41 Experimental Setup We used benchmarks from MediaBench and MiBench benchmark suites: adpcm en, adpcm de, cjpeg, djpeg, gsm to, gsm un, mpeg2enc, mpeg2dec and pegwit These benchmarks are compiled for four target architectures: TI TMS320C6x, PowerPC, SPARC and MIPS The TI Code Composer Studio is used to generate the binary for TI TMS320C6x GCC is used to generate the binary for the rest of them Our computation of compressed program size includes the size of the compressed code as well as the dictionary and all other data required by our decompression unit We have evaluated the relationship between the division position and the compression ratio on different target architectures We have observed that for most architectures, the middle of each instruction is usually the best partition position We have also analyzed the impact of dictionary size on compression efficiency using different benchmarks and architectures Although larger dictionaries produce better compression, our approach produces reasonable compression using only 4096 bytes for all the architectures Based on these observations, we divide each 32-bit instruction from the middle to create two bitstreams The maximum dictionary size is set to 4096 bytes The output bandwidth of the Huffman decoder is computed as 8 bits per cycle [1] in our experiments To the best of our knowledge, there have been no work on bitstream placement for enabling parallel decompression of variable length coding So we compare our work (BPA1 and BPA2) with CodePack [11], which uses a conventional bitstream placement method Here, BPA1 is our bitstream placement algorithm in Algorithm 1, which enables two decoders to work in parallel, and BPA2 represents our bitstream placement algorithm in Section 36, which supports four parallel decoders 42 Results Figure 7 shows the efficiency of our different bitstream placement algorithms Here, decode bandwidth means the sustainable output bits per cycle after initial stalls The number shown in the figure is the average decode bandwidth over all benchmarks It is important to note that the decode bandwidth for each benchmark also shows the same trend As expected, the sustainable decode bandwidth increases as the number of decoder grows Our bitstream placement approach improves the decode bandwidth up to four times As discussed earlier, it is not profitable to use more than four decoders since it will introduce more start up stalls We have studied the impact of bitstream placement on compression efficiency Figure 8 compares the compression ratios between the three techniques on various benchmarks on MIPS

32 24 16 CodePack [10] BPA1 BPA2 Table 1 Comparison using different placement algorithms CodePack [11] BPA1 BPA2 Area/µm 2 122263 137529 253586 Power/mW 75 98 146 Critical path length/ns 691 576 594 8 0 065 06 055 TI PowerPC SPARC MIPS Figure 7 Decode bandwidth of different techniques CodePack [10] BPA1 BPA2 Figure 8 Compression ratio for different benchmarks architecture The results show that our implementation of bitstream placement has less than 1% penalty on compression efficiency This result is consistent across different benchmarks and target architectures as demonstrated in Figure 9 which compares the average compression ratio of all benchmarks on different architectures 065 06 055 CodePack [10] BPA1 BPA2 TI PowerPC SPARC MIPS Figure 9 Compression ratio on different architectures We have implemented the decompression unit using Verilog HDL The decompression hardware is synthesized using Synopsis Design Compiler and TSMC 018 cell library Table 1 shows the reported results for area, power, and critical path length It can be seen that BPA1 (uses 2 16-bit decoders) and Code- Pack have similar area/power consumption On the other hand, BPA2 (uses 4 16-bit decoders) requires almost double the area/power compared to BPA1 to achieve higher decode bandwidth, because it has two more parallel decoders The decompression overhead in area and power is negligible (100 to 1000 times smaller) compared to typical reduction in overall area and energy requirements due to code compression 5 Conclusions Memory is one of the key driving factors in embedded system design since a larger memory indicates an increased chip area, more power dissipation, and higher cost As a result, memory imposes constraints on the size of the application programs Code compression techniques address the problem by reducing the program size Existing researches have explored two directions: efficient compression with slow decompression, or fast decompression at the cost of the compression efficiency This paper combines the advantages of both approaches by introducing a novel bitstream placement technique for parallel decompression We addressed four challenges to enable parallel decompression using efficient bitstream placement: instruction compression, bitstream merge, bitstream split and decompression Efficient placement of bitstreams allows the use of multiple decoders to decode different parts of the same/adjacent instruction(s) to enable the increase of decode bandwidth Our experimental results using different benchmarks and architectures demonstrated that our approach improved the decompression bandwidth up to four times with less than 1% penalty in compression efficiency References [1] A Wolfe and A Chanin, Executing compressed programs on an embedded RISC architecture, MICRO 81-91, 1992 [2] H Lekatsas and Wayne Wolf, SAMC : A code compression algorithm for embedded processors, IEEE TCAD, 18(12), 1999 [3] H Lekatsas, J Henkel and W Wolf, Code compression for lowpower embedded system design, DAC, 294 299, 2000 [4] C Lin, Y Xie, and W Wolf, LZW-based code compression for VLIW embedded systems, DATE, 76 81, 2004 [5] S Liao, S Devadas, and K Keutzer, Code density optimization for embedded DSP processors using data compression techniques, IEEE TCAD, 17(7), 601 608, 1998 [6] J Prakash et al, A simple and fast scheme for code compression for VLIW processors, DCC, pp 444, 2003 [7] M Ros and P Sutton, A hamming distance based VLIW/EPIC code compression technique, CASES, 132 139, 2004 [8] S Seong and P Mishra, Bitmask-based code compression for embedded systems, IEEE TCAD, 27(4), 673 685, April 2008 [9] S Nam et al, Improving dictionary-based code compression in VLIW architectures, FECCS, E82-A(11), 2318 2324, 1999 [10] H Lekatsas and W Wolf, Code compression for embedded systems, DAC, 516 521, 1998 [11] C Lefurgy, Efficient Execution of Compressed Programs, PhD Thesis, University of Michigan, 2000 [12] Y Xie et al, Code compression for embedded VLIW processors using variable-to-fixed coding, IEEE TVLSI, 14(5), 2006