When To Use FPGA vs Microcontroller
Selecting the Right Hardware
Author: Ken Obuszewski, Product Management, VORAGO Technologies
Feb 20, 2024
Overview
FPGAs and Microcontrollers have long histories of deployment across a broad set of embedded system markets including automotive, the internet of things (IoT), and aerospace and defense, and often represent one of the key strategic choices for a customer’s product design. They have unique capabilities which influence the decision to choose an FPGA or an MCU, and in some scenarios to deploy both in a design. This article is intended to provide insights on making cost-efficient, informed decisions for your projects.
What is an FPGA and What Does it Mean?
A Field Programmable Gate Array (FPGA) is a highly configurable digital integrated circuit, allowing the user to create custom logic designs. FPGAs are programmed using Hardware Description Languages, which requires a somewhat unique skillset. They are also a valuable tool for workloads that benefit from large scale parallel computing. FPGAs vary widely in terms of functionality, price, and power consumption. In addition to parallel computing use cases, engineers are likely to choose an FPGA as an alternative to building a custom application specific integrated circuit (ASIC), with the greatly reduced R&D investment offsetting a higher average unit selling price (ASP).
What are Common FPGA Applications and Examples
FPGAs were initially developed in the mid-1980s as an alternative to custom ASICs. Common use cases included:
Pre-silicon prototyping
Evolving and multi-standard support
Early neural networks
The telecom and networking markets helped accelerate the growth of the FPGA market in the early 1990s, and today FPGAs can be found across all major industry verticals. Examples include processing and optimization of medical imaging data and signal processing and custom algorithm implementation in industrial control applications.
The modern data center has become a leading application for today’s FPGA, providing lower power implementations than general purpose GPU and advanced CPU solutions. Target workloads include AI/ML, security and encryption, and real-time analytics (i.e., financial trading).
The Aerospace and Defense market has been a user of FPGAs from the early days when field re-programmability was critical due to long deployment timeframes. The need for field programmability was especially critical in the Space market, which has continued to evolve use cases for FPGAs, including:
Onboard edge computing, including signal and image processing, data compression and encryption to optimize data transmission from satellites
Software defined radio
Navigation and guidance systems
AI and neural networking acceleration
Please refer to the FPGA in Space Applications blog for additional details.
Understanding FPGA Design and Architecture
FPGAs are complex integrated circuits, with multiple subsystems described as follows:
Logic functions including:
LUTs (Look-Up Tables): Programmable combinational logic gates and elements
Registers: Intermediate value storage and synchronization of tasks
Digital Signal Processing (DSP) blocks
Fast Fourier transforms (FFT), multipliers, and finite impulse response filters (FIR)
Memory
Typically, SRAM
I/O
Interface to external devices
Hard IP
Occasionally industry standard IP such as Arm® CPU or GPUs are integrated to create FPGA SoCs
What are (MCU) Microcontrollers?
Microcontrollers are embedded integrated circuits which contain a CPU core, embedded memory, input/output (I/O) ports, and application specific peripherals. MCUs are optimized towards low cost and low power consumption, focused on specific applications and workloads. Historically, the CPU core in an MCU was a custom architecture built by the semiconductor vendor, with more recent momentum towards industry standard architectures such as Arm®. Microcontrollers are configurable using software and well-known programming languages such as C. As a result, there is a large community available to develop MCU powered applications.
Is an MCU a Microprocessor
Compared to an MCU, a microprocessor (MPU) is a higher performance and a more general-purpose semiconductor device. The distinction between an MCU and a microprocessor (MPU) begins with the memory architecture, where an MCU primarily relies on an embedded system of memory (volatile and non-volatile), and an MPU relies on external memory (i.e., DRAM and Flash) in addition to internal memory. This allows an MPU to run a higher performance operating system, such as Linux, and to perform advanced computing tasks including artificial intelligence, digital signal processing and general computing tasks. In recent years there has been a focus to provide a continuum between MCU and MPU. This includes running Linux on MCU and Real-time Operating System (RTOS) on an MPU.
What are Common Microcontroller Applications and Examples
A key industry that has driven innovation in microcontrollers is the automotive market, where a premium has been placed on developing application specific MCUs optimized for cost and power consumption. Examples include engine control, airbag systems, and electronic braking systems. MCUs have been deployed across every industry, such as industrial programmable logic controllers (PLCs) and motor control systems, portable consumer devices, smart meters, medical devices, and of course aerospace and defense systems.
In Space applications, MCUs have become critical components, largely due to the existence of radiation hardened solutions such as VORAGO Arm-based rad hard MCUs. Because of co-existence with components that are not radiation hardened a key use case for rad hard MCUs is intelligent watchdog which maintains the radiation resiliency of the system. Specific protections include: 1) Single event latch-up detection (SEL) and the ability to reset the system components and even reprogram an FPGA. An MCU can adjust the in-orbit system operation to avoid SEL; 2) Scanning for single event functional interrupts (SEFIs); 3) Memory scrubbing correcting any corrupted bits and writing the corrected data back to memory.
Additional MCU use cases include motor control, guidance, navigation, and control (GNC) systems for spacecraft, onboard processing of telemetry data, and payload systems.
Understanding Microcontroller Design and Architecture
Here is an in-depth look at microcontroller architecture components:
Central Processing Unit (CPU)
The CPU is the brains of an MCU and represents a critical architectural point for both the semiconductor provider and the end customer
The most prevalent CPUs in the Space market include Arm® and the emerging RISC-V architecture
CPUs for microcontrollers have evolved from 8- and 16-bit architectures and are primarily 32-bit deployments today
Memory
Program memory: Non-volatile memory, typically flash memory or read-only memory (ROM)
Data memory: Volatile memory, typically static random-access memory (SRAM)
Error correction code (ECC) is a key feature in MCUs that allows for mitigation measures from radiation exposure
MCUs also may have external memory expansion options
Input/Output (I/O) Ports and Peripherals
General-Purpose I/O (GPIO): Can be configured as inputs or outputs to connect to the external world
Analog Peripherals
o Analog to Digital Converters (ADC): Converts analog signals into digital values
o Digital to Analog Converters (DAC): Converts digital signals into analog voltages
o Analog Comparators: Compares two analog voltages and outputs a digital value
o Communication Interfaces
o Universal Asynchronous Receiver-Transmitter (UART)
o Serial Peripheral Interface (SPI)
o Inter-Integrated Circuit (I2C)
o Controller Area Network (CAN)
o Universal Serial Bus (USB)
o Ethernet
o SpaceWire
FPGA vs Microcontroller – Understanding the Differences
Let’s summarize the major differences between an MCU and an FPGA:
Cost vs Flexibility:
In almost all cases an MCU solution will be lower cost than an FPGA. An FPGA is designed to provide optimal flexibility for hardware functionality, where an MCU provides a balanced approach to general purpose vs application specific capabilities.
The flexibility of an FPGA is primarily achieved via the inherent design of an FPGA to allow hardware re-programmability. MCU flexibility is achieved primarily from software and a limited number of hardware configuration options.
Power Consumption:
A key tenant of an MCU is low power consumption and the IP (i.e., Arm® CPU) and design methodologies are heavily focused on low power consumption. MCU proliferation in battery powered devices has led to best-in-class power profiles.
FPGAs have been able to leverage advancements in semiconductor design to improve power consumption; however, the focus on higher performance parallel processing applications and larger designs to accommodate flexibility they cannot match the MCU power consumption.
Development Complexity
Outside of hardware PCB design, the skill sets of MCU vs FPGA developers are in many cases very different.
Most development cycles for an MCU are focused on software development, either assembly language or more often using high-level languages such as C and C++. For lower end MCUs, much of the effort is focused on code optimization to ensure fitting within potential memory footprint constraints. For higher end MCUs, knowledge of an operating system such as Linux or VxWorks may be required.
The skillset of an FPGA programmer is more akin to that of a semiconductor design flow, with knowledge of Hardware Description Languages (HDLs) like Verilog or VHDL. This may also lead to more complex debug environments.
FPGA vs Microcontroller – How to Know Which One to Use
Now that we have articulated the distinction between an FPGA and an MCU, let’s discuss how to choose the right components for your design. This can be looked at in a few vectors:
If the target application does not have clearly defined hardware specifications, and cost and power are not critical design parameters, an FPGA might be the right choice.
In cases where there are clearly defined constraints in terms of cost, power consumption, and/or footprint, an MCU is the best choice. This also applies when the customer desires to deploy multiple variants of the same application with differing performance/cost targets. In this case, development costs can be optimized using different MCU variants from the same supplier/product family or even multiple instances of the same product.
For high performance use cases where parallel processing is of value, then an FPGA might be the preferred choice. These workloads likely could also be solved with an MPU solution, especially if the customer would like to maintain consistency in hardware and software CPU architecture with MCU to MPU scalability.
As previously stated, MCU and FPGA often co-exist, such as the example of using a radiation hardened MCU, such as the VORAGO VA41630, as a system watchdog and to provide field re-programming of an FPGA. It is also important for customers to be mindful of how they invest their R&D dollars as FPGAs require a more specialized skillset with unique toolchains. There is a larger community with the capability to support MCUs, both in terms of university training and a large third-party ecosystem of support.
FAQ’s:
What is the difference between an FPGA and a Microcontroller?
An FPGA is a highly configurable digital integrated circuit, allowing the user to create custom digital circuits, whereas a microcontroller is a more general-purpose application specific device that is primarily software configurable.
Can an FPGA replace a microcontroller?
Sometimes – specifically in scenarios where cost and power consumption are not critical, and there is a need to implement custom hardware functionality.
Can FPGA and a Microcontroller work together?
Yes, and in several cases, it makes sense to pair them together. The Space market is a prime example where a radiation hardened MCU, such as the VORAGO VA41630, is utilized as a system watchdog and to provide field re-programming of an FPGA.
Why do FPGA builds take so long?
An FPGA workflow is similar to a semiconductor design flow, which requires specialized skills and is also dependent on the quality of the Hardware Description Language Tools (HDL). The complexity of the design may also require the optimization of multiple components and require multiple iterations.
Is FPGA better than Microcontrollers?
As is always the case there is no “one size fits all” and the choice of using an MCU, an FPGA, or both requires an ROI analysis by the customer. Both bring unique capabilities.
Want more information? Contact VORAGO: https://www.voragotech.com/contact-us
SUBSCRIBE TO OUR NEWSLETTER FOR THE LATEST UPDATES ON VORAGO TECHNOLOGIES PRODUCTS AND SERVICES.