The soft core in Arm Cortex-M refers to the CPU core design that is implemented using logic synthesis rather than as a hard macro. Soft cores allow more flexibility in implementation compared to hard cores, but may have lower performance. The Arm Cortex-M processor family includes both soft core and hard macro options for the CPU core, allowing designers to choose the best option for their application requirements.
Introduction to Soft Cores
A soft core processor is a CPU core that is described using a hardware description language like VHDL or Verilog rather than as a physical layout. The HDL code can then be synthesized to generate the logic gates needed to implement the CPU on an FPGA, ASIC, or other programmable logic device. This differs from a hard core, which is a predefined physical layout of gates and transistors specifically designed to implement that CPU.
Soft cores have a number of advantages compared to hard cores:
- Flexibility – The HDL code can be modified to customize or optimize the CPU for a particular application.
- Portability – The same HDL code can be synthesized to different technologies like different FPGA families.
- Upgradability – Soft cores can be easily updated by modifying the HDL, without having to respin an ASIC.
- Cost – No license fees or royalties since you’re not using a predefined CPU layout.
The main disadvantages of soft cores are:
- Performance – Soft cores usually have lower maximum clock speeds compared to hard cores.
- Area – A soft core will usually take up more silicon area than a hard core.
- Power – Soft cores may consume more power than an optimized hard core.
Arm Cortex-M Soft Cores
Within the Arm Cortex-M family of processor cores designed for microcontrollers and embedded applications, there are both soft core and hard macro options available:
- Cortex-M0 and Cortex-M0+ – Available only as soft cores described in Verilog and VHDL. No hard macro option.
- Cortex-M1 – Available only as a hard macro physical layout.
- Cortex-M3 and Cortex-M4 – Available as soft cores or as hard macros.
- Cortex-M7 – Available only as a hard macro.
For the Cortex-M3 and Cortex-M4, Arm offers both a soft core HDL implementation as well as a hard macro implementation, giving designers a choice. The soft core allows more customization while the hard macro offers higher performance and efficiency.
Cortex-M3/M4 Soft Core
The Cortex-M3 and Cortex-M4 soft cores are delivered as synthesizable VHDL and Verilog RTL source code. They have the same CPU features and architecture as the hard macro versions, but allow customization of parameters like:
- Cache size
- Embedded memory (RAM, ROM) size and configuration
- Number of interrupts and priority levels
- Debug interface options
- Peripheral sets included
Designers can optimize these parameters for their specific application to reduce area or power consumption. The soft core can also be migrated between different process technologies by resynthesizing. However, maximum clock speed and silicon efficiency will be lower compared to the hard macro.
Cortex-M3/M4 Hard Macro
The Cortex-M3 and Cortex-M4 hard macro implementations are provided as GDSII layout data files containing the physical layout of the CPU core logic gates and transistors. The hard macro is optimized by Arm for high performance and low power operation. Benefits include:
- Higher maximum clock speed (typically 90% higher than soft core)
- Smaller silicon area (around 25% less than soft core)
- Lower power consumption due to optimized layout
- More consistent timing between implementations
However, the hard macro offers no customization ability – you get a fixed CPU configuration. The layout is also optimized for a particular process node, making migration to new processes more difficult. But for high volume designs where efficiency is critical, the hard macro is preferable.
Design Considerations
For most designers, the decision between using the Cortex-M3/M4 soft core or hard macro will come down to this trade-off between flexibility and efficiency. Some key considerations include:
- Customization needs – If you need to heavily customize features like memory, caches, interrupts etc. the soft core is preferable.
- Efficiency requirements – If you need maximum speed and minimum power/area, the hard macro is likely the better choice.
- Production volume – For very high volumes, the optimized hard macro is worth the upfront engineering effort.
- Migration plans – The soft core makes migrating to new processes and nodes simpler in the future.
- In-house expertise – Soft cores require more in-house RTL design expertise versus just integrating a hard macro.
Many vendors also offer Cortex-M3/M4 based microcontroller products that integrate the CPU core along with peripherals, memory, and interfaces. These products may use soft cores or hard macros depending on volume, market positioning, and other factors. So there are many implementation options to choose from.
Conclusion
The soft core implementation of the Arm Cortex-M3 and Cortex-M4 CPU cores offers designers the ability to customize and optimize the processor to match their specific needs in exchange for lower performance and efficiency. The hard macro option provides a fixed, highly optimized CPU configuration focused on maximizing speed and minimizing power and area. Most designs will need to balance flexibility vs. efficiency based on their requirements and volume expectations when choosing between the two implementation options.