Cloud native EDA tools & pre-optimized hardware platforms
By: Allen Watson, Sr. Product Marketing Manager, ARC Processors, Synopsys
If you have used Ubuntu or Red Hat Linux (RHEL) operating systems on your desktop, you may think of ¡®Linux¡¯ as a full-featured operating system akin to Microsoft Windows or Mac OS. Ubuntu and RHEL are examples of a Linux distribution. ¡®Linux¡¯ is the kernel software that provides system services, and additional software is needed to make it into the specific distribution that you know and love. In the embedded world where ARC Processors exist, a Linux distribution must be scaled down because of the constrained system resources, such as memory and storage, that are common in many systems-on-chips (SoCs).
Figure 1 - A simplified view of the Linux Operating System
For a desktop or server Linux distribution, there are five main components:
The bootloader is the first software to run in a system. It gets the system ready to load and execute the kernel. The Linux kernel performs further initialization and includes the device drivers for the hardware. It provides services such as device and memory management. The system libraries contain much of the functionality of the operating system and allow applications and utilities access to the kernel services. User applications are the programs such as a web browser or email applications that we use to perform everyday tasks. The toolchain executes on the target system and is used to build applications and other software, as needed.
In the case of an embedded Linux distribution, there is usually a separate toolchain and build system. These components often execute on a workstation with a different processor from the target processor. The toolchain performs cross-compilation of the software to the target processor.
On the target:
On the development workstation:
A build system is key to managing the process of configuring the embedded Linux distribution to meet not just the functional requirements of the embedded system, but also to meet the system constraints of the SoC. Building a Linux distribution involves downloading and building many different software packages from many different sources. Each of these packages may have dependencies on many other packages and the process can become very complex, very quickly. A build system will help you do the following:
The build system can also be automated so that you can run nightly builds.
There are three popular build systems for Linux and they all support building a distribution for DesignWare? ARC? processors.
Buildroot
Buildroot can easily configure an embedded Linux distribution. It uses well-known Linux tools and infrastructure such as Makefiles to build a toolchain, filesystem, kernel image, and bootloader. Building a basic system may take just a few minutes.
The main features of Buildroot are:
In many cases, using Buildroot is a good approach. It is relatively straightforward to use with a good selection of packages to choose from. A GUI is used to pick the packages you want and configure the kernel itself. One feature missing is dynamic package management. Buildroot builds a static system that you cannot add to later. In some systems, there may be a requirement to add new software later to change or add functionality. However, in many embedded cases, the system remains fixed and this dynamic feature may not be important.
Once you have installed Buildroot and configured your Linux distribution, you can use the command below to build a Linux distribution for the ARC AXS101 Software Development Platform:
make snps_archs38_axs103_defconfig && make
OpenWrt
OpenWrt is an example of an application-specific build system targeted at WiFi routers. Distributions are available for many well-known commercial routers available in stores. There is also support for ARC Development Systems including the ARC HS Development Kit.
The main features of OpenWrt are:
This system adds flexibility by having dynamic package management, allowing new packages to be added after the original build. However, as stated earlier, the distribution is targeted at WiFi router applications and may not meet the needs of your embedded application.
Here is an example of a command used to build for ARC:
make menuconfig && make
Select ARC HS38 after the ¡®make menuconfig¡¯ command runs.
Yocto Project
The Yocto Project is an open source project hosted by the Linux Foundation. It provides templates, tools, and methods to create custom Linux-based systems. Many of the well-known Linux distributions from companies, such as Wind River Systems, are based on Yocto.
The main features of the Yocto Project are:
This build system is very flexible and easily customizable. The key to the customization capability is its layer model. Each layer contains a related set of instructions (known as recipes) that provides specific functionality. Separating these instructions into different layers allows for reuse of the layers by you and other users. For example, one layer could be a Board Support Package (BSP) layer. This contains information on the hardware. It may be possible to take a distribution and use it on different hardware by specifying a different BSP layer.
However, there is a downside to all this customization potential. The configuration must be done manually through scripts and the learning curve can be steep. But Yocto is the most comprehensive and flexible build system available, and is worth the time and effort to learn how to take advantage of it.
Which Build System is right for me?
The build system you use depends on your level of experience with Linux and how much customization you need. Table 1 below provides you with a cheat sheet:
Table 1 - A cheat sheet to help choose your build system for Linux
If you want to get started with Linux on ARC immediately, we provide pre-built Linux images for our development systems. In that case, you do not have to use a build system to get going. All our open source software can be accessed from the web site. Go to the Embedded Linux Project section.
For embedded systems, it is necessary to scale down an embedded Linux distribution to meet the project¡¯s functional requirements to be able to fit within the constraints of the embedded system. There are multiple build systems that can do this and Yocto is a great choice if you need access to a large number of packages and want the level of customization it provides. You also have the choice to use a simpler build system, such as Buildroot, which may fit your needs in a simpler way.