HW/SW Co-Design and Implementation of a Fountain Code for an FPGA System-On-Chip
Total Page:16
File Type:pdf, Size:1020Kb
Master Thesis HW/SW Co-design and Implementation of a Fountain Code for an FPGA System-on-Chip Khurram Ashraf [email protected] Supervisors: Prof. Dr. Klaus Schneider Prof. Dr.-Ing. Norbert Wehn M. tech. Tripti Jain Dr. -Ing. Christian Weis Declaration This work is the result of my own effort, and has been completed without any external help other than mentioned in this project report. References and literature that I have used are fully listed without emission in the literature list of my project. Khurram Ashraf TU Kaiserslautern 29 September, 2016. i Acknowledgment In doing this thesis work, I was blessed to work with some truly remarkable people. First of all, I would like to express my sincere gratitude to Miss Tripti Jain, Dr.-Ing. Christian Weis and Dipl.-Ing. Stefan Scholl for their supervision and support during the entire period of this thesis. I am really thankful to Prof.Dr. Klaus Schneider and Prof. Dr.-Ing. Norbert Wehn for their support by providing me an opportunity to work in their research group of Embedded Systems and Microelectronic Systems De- sign at Technical University of Kaiserslatuern. Furthermore, the knowledge I acquired by taking courses under their supervision helped me in building in-depth understanding for this thesis. Lastly, but most importantly, I would like to express my gratitude to my parents and brother for helping me during my studies. ii Abstract Wireless communication traffic has increased significantly over the past few decades. Communication via noisy and unreliable channel can lead to data loss or erroneous data information. This problem can be resolved using a back channel that allows a receiver to send a re-transmission request. However, in certain scenarios, i.e. deep space communication and point-to-multipoint communication, re-transmission can be expensive and leads to significant communication overhead. To overcome this problem Forward Error Correc- tion (FEC), also called channel code, are used. FEC allows the sender to encode the message in a redundant fashion by using Error Correction Code (ECC). This redundancy allows the receiver to correct the errors that occurred during transmission without asking for re-transmission. The thesis presents an analysis of Fountain code; Fountain code is a class of FEC. In designing embedded systems, parameters such as timing perfor- mance, energy consumption, throughput, and latency are of great impor- tance. In this thesis work different types of Fountain codes are implemented on an embedded platform (Zynq platform) to find a balance between hard- ware and software in terms of timing, energy, throughput and latency. Ini- tially, Fountain codes are implemented on an embedded processor (ARM cor- tex A9), and later on, efficient partitioning is sought between the hardware and software. Finally, an analysis is carried out for all the implementations in terms of timing, energy, throughput, and latency. iii Contents 1 Introduction 1 1.1 Motivation . .1 1.2 Zed Evaluation Board . .4 1.3 Main Goals and Tasks . .5 1.4 Related Work . .7 1.5 Organization of the Thesis . .7 2 Fundamentals of Fountain Code 9 2.1 Channel . .9 2.1.1 Binary Erasure Channel . .9 2.1.2 Binary Symmetric Channel . 10 2.2 Forward Error Correction . 11 2.3 Linear Block Codes . 11 2.4 Systematic and non-Systematic Codes . 11 2.4.1 Systematic Codes . 12 2.4.2 Non Systematic code . 14 2.5 Low Density Parity Check Codes(LDPC) . 14 2.6 Message Passing Algorithm . 14 2.7 LT-Code . 18 2.7.1 LT-Encoder . 19 2.7.2 LT-Decoder . 20 2.8 Raptor Code . 22 2.8.1 Raptor Encoder . 24 2.8.2 Raptor Decoder . 26 3 HW-SW Co-Design of Fountain Code on Zynq platform 28 3.1 LT-Code Encoding on Embedded Processor . 29 3.2 LT-Code Decoder on Embedded Processor . 31 iv 3.3 Raptor Code Encoding on Embedded Processor . 35 3.4 Raptor Code Decoding on Embedded Processor . 39 3.5 Hardware Software Partitioning of LT-decoder . 42 4 Results and Discussion 44 5 Conclusion and Future work 46 Bibliography 47 List of Figures 1.1 Communication system of LT-code. .2 1.2 Communication system of Raptor code. .3 1.3 Top view of Zedboard [1]. .5 1.4 Block Diagram of Zedboard [1]. .6 2.1 Binary Erasure Channel . 10 2.2 Binary Systematic Channel . 10 2.3 Systematic Code . 12 2.4 Bipatriate graph of LDPC code . 15 2.5 Encoding to produce check nodes. 16 2.6 Decoding using the message passing algorithm for the received string y = [10xxx1]. Sub-figures show the decision taken in each step. 17 2.7 Generator Matrix. Purple column shows the packets erased by the BEC. 19 2.8 Generator Matrix at the receiver side. Where N ≥ K...... 20 2.9 LT-Enoder . 21 2.10 Packet received at LT-Decoder. Rest of packets are deleted by the channel. 22 2.11 Example step by step decoding of LT-Code. Here K = 4 and N=6. 23 2.12 Raptor code . 24 2.13 Raptor encoding: Intermediate symbols are generated in the first step. Later, they are used by LT-code as an input to generate output. 25 2.14 Raptor Decoding: (a) Intermediate symbols are retrieved, but one symbol could not be retrieved.(b) Missing symbol was re- trieved by the outer code. 27 vi LIST OF FIGURES 3.1 Time consumed by an LT-encoder to encode for different data size. 29 3.2 Flow chart of LT-encoder on embedded processor. 30 3.3 Energy consumed by an LT-encoder to encode for different data size. 31 3.4 Flow graph of LT-Decoder. 32 3.5 LT-code decoding. Where K represents number of packets of original message. Here T = 4bytes . 33 3.6 LT-code decoding. Here T = 64bytes . 33 3.7 Energy Consumption of LT-code decoding. Here T = 4 bytes . 34 3.8 Energy Consumption of LT-code decoding. Here T = 64 bytes 35 3.9 Flow chart of Raptor-encoder. 36 3.10 Time consumed to generate intermediate packets by Raptor encoder. 38 3.11 Time consumed to generate output packets by Raptor encoder. 38 3.12 Raptor code decoding time consumption on embedded platform. 40 3.13 Raptor code decoding energy consumption on embedded plat- form. 40 3.14 Flow chart of Raptor decoder. 41 3.15 Decoding time of LT-decoder using hardware accelerator. 42 3.16 Energy consumed by the hardware accelerator. 43 3.17 Resourced utilized by the hardware. 43 vii List of Tables 3.1 Extra packets generated by the encoder of Raptor code. 37 viii Chapter 1 Introduction This chapter focuses on the main goals of the thesis. A major emphasis has been donned over Fountain code which is used as a core code throughout the thesis. 1.1 Motivation Wireless communication traffic has increased rapidly over the past few decades. Communication over unreliable and noisy channel can lead to significant amount of data loss or erroneous data. To ensure that data has been sent correctly, a back channel is required which is used by the receiver for re- transmission requests. Re-transmission leads to significant overhead and is expensive, e.g. deep space communication, mobile communication, etc. To overcome this problem, different coding techniques are proposed. These coding techniques are called channel coding or Forward Error Correction(FEC). FEC codes are a solution where re-transmission delays cannot be afforded by a communication system. They ensure that the receiver itself corrects the data transmission errors, hence ceasing the need for a re-transmission. Fountain code - a class of FEC - is implemented in this thesis. Normally, codes using FEC exhibit some fixed rate. The rate is a ratio between encoded symbols and input symbols. However, Fountain codes do not have fixed rate. They are often called rateless erasure codes due to this reason. 1 1.1. MOTIVATION As the name suggests, Fountain codes are analogous to water droplet in a fountain. They produce an infinite number of code-words from a given input data, where each code-word can be seen as a droplet. At the decoder side message M, which is divided into K numbers of symbols (each symbol T is of n bits) can be decoded from N symbols. Where N is any subset of symbols which are produced by the encoder at the receiver side. However, N should be greater than or equal to K. K symbols Source LT-Encoder Acknowldge Channel K symbols Destination LT-Decoder Figure 1.1: Communication system of LT-code. Fountain codes have two important classes of codes, namely LT-code and Raptor code. LT-code allows the encoder to produce potentially infinite stream of en- coded symbols, hence the decoder can decode the original message from any subset of the encoded message it receives. Figure 1.1 shows a communication 2 1.1. MOTIVATION system of LT-code. However, LT-code do not have linear time encoding and decoding complexity. To overcome this problem another type of Fountain code was introduced called Raptor code. Raptor code performs encoding and decoding in linear time. It intro- duces a new stage in LT-code called outercode/pre-code. At the receiver side, the message is initially encoded by an outercode that produces intermediate symbols. Later on, these intermediate symbols are encoded using weakened LT-code into output symbols. At the decoder side, symbols that are not recoverable by weakened LT-code are recovered by the outercode. Figure 1.2 shows a communication system of Raptor code. $ & '()01 2&3451 !"# 637&85495 $ @ABC"BC @ @ '()01 D53451 Figure 1.2: Communication system of Raptor code.