Why use a soft CPU core?

Introduction

A soft core is a reusable hardware module delivered in the form of synthesizable HDL code. On FPGA devices soft cores are implemented using programmable logic resources, as opposed to hard cores baked into the silicon. You may wonder, if someone needs a processor, why would they use an FPGA at all when one can opt for a cheaper microcontroller instead?

In a nutshell, a CPU is ideal for complex processing of a small amount of data; sophisticated algorithms with extensive branching can be implemented relatively easily. Conversely, an FPGA is well suited for relatively simple crunching of a large amount of data; it excels at algorithms that can be pipelined and/or parallelized. Many problems require a bit of both, and that's where FPGA-based systems on a chip (SoC) are useful.

When designing programmable digital hardware, there are multiple options, each having its advantages and drawbacks:

Let's explore each of these approaches.

Microcontroller (MCU) based design

There are all kinds of microcontrollers on the market. Many of them are rather cheap, which makes them popular for applications where performance is not a concern.

Pros:

Cons:

Pure programmable logic design (without a CPU core)

Pros:

Cons:

Programmable SoC with a hard CPU

Many FPGA vendors provide programmable system on a chip solutions that include both a conventional microprocessor core and a programmable logic array on the same chip, commonly called SoC FPGAs. These SoCs can be viewed as FPGA devices with a hard CPU core, but it can be easier to think of them as microprocessors with an FPGA as one of the peripherals. A high performance interconnect is used to pass data between the CPU core and programmable logic array. Zynq from Xilinx, S series devices from Intel (Altera) and SmartFusion from Microsemi (Actel) are examples of such programmable SoCs.

Pros:

Cons:

Programmable SoC with a soft CPU

Soft CPU cores are written in a hardware description language such as VHDL or Verilog and implemented on an FPGA like any other logic would be. Some soft cores are provided by FPGA vendors, for example, MicroBlaze from Xilinx or Nios II from Intel (Altera). Such cores are limited to the devices of their vendors. Some other processor cores, including LXP32, are portable and can be used with a broad range of FPGA devices.

Pros:

Cons:

Despite performance limitations, a soft processor core can be a powerful computing device running a full-fledged operating system like Linux. Alternatively, it can be a lightweight unit serving as a more convenient replacement for clunky state machines while running from on-chip RAM. This kind of flexibility is not available with hard CPU cores.

Discrete microcontroller and FPGA

Another obvious solution is to make a board with both an MCU and FPGA, and some kind of link between them.

Pros:

Cons:

Still, it is a perfectly valid solution for scenarios where there isn't much communication between the CPU and FPGA.

Summary

A programmable system on a chip, based on either hard or soft CPU core, allows the designer to divide tasks between the processor and the FPGA peripheral, providing the best of both worlds. A SoC also doesn't suffer from a communication bottleneck characteristic of a discrete design.

A soft core based SoC usually has lower CPU performance than a hard core processor, but has advantages of flexibility and portability.