Synopsys Insight  

Insight Home   |   Previous Article   |   Next Article

Issue 2, 2011
Virtual Prototyping for Software Developers

Virtual prototyping is becoming increasingly important to embedded software developers, engineers, managers and marketing teams. Marc Serughetti, Synopsys, explains what virtual prototyping is, and how those affected by growing hardware-software complexity can use it to produce better software and systems, faster.

Before considering why virtual prototyping is growing in importance to the embedded software community, it’s worth acknowledging the critical importance that software plays in determining the success, or otherwise, of system-on-chip (SoC) projects.

Research firm IBS estimates that embedded processor cores feature in more than 90% of today’s SoC designs that are manufactured in 65-nanometer (nm) geometries and below. Accordingly, SoC design teams now spend more time writing software than building hardware.

The rise of software is due to the way that it enables product companies to get more from their hardware. Software can extend the use of a chip, which allows for higher production volumes and ultimately more profitable designs.

These trends affect the development process in two ways. First, system development must cater for the development, integration and test of the software itself. Second, the design team must account for software in the hardware verification flow so that it can verify the system with realistic user scenarios.

The Cost of Being Late
The traditional approach to system development is to design the hardware, make a physical prototype, write the code, and then integrate the hardware and software. Because many projects target fast-moving markets, this approach is now too slow and too risky. A three-month delay on a product with a total lifetime of 30 months can reduce profits by 50%.

What many software teams want is to start developing the software as soon as possible in the project lifecycle. That means finding an alternative to the traditional ‘hardware-then-software’ design flow and getting started before the hardware is ready (Figure 1).

Figure 1: Traditional hardware-then-software embedded project design flow
Figure 1: Traditional hardware-then-software embedded project design flow

Increasingly, semiconductor companies are looking for ways to differentiate themselves beyond the feature sets of their chips. By adopting virtual prototyping they can offer better support to their systems and OEM customers.

Enabling an Early Start on Software
Virtual prototyping allows a software team to start its development efforts even before the hardware team has begun writing RTL code. This approach can lead to a nine to 12-month market advantage, which for a growing number of development teams is impossible to ignore. And many find that the secondary benefits of virtual prototyping are making their teams so much more productive and efficient – for example, during debugging. Virtual prototypes offer excellent control and visibility for the purpose of debugging and analyzing the behavior of the software. In fact, the debug capabilities are far better than those available when using the hardware itself. Virtual prototypes offer other advantages in addressing multicore designs and in enabling globally distributed teams to work together.

Virtual prototypes can be made available just a few weeks into the project schedule, which allows the software team to begin porting operating systems and developing device drivers without having to wait for the hardware team to write a single line of RTL code. Figure 2 shows how a “parallelized” flow leads to a significant schedule improvement.

Figure 2: Parallelized hardware-software design flow using virtual prototypes
Figure 2: Parallelized hardware-software design flow using virtual prototypes

Virtual Prototyping Basics
A virtual prototype is a fully functional software representation of a hardware design that encompasses virtually any combination of hardware. For example, a single- or multicore SoC, multiple SoCs, microcontrollers, peripheral devices, I/O, and optionally a model of the user interface. It provides an unambiguous executable specification of the system design, which developers can use to develop, integrate and test the software.

A virtual prototype runs on a general-purpose PC or workstation and is detailed enough to execute unmodified production code, including drivers, the OS, middleware and applications at speeds close to – or even faster than – real-time.

Developers can refine the virtual prototype as the project progresses, for example, extending the virtual prototype based on the software design task. To support an initial OS port will require the ISS and a few key peripherals such as a UART and timer. The development team can add more complex peripherals to support the needs of the schedule.

Virtual prototypes provide more visibility and controllability for the software developer. This functionality must come with virtual prototype specific development tools covering system-level software debug and analysis as well as the combination of hardware-software analysis. They must also integrate with existing software tools such as debuggers, which should be able to synchronize with the virtual prototyping software tools.

Virtual prototypes should also integrate with the hardware verification and system validation flows. These flows use additional tools such as FPGA prototypes, RTL simulation, physical system simulation, test bench equipment and even virtual IO that enable the virtual prototype to connect to physical hardware, such as USB or Ethernet.

Practical Uses
The following examples highlight several embedded software development use cases for virtual prototypes.

OS Bring-Up and Porting
Because they offer excellent debug visibility and enable software to be run long before physical hardware becomes available, virtual prototypes have the potential to revolutionize the way software is ported to SoCs, beginning with OS bring-up and continuing to the porting of application software.

The effort and risk associated with bringing up software stacks, such as Android, is very unpredictable. Software engineers have to deal with large, unfamiliar software bodies and integrating hardware and software throws up unknown problems. Often, there are many assumptions made in writing the software that do not hold true for specific hardware variants. Once it is working, the porting team has to make sure that it is properly integrated from a function, performance, and power perspective.

Virtual prototypes greatly improve the bring-up task. They provide instant debugging capabilities so that the development team does not have to rely on having any embedded software debug infrastructure up and running before the team starts debugging. They provide much better visibility than a typical software debugger, giving full visibility into all aspects of the software and the hardware, such as registers and signals, which maximizes the debug scope.

Most importantly, virtual prototypes prevent users from becoming overwhelmed with raw debug data from instruction and register traces. OS-awareness plugins for virtual prototypes abstract the system debug information to a level that developers can absorb, enabling them to follow a successful top-down debug flow. For example, an engineer could trace a driver defect in a phone chip from the outgoing call in the telephony manager to the freezing phone. This greatly helps to shorten the time to debug – the time to get from the symptom to the cause of the problem, making the whole development cycle more predictable.

Developing Drivers
A virtual prototype can be used to model a device such as a digital still camera, a USB video camera or a media player. If the driver is for a USB device, for example, the team can use virtual I/O capabilities to emulate the device I/O in software, connect the virtualized product to a Windows or Linux host on which the host controller resides, and to the USB device in order to develop the driver.

Alternatively, the team can use the virtual prototype to simulate the device host environment and connect the host PC to a real-world USB device. The real-world device, say a memory stick, is connected to the host PC using the host controller driver and hub driver provided by the Windows operating system. A USB client device driver connects this real-world device to the host executing in the virtual prototype. This way it is easy to develop, debug and verify host controller drivers and applications for different host operating systems.

Software Centric Power Analysis
Battery life has become the “Achilles heel” for the success of mobile software platforms such as Android. The mileage users can get from their batteries is severely impacted by software. Software implicitly and explicitly defines the power states of major system components while the phone is used and even while it is not used. In a mobile phone, the LCD alone can consume as much power as the CPU. A software power inefficiency or malfunction can quickly cause a drop of 5x in terms of stand-by time.

All of the complex, highly distributed software entities for power saving and management have to be vertically integrated and need to cooperate to guarantee efficient battery use. While software looks fine from a functionality and performance stand-point, it could well be that the battery drains four times faster. The usage scenarios play an important role as they define how the phone interacts with the environment. However, how can you debug your phone while it is locked in your pocket? How can you make sure that scenarios are deterministic to compare different implementation options? Moreover, debugging power defects comes with another major issue. In low power mode such as ‘suspend’, the embedded debug service is likely to be suspended as well. In addition to that, any debug interaction with the device is intrusive and severely affects the power figures. Furthermore, expensive lab equipment is required to perform a sufficiently fine-grain power profiling to determine which of the components is the most critical.

Virtual prototypes are a very useful vehicle to overcome those challenges. They provide excellent debug visibility at the right level of abstraction such as OS process traces. They can be instrumented with information that characterize power. The execution is controlled via deterministic scenario scripts that drive the IO of the virtual prototype, such as generating user-input via the touchscreen controller, setting GPS coordinates through the UART, initiating a phone call, etc. During simulation, power analysis data is collected along with other hardware and software traces to enable root-cause analysis and debugging to allow optimization of the software.

There is mounting pressure on embedded software teams. Increasingly, product success rests on their shoulders, and with software development time dominating the project, the software team cannot afford to wait for the hardware in order to get started.

Virtual prototypes offer software teams a way of creating software somewhat independently of physical hardware (silicon), which can result in a nine to 12-month market advantage. Software teams can start developing code even before the hardware team has produced any RTL. Development teams can use this productivity advantage to get to market faster or allow for more testing time, including corner testing.

As well as the time-to-market advantage, software teams are finding the other benefits of using virtual prototypes difficult to ignore.

Virtual prototypes offer excellent control and visibility for debugging – far better than the access available when debugging the hardware itself. Virtual models also enable globally distributed teams to work together – far more easily than when they have to share physical hardware.

As software continues to dominate system design, software teams are recognizing the benefits of taking a virtual approach to system development, both for hardware-software integration, and, just as importantly, for the benefits it can bring to the software development process in its own right.

Web links
  • Virtual prototyping online demonstration

About the author

Marc Serughetti
Marc Serughetti drives the development and deployment of virtual prototyping technologies at Synopsys. He has more than 15 years experience in embedded software development technologies from having led product marketing teams at Integrated Systems, Wind River and CoWare. At CoWare he led the company into the area of virtual prototyping targeting the embedded software community. His experience spans simulation technologies, compilers, IDE, debugging and analysis tools as well as run-time software.

Having read this article, will you take a moment to let us know how informative the article was to you.
Exceptionally informative (I emailed the article to a friend)
Very informative
Somewhat informative
Not at all informative