Sign In
Forgot Password?
Sign In | | Create Account

Simulate, Build, Debug and Analyze: Embedded Software Development on a Virtual Prototype with GPU

Software development on early stage custom hardware platforms is not for mere mortals. The hardware isn’t finished yet, so the software team must wait for prototype boards to arrive. Then there’s the build, flash, test and debug cycle. Traditional, JTAG and printf-style debugging are hard enough but when application performance must be improved, there’s when the real wizardry takes place.

My colleague Mark Carey created a compelling video demo showcasing a number of Mentor Graphics’ embedded software development tools. The video starts by building a Virtual Prototype of the custom hardware, continues through an OpenGL bare-metal application build and debug tour, then finishes with application trace and performance analysis. Full details appear below the video.

Vista Virtual Prototype Creation Tool

We define the functional elements of our hardware model using Vista’s block diagram editor and model library. For this demo we create a platform design that contains an ARM Cortex-A9 processor, memory, an LCD peripheral, a GPU, a custom control hardware element, and a connecting bus.

From this model we generate a Vista Virtual Prototype. This Virtual Prototype is a standalone executable that simulates the behavior of the hardware platform defined at the platform design stage.

Build, Run and Debug with Sourcery CodeBench Virtual Edition

Building, running and debugging the application on the Vista Virtual Prototype are seamless tasks with Sourcery CodeBench Virtual Edition. As usual, the build occurs on our development host, but the resulting executable targets our virtual prototype platform. The OpenGL bare-metal Application used in this demo is based on Fabrice Bellard’s excellent TinyGL library implementation and gears example.

The Virtual Prototype simulation approach has several features that make life easier for embedded software developers. The virtual prototype semihosting implementation allows bare-metal applications to print messages to the console. Platform registers, not normally visible on real hardware, are exposed via the register view in the debug perspective.

Performance Analysis with Sourcery Analyzer

We non-intrusively generate trace data for software-only, unaccelerated implementation of the gears application, analyze the trace data to generate a frame rate performance graph.

We then re-build the application to take advantage of the Virtual Prototype GPU model, and re-run the GPU accelerated gears application, which generates a second trace file. From the second trace file we generate a second frame rate performance graph. The performance graphs from the two from the two application builds are then compared to show the increase in performance to GPU acceleration.

The Virtual Prototype’s non-intrusive tracing feature allows us to generate trace data by running the gears software example on the Virtual Prototype. We can then import the trace data into Sourcery Analyzer, a powerful performance analysis tool included in Sourcery CodeBench Virtual Edition.

Sourcery Analyzer uses a library of analysis agents to visualize trace data so developers can get a better understanding of the application’s behavior. In addition, developers can build custom analysis agents for custom visualization of application specific details. Our gears demo uses a simple custom analysis agent which visualizes the application’s frame rate.

To learn more about Mentor Graphics’ embedded software platforms, tools and services visit mentor.com/embedded.

Sourcery CodeBench Virtual Edition, Sourcery Analyzer, virtual prototype, Bare Metal, Cortex-A9, ARM, OpenGL, Performance Analysis, GPU, hardware simulator

More Blog Posts

About Ricardo Anguiano Follow on Twitter

Ricardo AnguianoRicardo Anguiano is a Technical Marketing Engineer working in the Embedded Software Division of Mentor Graphics. He has a master's degree in computer science from UC Davis. When not writing about embedded software development tools and platforms, you can find him on a bicycle or playing guitar. He is based in Northern California. Visit Embedded Blog

More Posts by Ricardo Anguiano

Comments

No one has commented yet on this post. Be the first to comment below.

Add Your Comment

Please complete the following information to comment or sign in.

(Your email will not be published)

Archives

 
Online Chat