### Preface
RISC-V has recently become the new 'Netflix' of the technology world and the focus of developers, as its openness and scalability has opened up the imagination of people to customisable processors. The term 'toolchain' is often mentioned in these articles, but very little is said about it, so today we're going to uncover the mystery.
### I. What is a tool chain **
"Toolchain" is the translation of "toolchain", which refers to a collection of tools that assist developers in development, debugging, performance analysis and tuning, and other development optimisation actions.
**
It typically contains basic tools such as compilers, assemblers, linkers, debuggers, simulators, etc. Integrated development environments can also be included as a graphical and comprehensive development tool. Because of the different instruction sets and user programming models, each architecture requires a complete and unique set of tool chains.
### II. The importance of tool chains
Some people may ask the question that since it is an aid, it is not as important as a non-essential item. This is half right and half wrong. In the early days of computer development, there were virtually no tool chains and scientists coded different instructions by punching holes in program cards, and computers read the punched information from the program cards to execute a stream of instructions. With the development of manufacturing processes and computers, modern computers store instruction codes in media such as ROM, RAM and Flash. Downloading instruction codes to the designated storage space requires a complex control process and therefore must be done with the aid of a program downloader. Numerous high-level development languages have sprung up to make program development more efficient. More than 99% of developers today use high-level languages to develop their business and then use compilers to translate the high-level language into target machine instructions to be downloaded and executed on the machine. Compilers are therefore an essential component of the tool chain. In addition, what happens if there is a bug in the program? A debugging system is needed to help the developer find out why the program is running wrong; what if the program is not performing well enough? A performance analyser is needed to help the developer to tune performance. Therefore,
**
For modern computer systems, a stable and complete development toolchain is the basis of an architectural foundation on which all software runs; without it, CPUs and hardware cannot be used and developers cannot move an inch.
**
![](././../../images_dir/1638170171/1.png)
The importance of the toolchain is illustrated above in terms of its functional completeness, but later, through the introduction of key indicators for the toolchain, it is explained in principle that the toolchain is no longer a mere aid, but a critical path that affects all aspects of the target architecture. The key metrics of the toolchain can be divided into two areas: efficiency and ease of use. Efficiencies include compilation efficiencies, debugging efficiencies, performance analysis efficiencies, etc., with compilation efficiencies being particularly important. As described above, a compiler is the software used to translate a high-level language into target machine instructions; a high-level language is translated into a number of machine instructions, and the number and quality of machine instructions translated by the compiler, while ensuring correct functionality, is critical and directly affects the time it takes to run the program and the space it occupies, i.e. the performance of the processor and the code density performance. Therefore, processor performance is a combination of hardware + tool chain capabilities, and it is not meaningful to compare hardware frequency metrics alone. In addition, debugging efficiency directly affects the efficiency of the developer's analysis and problem solving, which also determines whether the processor can be accepted by developers and whether it can be widely used.
### III. Status of the RISC-V tool chain
Given that the toolchain is so important, what is the current status of RISC-V's toolchain and does it meet the needs of current applications? Due to the open nature of RISC-V and the Foundation's continued operation of the software ecosystem, a large number of developers have been attracted to work on supplementing and improving the toolchain. At present, everything from compilation tools (GCC+LLVM), debugging tools to IDEs are supported in terms of basic functionality, but there is still a need for continued enhancement and improvement in terms of efficiency and ease of use. For example, there are still many gaps in the size of the compiled code compared to ARM, the lack of performance tuning tools, the lack of graphical real-time OS debugging tools, the open source IDE only supports simple debugging plug-ins, etc. All these aspects need to be continuously improved by the tool chain developers and verified and polished by the application scenarios.
### IV. Kenshi Series Tool Chain
The Swordpool series toolchain is based on the open source toolchain and is a collection of development tools highly optimised for application scenarios and the Xantetsu processor microarchitecture (see Figure 1). In conjunction with the Genie Turbo instruction set, there is an average performance improvement of 13% on the XT906 and 20% on the XT910 relative to the open source version. An instruction Trace based performance analysis tool was developed to work with the graphical interface of the IDE to provide developers with the ability to quickly performance profiling and optimisation. In addition, two IDEs have been developed for MCU application development and general purpose application development to reduce the difficulty of migrating existing projects to RISC-V architecture chips. Each tool in the Swordpool family of toolchains will be described in detail in subsequent articles.
![](././../../images_dir/1638170351/2.png)
### V. Summary
The RISC-V toolchain has been developed over the past few years and has become increasingly functional; it is believed that in the next few years, through the joint efforts of the open source community and commercial companies, there will be significant improvements in compilation and debugging efficiency and ease of use, and the RISC-V chip will be accepted by more RISC-V chips will be accepted by more developers and used in various scenarios.
--- ![](././../../images_dir/1632828056/1.png)