Font Size: a A A

Analysis And Design Of Dedicated CPU Backend Transplantation Based On LLVM

Posted on:2018-11-11Degree:MasterType:Thesis
Country:ChinaCandidate:Y Z RenFull Text:PDF
GTID:2348330518459155Subject:Electronics and Communications Engineering
Abstract/Summary:PDF Full Text Request
The process of microprocessor development is not only composed of hardware design,but also software design.The software design is mainly the compiler transplantation.It is the foundation of microprocessor development,which can greatly shorten the microprocessor development cycle.Currently,the most of compiler developers use GCC as the compiler of the target processor,but GCC mainly uses register transfer language to describe backend processor,it is too abstract and complex to write and read.At the same time,GCC is lack of backend transplantation documents,so the backend transplant based on GCC is very difficult.At this time,how to quickly achieve compiler backend transplantation has become a difficult problem.In order to complete the software design of the microprocessor and shorten the microprocessor development cycle,this paper selects LLVM which is famous in recent years as the compiler architecture.The main contents of this paper are divided into three parts:Firstly,this paper analyzes LLVM's compilation architecture and backend transplantation mechanism in detail.LLVM is an open source project from the University of Illinois at the United States in 2000,and it is found by Chris Lattner,who joined Apple in 2005.The content of LLVM can be divided into three parts: LLVM intermediate representation,integrated library and tool set.The development language of LLVM is C++,and LLVM have a typical three-stage structure: front end,middle end and backend.And LLVM has a very clear level of framework and detailed documentations.This paper focuses on the backend design of LLVM.LLVM has a very humanized backend design,and it provides a lot of redirectable target characteristics of the structural support.The backend of LLVM is also called the code generator,which is divided into a common code generator and backend porting interface.The common code generator integrates the functionality shared by all target processors and it does not depend on a specific processor.The backend porting interface provides porting interface for a specific target processor,enabling characterization between different target processors.In order to support different target processors and generate the specified backend code generator,we only need to achieve the characteristics description of different processors,and then to use the common code generator and backend porting interface to achieve the backend code generator.Secondly,this paper focuses on the architecture and characteristics of the target processor.The target processor is our country self-developed DSP-based dedicated processor,which is referred to as STX.STX uses a typical VLIW structure,and it means that multiple instructions are executed in parallel in a single clock cycle so that the efficiency of the implementation of the processor is greatly improved.There are two types of architectures from the perspective of architecture: reduced instruction set computer(RISC)and complex instruction set computer(CISC).STX uses the RISC instruction set,and it has a large number of registers(including 32 general-purpose registers and 6 control registers)and 32-bit instruction set,its addressing mode is simple,with six different exception handling,making the processor running more secure and reliable.STX have low power consumption and small size,and at the same time it has a very clear hierarchy and modular design ideas,which makes the design of the chip more humane,easier to modify and improve.Finally,this paper gives a detailed backend transplant process and test results.In order to achieve LLVM support for STX,LLVM backend porting interface is very important.LLVM's backend porting interface mainly includes global description implementation,register description implementation,instruction set description implementation,assembler output description implementation and so on.In order to make programmers more convenient to describe the information of target processor,there is a very flexible and convenient tool in LLVM,which is named TableGen.And it is a descriptive language.The realization of all the features for STX depends on TableGen language and C++ language.The entire transplantation jobs can be divided into td file description and C++ file description.TableGen tool is mainly used to convert td files into corresponding to the C ++ code.Through these porting interface to describe the target processor STX,LLVM finally to achieve the support of STX.
Keywords/Search Tags:LLVM, STX, Backend-porting, Instruction set, Register
PDF Full Text Request
Related items