Design and Implementation of an Instruction Set Architecture and an Instruction Execution Unit for the REZ9 Coprocessor System
Total Page:16
File Type:pdf, Size:1020Kb
UNLV Theses, Dissertations, Professional Papers, and Capstones 12-1-2014 Design and Implementation of an Instruction Set Architecture and an Instruction Execution Unit for the REZ9 Coprocessor System Daniel Spencer Anderson University of Nevada, Las Vegas Follow this and additional works at: https://digitalscholarship.unlv.edu/thesesdissertations Part of the Computer and Systems Architecture Commons, Computer Sciences Commons, and the Electrical and Computer Engineering Commons Repository Citation Anderson, Daniel Spencer, "Design and Implementation of an Instruction Set Architecture and an Instruction Execution Unit for the REZ9 Coprocessor System" (2014). UNLV Theses, Dissertations, Professional Papers, and Capstones. 2239. http://dx.doi.org/10.34917/7048161 This Thesis is protected by copyright and/or related rights. It has been brought to you by Digital Scholarship@UNLV with permission from the rights-holder(s). You are free to use this Thesis in any way that is permitted by the copyright and related rights legislation that applies to your use. For other uses you need to obtain permission from the rights-holder(s) directly, unless additional rights are indicated by a Creative Commons license in the record and/ or on the work itself. This Thesis has been accepted for inclusion in UNLV Theses, Dissertations, Professional Papers, and Capstones by an authorized administrator of Digital Scholarship@UNLV. For more information, please contact [email protected]. DESIGN AND IMPLEMENTATION OF AN INSTRUCTION SET ARCHITECTURE AND AN INSTRUCTION EXECUTION UNIT FOR THE REZ9 COPROCESSOR SYSTEM. By Daniel Anderson Bachelor of Science in Computer Engineering University of Nevada Las Vegas 2011 A thesis submitted in partial fulfillment of the requirements for the Master of Science in Engineering - Electrical Engineering Department of Electrical and Computer Engineering Howard R. Hughes College of Engineering The Graduate College University of Nevada Las Vegas December 2014 --------------------------------------------------------------------------------------------------- Copyright by Daniel Anderson, 2015 All Rights Reserved --------------------------------------------------------------------------------------------------- We recommend the thesis prepared under our supervision by Daniel Spencer Anderson entitled Design and Implementation of an Instruction Set Architecture and an Instruction Execution Unit for the REZ9 Coprocessor System is approved in partial fulfillment of the requirements for the degree of Master of Science in Electrical Engineering Department of Electrical Engineering R. Jacob Baker, Ph.D., Committee Chair Venkatesan Muthukumar, Ph.D., Committee Member Henry Selvaraj, Ph.D., Committee Member Evangelo Yfantis, Ph.D., Graduate College Representative Kathryn Hausbeck Korgan, Ph.D., Interim Dean of the Graduate College December 2014 ii ABSTRACT While the use of RNS has provided groundbreaking theory and progress in this field, the applications still lack viable testing platforms to test and verify the theory. This Thesis outlines the processing of developing an instruction set architecture (ISA) and an instruction execution unit (IEU) to help make the first residue based general processor a viable testing platform to address the mentioned problems. Consider a 32-bit ripple adder. The delay on this device will be 32N where N is the delay for each adder to complete its operation. The delay of this process is due to the need to propagate each carry signal generated by each adder to the next one. This was solved by the creation of the Carry Look Ahead (CLA), which could drastically reduce the delay by 2/3. However, like the ripple adder, the CLA is still encumbered by propagation delay. A residue processor in the same situation would have a delay of 1N regardless of bit size since carry propagation is no longer a concern. The Thesis discusses how prior challenges using residue number systems in computers has been overcome by Digital System Research (DSR). iii TABLE of CONTENTS ABSTRACT ..................................................................................................................................... ii LIST of TABLES ............................................................................................................................ vi LIST of FIGURES ......................................................................................................................... vii CHAPTER 1: INTRODUCTION AND MOTIVATION ................................................................ 1 1.1 BACKGROUND ................................................................................................................... 1 1.2 MOTIVATION ...................................................................................................................... 1 1.3 THESIS ORGANIZATION ................................................................................................... 2 CHAPTER 2: BACKGROUND ON THE RESIDUE NUMBER SYSTEM .................................. 3 2.1 RESIDUE NUMBER REPRESENTATION ......................................................................... 3 2.2 RESIDUE NUMBER CONVERSIONS ................................................................................ 5 2.2.1 PAIRWISE PRIMES ...................................................................................................... 5 2.2.2 MIXED RADIX CONVERSIONS ................................................................................. 6 2.3 FRACTIONAL REPRESENTATIONS .............................................................................. 10 CHAPTER 3: REZ9 COPROCESSOR BACKGROUND ............................................................ 12 3.1 DEVELOPMENT ENVIRONMENT .................................................................................. 12 3.2 NIOS II PROCESSOR ......................................................................................................... 12 3.3 REZ9 ALU ARCHITECTURE ........................................................................................... 14 3.4 REGISTER FILES ............................................................................................................... 15 3.4.1 ADDRESSING MODES .................................................................................................. 15 3.4.2 STATUS REGISTERS ................................................................................................. 17 CHAPTER 4: INSTRUCTION SET ARCHITECTURE .............................................................. 20 4.1 DESIGN METHODOLOGY ............................................................................................... 20 4.2 INSTRUCTION TYPES ...................................................................................................... 21 4.2.1 DATA PROCESSING AND ARITHMETIC INSTRUCTIONS ................................. 21 4.2.2 LOAD, STORE, AND MOVE INSTRUCTIONS ........................................................ 23 4.2.3 CONVERSION INSTRUCTIONS ............................................................................... 24 4.2.4 SIGNED INSTRUCTIONS .......................................................................................... 25 4.3 INSTRUCTION ENCODING ............................................................................................. 27 4.5 PARALLELISM .................................................................................................................. 28 CHAPTER 5: INSTRUCTION EXECUTION UNIT ................................................................... 30 5.1 OVERVIEW ........................................................................................................................ 30 iv 5.2 SOFTWARE IEU ................................................................................................................ 30 5.3 HARDWARE IEU IMPLEMENTATION .......................................................................... 31 5.4 QSYS SYSTEM INTEGRATION TOOL .......................................................................... 32 5.5 NIOS CUSTOM INSTRUCTION BACKGROUND .......................................................... 34 CHAPTER 6: SIMULATION & TESTING RESULTS ............................................................... 38 6.1 VERILOG SIMULATION RESULTS ................................................................................ 38 6.2 ECLIPSE IDE TEST ROUTINES & RESULTS ................................................................ 41 6.2.1 ARITHMETIC ALU TESTS ........................................................................................ 42 6.2.2 FRACTIONAL MULTIPLY TESTS ........................................................................... 43 6.2.3 COMPARISON TESTS ................................................................................................ 43 6.3 MANDELBROT TEST ROUTINE AND RESULTS ......................................................... 44 CHAPTER 7: CONCLUSION ...................................................................................................... 46 APPENDIX A: VERILOG CODE ................................................................................................ 47 APPENDIX B: ALU_INSTRUCT.C ........................................................................................... 111 APPENDIX C: ALU_INSTRUCT.H .......................................................................................... 135 APPENDIX D: ARITHMETIC ALU TESTS ...........................................................................