Building a test environment with simulation

By glen-olafsen | 13 July 2023 | VLAB

One of the most challenging tasks for embedded software developers is creating a test environment that ticks all of the boxes. Embedded testing with simulation is uniquely positioned to address some of those requirements, including:

  • Is it available?
  • What can you see?
  • How much control is there?
  • How does it scale?
  • Where can you take it?


The argument that a simulator will be available before the hardware, allowing users to start early with development and testing is well established. What VLAB equips users to do is enhance virtual environments with:

  • Simple models of peripheral hardware such as sensors,
  • Connect to co-simulation environments such as Matlab Simulink & Vector Canoe to incorporate algorithmic models, and
  • Incorporate stimulus models from a variety of different data sources.

The result is a test environment that is available for:

  • use when it is needed, 
  • not subject to failure through broken or faulty parts, and
  • built for the particulars of your requirements rather than being adapted or retasked.


The driver to create a test environment, is to understand and validate the behaviour of a system. To achieve that, you need to be able to observe and analyse. In VLAB, you open up access to information not available in the equivalent hardware environment. Combinations of software, hardware and user defined probe points can produce tracing in the output format that makes sense, be it graphical, interactive or raw output for later processing.

In the Motor Control Demonstration below, you can see another example environment enhanced with Python peripheral models and co-simulation. The result is a system that enables the modelling and analysis of complex Motor Control algorithms.


As seen in the video above, Fault Injection through simulation and the possibilities it opens for testing are invaluable. Test equipment is expensive, as is the time required to maintain it, which naturally discourages testing of fault handling code. 

In some cases, trying to deterministically create the conditions that product requirements call for is just not feasible. VLAB puts the power in user’s hands, with scriptable control shaping seemingly impossible scenarios that ensure code coverage. 


Being a virtual environment, the only limit on tests running in parallel is compute resources and licenses. Importantly, both of these are reusable and can be shared across different test environments. Combine this with VLAB features like restarting simulations from checkpoints, and it is easy to see how regression test runs that used to take days or even weeks, can now be run in hours. 


In recent times we have seen a sudden shift to working from home for many workers, along with a compromising of transport and delivery routes world wide. For those who are already using virtual platforms, this has proven easier than for some. VLAB provides an environment that you can take and access anywhere, share between teams enabling collaboration, or even as a highly effective presentation for customers.

If you have a test environment that you are unsure how you can create it, or if it is going to do the job, why not make contact and see how VLAB can make embedded testing with simulation a reality.