Larry Lapides, VP of sales at Imperas, joins us to talk about OS bring up on MIPS using virtual platforms. We met Imperas recently at the 2015 Imagination Summit in Santa Clara where the company was demonstrating the latest version of QuantumLeap, a parallel simulation performance accelerator.
Linux has become the general purpose operating system of choice for embedded systems, and is almost always supported for high end SoCs developed by semiconductor vendors. These SoCs now have multicore processors, and run symmetric multiprocessor (SMP) Linux. Most vendors start with the MIPS Linux distribution, then customize it for the specific SoC (requiring device tree changes), including the necessary drivers for the peripherals on the SoC as well as supporting other customizations and unique features. While the MIPS Linux distribution is a great starting point, that does not make customization and bring up an easy task.
To put it another way: Just because you get to the Linux prompt doesn’t mean everything is working.
Just where do virtual platforms fit in this?
Instruction accurate virtual platforms, which are just software simulation environments, have significant advantages over hardware-based development environments:
- Earlier system availability
- Full control of the platform both from external ports and internal nodes
- Full visibility into platform
- Performance can be faster than real time
- Easy to replicate platform and test environment to support automated testing
- No Heisenbug or accidental changes to the running system behavior while monitoring or debugging
Looking at the complete software development methodology, virtual platforms should certainly be used early in the development process. In addition, the virtual platforms, due to the visibility and controllability and the software development tools available, can continue to be used and add value throughout the duration of the software project. The hardware platforms, including the final hardware, can be used when they become available, with hardware based testing and virtual platform based testing providing complementary benefits to the software engineering teams.
Before going further, some additional understanding of the details of a virtual platform is needed. The processor models can be thought of as similar to instruction set simulators. However, for virtual platforms, the ideal is to have a single simulator for both the processors and the peripheral and behavioral components. While this is advantageous from a performance and ease-of-use perspective, it also enables software tools to be easily and efficiently added into the simulation environment.
One last key point about virtual platforms is that the combination of virtual platform models plus simulator executes exactly the same binary software stack as will eventually run on the hardware. No compiling for the host x86 PC; if the system uses a MIPS processor, the same cross compilation tool chain and flow are used to create the MIPS binary executables to run on the virtual platform or the hardware.
Virtual platforms offer the advantages of control and visibility, but what tools are available to enable the realization of these advantages? Using the Imperas virtual platform environment, a suite of tools is available for use, plus users can define custom tools. The Imperas SlipStreamer API plus the ToolMorphing engine enable analysis without modifying the software – OS, firmware, driver, application – source code, a significant advantage over hardware based software development environments. In hardware-based environments, source code must be instrumented and recompiled, such as for gcov and gprof, or a debug version of the kernel must be used, or printf instructions are liberally sprinkled through the source code to enable debug. These actions change the behavior of the software.
As a simple illustration of the value of these tools, debugging SMP Linux bring up with instruction tracing would require sifting through about 1,000,000,000 instructions before the boot prompt was observed. However, OS task tracing reduces this to the approximately 700 tasks that are executed as Linux boots. This makes it much easier to narrow down the cause of any problem. The figure below shows a screenshot of OS-aware tracing of task, execve and scheduler events as Linux boots.
Imperas is participating in a tutorial on Linux Porting and Bring Up and Driver Development at the 2015 Design Automation Conference (DAC) in San Francisco in June, and demos of the Imperas M*SDK product for MIPS processors can be scheduled at the Imperas booth or at the Imagination booth at DAC.Follow @ImaginationTech