A SIMD Microprocessor for Image Processing
Total Page:16
File Type:pdf, Size:1020Kb
A SIMD microprocessor for image processing Author: Zhiqiang Qiu Student ID: 20716003 Email: [email protected] Supervisor: Prof. Dr. Thomas Bräunl Computational Intelligence - Information Processing Systems (CIIPS) School of Electrical, Electronic and Computer Engineering The University of Western Australia 1 November 2013 A SIMD microprocessor for image processing Abstract The aim of this project is to design a Single Instruction Multiple Data (SIMD) microprocessor for image processing. Image processing is an important topic in computer science. There are many interesting applications based on image processing, such as stereo matching, 3D object reconstruction and edge detection. The core of image processing is matrix manipulations on the digital image. A digital image captured by a modern digital camera is made up of millions of pixels. The common challenge for most of image processing applications is the amount of data needs to be processed. It will be very slow if each pixel is processed in a sequential order. In addition, general-purpose microprocessors are highly inefficient for image processing due to their complicated internal circuit and large instruction set. One particular solution is to process all pixels simultaneously. A SIMD microprocessor with a simple instruction set can significantly increase the overall processing speed. This project focuses on the development of a SIMD image processor using software simulation. It takes a three step approach. The first step is to improve and further develop our circuit simulation software, Retro. Retro is a powerful circuit design tool with build-in real time graphical simulation. A number of improvements have been made to Retro to fulfil our design requirements. The second step is to design the actual SIMD circuit using Retro software. Tasks include designing the internal circuit of each Process Element (PE), internal circuit of the Sequencer CPU, interconnections between PEs and the instruction set of this SIMD image processor. The final step is to verify the correctness of the design by simulating the SIMD circuit in Retro using a number of image processing applications. This has been a successful project. A number of image processing applications demonstrate the correctness of both Retro software and the SIMD circuit. This project is part of an ongoing project. It lays down a solid foundation and provides a good direction for future tasks. We should expect a simple and highly efficient image microprocessor available for embedded systems in foreseeable future. - ii - A SIMD microprocessor for image processing Acknowledgement I would like to acknowledge and express my deep gratitude to the following persons who made the completion of this project possible: My project supervisor, Prof. Dr. Thomas Braunl, for his guidance, enthusiastic encouragement and valuable support. My project partner, Tim Forrest, for his contribution and valuable support. All teaching staff at UWA, for their assistance in my academic development. The Faculty of Engineering, Computing and Mathematics for providing laboratory facilities. Finally I would like to express my thanks and appreciation to our colleagues and industry persons for giving me such attention and time. - iii - A SIMD microprocessor for image processing Content Abstract ..................................................................................................................................... ii Acknowledgement .................................................................................................................. iii Content ..................................................................................................................................... iv Abbreviations .......................................................................................................................... vi Chapter 1 Introduction ........................................................................................................... 1 1.1 Digital Image ................................................................................................................... 2 1.2 Image processing ............................................................................................................. 4 1.3 Microprocessor ................................................................................................................ 6 Chapter 2 Background ............................................................................................................ 8 2.1 Microarchitecture ............................................................................................................. 9 2.2 Single Instruction Multiple Data (SIMD) ...................................................................... 11 2.3 Instructions Set ............................................................................................................... 12 Chapter 3 Retro ...................................................................................................................... 13 3.1 Overview of Retro .......................................................................................................... 13 3.2 Retro source file ............................................................................................................. 15 3.3 Standard Library ............................................................................................................ 18 3.4 Toy file ........................................................................................................................... 18 3.5 Module ........................................................................................................................... 19 3.5.1 Why do we need modules? ..................................................................................... 19 3.5.2 Solution ................................................................................................................... 19 3.5.3 Design ..................................................................................................................... 20 3.6 3.6 Pin ............................................................................................................................ 21 3.6.1 Design ..................................................................................................................... 22 3.7 Workspace ...................................................................................................................... 22 3.7.1 Why do we need a workspace? ............................................................................... 22 3.7.2 Solution ................................................................................................................... 23 Chapter 4 SIMD Image Microprocessor ............................................................................. 25 4.1 Requirements ................................................................................................................. 25 4.2 Instruction Set ................................................................................................................ 26 4.2.1 PE Instruction Set ................................................................................................... 26 4.2.2 Sequencer CPU Instruction Set ............................................................................... 29 4.3 Processes Element (PE) ................................................................................................. 31 - iv - A SIMD microprocessor for image processing 4.3.1 Arithmetic Logic Unit ............................................................................................. 34 4.3.2 Input / Output (Data Bus & Interconnections) ........................................................ 36 4.3.3 Instruction Bus ........................................................................................................ 37 4.3.4 Internal Memory ..................................................................................................... 37 4.3.5 Status Register ........................................................................................................ 37 4.4 Sequencer CPU .............................................................................................................. 38 4.4.1 Control Unit (CU) ................................................................................................... 41 4.4.2 ALU ........................................................................................................................ 42 4.4.3 Status Register ........................................................................................................ 42 4.4.4 Memory ................................................................................................................... 43 4.4.5 Clock ....................................................................................................................... 44 4.4.6 PE Network ............................................................................................................. 44 4.4.7 Conditional Statements & Loops ............................................................................ 47 Chapter 5 Image Processing ................................................................................................. 51 5.1 Summation ..................................................................................................................... 51 5.2 Thresholding .................................................................................................................