Porting the GNU CORE-V Toolchain
Channel: British Computer Society Open Source Specialists
Date: 2020-10-20

Presented by: Mary Bennett, Pietra F T Madio, @7pietraferreira, Jessica Mills

Over recent years, RISC-V has taken off in both academia and industry. One RISC-V variant, CORE-V, developed by the Open Hardware Group, adds extensions which can improve performance and reduce code size. As part of this effort, the Open Hardware group have decided to build a robust set of GNU tools targeting CORE-V.

In the first part of this presentation, we will discuss adding support for hardware loop instructions to GNU binutils. This has involved making changes to the GNU assembler, gas, and the GNU linker, ld. We will explain in technical detail how we ported this custom extension to binutils as well how we tested the resulting CORE-V assembler and linker.

The second part of this presnetation will focus on adding hardware loops to GCC in three places; as built-in (intrinsic) funcions, as code-generation patterns for the compiler and within target specific optimization. We shall give special attention to memcpy, the function to copy blocks of memory, and which GCC uses every time a struct is assigned or returned as a result.

To encourage engagement with this project we have provided pre-built binaries, source code, scripts and test results for the comunity.  Additionally, patches are welcome as pull requests against the Open Hardware Group repositories for corev-binutils-gdb and corev-gcc on GitHub.

Mary Bennett is a tool chain engineer at Embecosm, developers of open source compilers, operating systems, models and AI.  She graduated from the University of Surrey with a degree in EEE and a love of Jui Jitsu and climbing.  Mary is best know for her work as Chair of the RISC-V Academia and Training group from 2018 to early 2020. She was winner of the UK Electronic Skills Foundation Scholar of the Year 2019.  Mary is a key engineer in the RISC-V CGEN project and CORE-V Binutils-GDB and GCC projects, and can be found on YouTube speaking on these subjects at numerous conferences over the past three years.

Pietra F. T. Madio moved to the UK from Brazil and has been working as a software engineer for Embecosm since November 2018. Pietra was previously undertaking research and implementation of neural networks using Keras and TensorFlow. She has also written a series of blog posts on implementing face recognition on the Google Coral development board. She currently is a key engineer at the CORE-V Binutils-GDB and GCC project, being the project manager for Binutils-GDB.  Pietra previously presented at the BCS as part of the 2019 Women in Open Source meeting and also spoke at the OSD Forum 2020 about her work on the Core-V Binutils-GDB project.

Jessica Mills is a Software Tool Chain Engineer at Embecosm, developers of open source compilers, operating systems, models and AI. She graduated from the University of Leeds with a masters degree in Electronics and Computer Engineering.  Jessica is a key engineer in both the CORE-V Binutils-GDB and GCC projects, being the project manager for GCC. She has previously presented this work at the OSD Forum 2020.