Automatic Code Verification via Locked-Step Simulation Comparison

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

There is no straightforward method to verify if automatically generated code from block diagram models accurately executes on target hardware platforms as designed, lacking easy comparison mechanisms between simulation environments and standalone code implementations.

Innovation Solution

A method and system for automatic verification of automatically generated standalone code by comparing intermediate outputs between simulations and standalone code implementations, allowing execution in a locked-step manner and generating comparison reports with error rates and sensitivity metrics.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If automatic code generation from block diagram models is used, then productivity is improved, but reliability deteriorates due to lack of verification

Engineering Contradiction:
Improvecode generation efficiencyVSAvoidcode execution accuracy
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent creates a copy of the block diagram model specifically for verification purposes. This comparison model replicates the structure and behavior of the original model, allowing automated execution and output comparison between the generated code and the original simulation without affecting the original design process

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent implements a feedback mechanism where the outputs of the generated code are automatically compared with the outputs of the original block diagram simulation. This feedback loop identifies discrepancies and verifies correctness, ensuring reliability while maintaining high productivity through automated verification

Inventive Principle:
Principle #23Feedback

2Reliability

If manual code communication and testing is used, then reliability is improved, but productivity deteriorates

Engineering Contradiction:
Improveverification accuracyVSAvoidtesting efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent enables the verification system to be self-servicing by automatically generating the comparison model, executing both the original simulation and generated code, comparing their outputs, and producing verification reports without requiring manual intervention. This automated self-verification maintains high reliability while dramatically improving productivity

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent performs preliminary setup by automatically creating the comparison model and configuring the verification environment before code execution. This preliminary action prepares all necessary components for automated verification, eliminating manual testing steps while ensuring thorough reliability checking

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS9317628B1Automatic comparison and performance analysis between different implementations
Publication Date: 2016.04.19 MATHWORKS INC
  • US9317628B1 patent drawing
  • US9317628B1 patent drawing
  • US9317628B1 patent drawing

AI summary

The present invention provides a method and system for automatic verification of automatically generated standalone code intended for execution on a target computing platform against its original design simulated in a simulation environment. The present invention also applies to execution comparisons between two implementations, such as two simulations, one simulation and one standalone code implementation, or two standalone code implementations. Block diagrams can be used to create a comparison model that compares two implementations. The comparison of different implementations can be performed at a block level, a subsystem level, a model level, or multi-model level. The present invention allows automatic comparison once a user supplies the intermediate outputs and/or signals that the user wants to compare and monitor. Reports can be generated to show the statistics of the comparison results.