Why and How to Customize a Processor

Why and How to Customize a Processor

Published on October 1, 2021
Featured image by Gerd Altmann from Pixabay.

Why customize?

Processor customization is one approach to optimizing a processor IP core to handle a certain workload. In some case it makes sense to design a dedicated core from scratch, but in many cases an existing core may partially meet your requirements and can be a good starting point for your optimized core.

In the past some processor IP vendors, notably ARC and TenSilica, offered extensible cores which allowed a limited amount of customization. However with Codasip Studio, the processor architecture and microarchitecture can be described with the CodAL language, offering far more degrees of freedom both in terms of ISA and microarchitecture.

This CodAL ability is particularly synergistic with the RISC-V ISA, but it can be applied to cores based on any other ISA too.

Customization and RISC-V

The RISC-V instruction set has three classes of instruction. There is a base instruction set for a given wordlength (32-, 64- or 128-bit), different groups of optional standard extensions, and non-standard custom extensions.

RISC-V processor performance trending upwards

RISC-V Modular Instruction Set. Source: Codasip.
This work © 2021 by Codasip Group is licensed under CC BY-NC-SA 4.0.

There is a large part of the opcode space which is available for custom extensions. A processor architect can use such extensions to deliver extra processing performance to address a given computational workload.

Codasip offers off-the-shelf RISC-V processor cores which are licensed in the usual way with RTL, a testbench, and SDK. These cores can also be licensed in the CodAL source code which was used to design the cores and to generate the SDK and HDK. The CodAL source can be edited to create custom extensions and to modify other architectural features.

Microsemi used this approach on an audio design where they were seeking to replace a proprietary embedded core with a RISC-V one.1 They started with the base 32-bit instruction set but found that the cycle count was far too high. Adding the multiplication instructions improved performance but did not achieve their requirements. Finally, they worked with Codasip to create custom DSP extensions that significantly improved the performance 56 ×, with processor core gatecount growing 2.4 ×. Not only did they achieve their performance goal, but their codesize reduced from 232 kB to 64 kB, reducing the required instruction memory area 3.6 ×.

RISC-V processor performance trending upwards

The Microsemi case: Reducing cycle count with custom RISC-V extensions. Source: Codasip.

Codasip Studio provides two approaches to implementing the custom instructions in hardware:

  1. Implementing the logic in the processor pipeline,
  2. Connecting a co-processor with a generated interface.

Design Automation with Codasip Studio

The legacy approach to adding new instructions to a core is based on manual editing. Adding custom instructions must be reflected in the following areas:

  1. Software toolchain
  2. Instruction set simulator
  3. Verification environment
  4. RTL
Image

Design Automation without Codasip Studio. Source: Codasip.
This work © 2021 by Codasip Group is licensed under CC BY-NC-SA 4.0.

With the software toolchain, intrinsics can be created so that the new instructions are used by the compiler, but this also means that the application code needs updating. However, modifying the existing ISS and RTL are both potential sources of errors. Lastly if the verification environment needs changing, this is a further area for problems. Verifying these manual changes is a big challenge and adds risk to the design project.

Some vendors offer partially automated solutions, but by not covering all aspects of processor customization they still leave room for error due to the manual changes.

Image

Design Automation with Codasip Studio. Source: Codasip.
This work © 2021 by Codasip Group is licensed under CC BY-NC-SA 4.0.

In contrast, with Codasip the changes are only made to the CodAL source code. The LLVM toolchain is automatically generated with support for the new instructions. Similarly, the ISS and RTL are generated to include the custom instructions and can be checked using the updated UVM environment. This approach not only saves time, but is a more robust customization process. You can learn more on the topic in this paper, or explore Codasip Studio in more detail.

Image

Roddy Urquhart
Senior Marketing Director

Share the post on social media!

1 Source: Implementing RISC-V for IoT applications, Dan Ganousis & Vijay Subramaniam, DAC 2017.

Check out our latest Blogposts!

Oct / 2021
Blogposts

Why and How to Customize a Processor

Image
Sep / 2021
Blogposts

Why it’s the perfect time to join Codasip and be part of the RISC-V revolution

Image
Aug / 2021
Blogposts

What is the difference between processor configuration and customization?

Image
Jul / 2021
Blogposts

Is RISC-V the Future?

Image
May / 2021
Blogposts

Domain-Specific Accelerators

Image
Apr / 2021
Blogposts

What is an ASIP?

Image
Mar / 2021
Blogposts

What does RISC-V stand for?

Image
Feb / 2021
Blogposts

What is CodAL?

Image
Feb / 2021
Blogposts

Customizing an Existing RISC-V Processor

Jan / 2021
Blogposts

How to Choose an Architecture for a Domain-Specific Processor

Dec / 2020
Blogposts

Does ISA ownership matter? A Tale of Three ISAs

Nov / 2020
Blogposts

Open Source vs Commercial RISC-V Licensing Models

Image
Nov / 2020
Blogposts

When Considering Processor PPA, Don’t Forget the Instruction Memory

Oct / 2020
Blogposts

What is needed to support an operating system?

Sep / 2020
Blogposts

What is processor core complexity?

Aug / 2020
Blogposts

Understanding the Performance of Processor IP Cores

Jul / 2020
Blogposts

Codasip’s Expanding RISC-V Offering

Jun / 2020
Blogposts

What is SweRV Core EH2?

May / 2020
Blogposts

More than Moore with Domain-Specific Processors

Apr / 2020
Blogposts

The Challenges of Making Open-Source RISC-V Deployment Effective

Apr / 2020
Blogposts

Have you checked the hidden costs of deploying an open source RISC-V core?

Aug / 2017
Blogposts

Does RISC-V mean Open Source Processors?

Jun / 2017
Blogposts

A Tale of Two Approaches to High-Performance IoT

Sep / 2016
Blogposts

What is RISC-V? Why Do We Care and Why You Should Too!