Font Size: a A A

The Development Of SIC Compiler Based On LLVM

Posted on:2020-10-12Degree:MasterType:Thesis
Country:ChinaCandidate:Y L HuFull Text:PDF
GTID:2428330599958582Subject:Computer technology
Abstract/Summary:PDF Full Text Request
It can improve efficiency and reduce the cost of learning new knowledge when we develop programs with C language rather than assembly language on the Microcontrollers.We need a cross-compiler that can compile the C program to the assembly language of singlechip to meet this demand.SIC Microcontrollers we discuss here customized from PIC Microcontrollers.Developing compiler is a complicated task that includes lexical analysis,syntax analysis,intermediate representation,register allocated and instruction optimization procedures.There are lots of repeated task existed in above procedures.Thus,LLVM is developed.LLVM is a collection of compiler development framework which integrates compiler,link and debug tools.The Frontend,Intermediate Representation and the Backend are three major parts of the LLVM.It encapsulates many repeated tasks and provides it to developers by interface.These interfaces include register descriptor,instruction descriptor,instruction scheduling,code emission and optimization.Developers use these interfaces to complete tasks.When we develop SIC compiler used LLVM tool,the first thing is register fundamental information about SIC in LLVM source code.Then SIC registers and instruction infomation are descripted by TD language in LLVM.While some IR instruction isn't supported by SIC instruction,it have to be lowered.One of the most important tasks is complete the instruction selection that match the IR instruction with SIC instruction and tranfrom IR to SIC assembly instruction.Finally,the result is outputted with assembly language.After compiling the LLVM source code,the usage way is as the same with the target machine defined in LLVM originally.It can ouput the right assembly language when the parameter of target machine is appointed the name of SIC.The processing of the unique part of SIC has also been solved.
Keywords/Search Tags:SIC Microcontrollers, LLVM frame, Register description, Instruction select, Backend transplantation
PDF Full Text Request
Related items