![]() Early 3G Software Development and Debugging on a Virtual System |
||||
|
Virtual System Prototypes (VSPs) offer a means to develop and debug embedded software before the silicon is available.
By Jeff Roane, VaST Systems Technology Corp. As the semiconductor industry continues to consolidate off-the-shelf hardware components to build wireless consumer devices, such as 3G phones, these devices are increasingly differentiated by software content. The iPhone® is a great example of that trend. In a time where the overall market is in decline, the iPhone uses an off-the-shelf ARM-based application processor, differentiated by a software-based intuitive human machine interface and new application features. As the focus definitely shifts from hardware to embedded software, new methodologies must be applied to ensure the requested functionality implemented by increasing numbers of lines of code is completed when the product is shipped. Virtual System Prototypes (VSPs) offer a means to develop and debug embedded software before the silicon is available. So What is a VSP?In short, this is a C/C++/SystemC based simulation model of the wireless device that models all the components such as processors, graphic accelerators, peripherals, buses, memories etc. and also the testbench to provide stimuli to the wireless system. Parts of the system that are not necessarily needed to develop software are typically not modeled or abstracted, e.g., the RF front-end could be neglected and instead IQ data in the baseband domain is used.The key is that such a VSP is fast and accurate to ensure that full software loads, e.g., complete protocol stacks and operating systems can be executed in a decent time. The accuracy is mandatory to verify whether the software fulfills real-time constraints, e.g., processing frames within the rates defined in a wireless standard. Achieving the Required SpeedBinary translation techniques are used to achieve the necessary speed of such a virtual simulation and the concept is to emulate the instructions of the embedded processor on the host machine,
Now as the complete wireless system with all its components and stimuli is in place and runs almost as fast as the real hardware, the software can be loaded, executed and, even more important, debugged using the same 3rd party tools that would be attached to the silicon. Of course, the same compiler and debugger tool chain as for the traditional flow is used to develop the embedded software and the virtual system prototype loads exactly like this target (binary) image. This means that once the real silicon is taped out, the software image runs immediately without further porting efforts, which is also due to the fact that the simulation is cycle-accurate and thus behaves as the silicon. Meeting Real-time ConstraintsIn debug mode the 3rd party debuggers such as Lauterbach's Trace32, GreenHill's Multi5, ARM's RealView etc. are launched and attached to the simulator using a debugging interface. These are also in the scope of standardization bodies, and the Multi-Core Debug (MCD) interface is one which is being standardized under the umbrella of SPRINT.
An example is when the layered protocol stack needs to process 3G frames in time. Imagine the underlying virtual processor model (VPM) does not implement cache behavior, but those that are contributing most to an increase of software execution times as a miss would imply a cache line fill usually done by a burst transfer over the instruction bus. It takes significant time to request the bus, getting the bus granted after the arbitration took place and finally fetching bytes over the bus. These additional cycles dominate the software execution time and may violate the real-time constraints when the software is not yet mainly executed out of cache. It is obvious that a fully arbitrating cycle-accurate bus is a key element to the overall timing as well. Imagine the bus is used and locked by another master or a second processor in a multi-core system and the pure functional model does not handle arbitration at all. Pure functional VSPs and especially processor models overcome the lack of modeling details by switching back to a more accurate but slower model, for example, to get the important timing information caused by a cache miss. Sometimes these simulations are called Hybrid Simulation, as multiple models of a single processor are involved and also have to be maintained. Optimizing the Software ArchitectureWith an accurate and fast solution in place, the software architecture could be optimized early in the design cycle and, in addition, the software developer could even suggest hardware architecture changes that would improve his SW execution times and even lower the power consumption of the mobile device.The latter is an important design constraint and is correlated to the activities in the processors, on the buses and in the peripherals. The VSP could be used to detect
VSP BenefitsAdditional benefits of a VSP include better visibility and debuggability. Once the simulation is paused with a debugger to inspect system registers, states and signal levels, the whole simulation is paused. That means that all the other components are stopped. A second processor would not continue to execute code and possibly write data into shared memory locations that are currently debugged, or FIFOs would not fill up and hinder narrowing down issues.As with a C/C++/SystemC based VSP all objects of the simulation could be accessed and traced at any time. It is also possible to use high-level debugging techniques - for example to find out the 3G frame that causes the largest CPU load based on the data rate chosen in the High-Speed Downlink Packet Access (HSDPA) mode. This is easily possible as a VSP offers non-intrusive analyzing capabilities. For the example above, it is possible to setup statistic counters that measure the load and are reset when the periodic interrupt service routine is called with the start of each frame. These processor load analyzers are setup in a way that the operating system idle loop instructions are excluded from the load calculation. Another example is that there are no limitations as to what further events are listed in the function profiling table. It is already common to list the function profiling table with cache statistics, bus activities etc. And with a virtual solution, this view can be extended with hit and miss rates of the customized L2 cache that is part of the SoC. Using Host ResourcesRunning the complete system as a virtual simulation on a PC also offers the capability to use host resources for debugging. The target software could use print to output messages, file IO and pipes to communicate to other applications immediately within the embedded target software. Those features can be easily used; however, the drawback is that they are intrusive and have an impact on the software execution time and need to be removed in the final production code.Other host resources could be used as well. For example, the host USB port within the VSP can be used to emulate the connection of the wireless device to serial devices. The above features have been used in production of a semiconductor vendor to develop and debug a 3G protocol stack shipped with the silicon. The VSP was hooked up to a 3G tester running on a separate PC via Ethernet. It was possible to initiate a call and debug issues using this setup. In Figure 2, the VSP setup for 3G modem protocol stack development illustrates the setup, and the software based 3G tester had an interface to provide the application processor directly with the 3G frames allowing the baseband processing to be abstracted away in order to further speed-up the simulation. Jeff Roane is vice president of marketing for VaST Systems Technology Corporation, 1250 Oakmead Pkwy., Sunnyvale, CA, 408-328-3300, www.vastsystems.com. |
||||
|
© 2012 Advantage Business Media |