RTL Code Clone Detection via Visual Image Representation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current methods for code clone detection in Register Transfer Level (RTL) codes are inefficient and require significant computational resources, lacking effective techniques for identifying and validating similar code fragments across different contexts.

Innovation Solution

The method generates images (RIR images) from RTL code constructs, using skeletal view tables and canonical vectors for comparison, allowing for efficient identification and validation of cloned or verified RTL codes through type-3 and type-4 comparisons, reducing computational requirements.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If traditional code clone detection methods are used for RTL code, then code fragment identification can be performed, but computational resources required become excessive and efficiency deteriorates

Engineering Contradiction:
Improvecode clone detection efficiencyVSAvoidcomputational resources
Core Design Contradiction:
ProductivityVSUse of energy by moving object

Solution Approach 1:

The patent creates a visual representation (image) of the RTL code structure by extracting constructs and mapping them to a grid system. This visual copy allows for efficient pattern recognition and clone detection through image processing techniques rather than traditional computational analysis, significantly reducing computational resource requirements while maintaining detection accuracy.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent transforms the RTL code from a textual representation into a two-dimensional visual image where code constructs are represented as colored pixels or regions. This dimensional transformation enables the use of image processing algorithms that are computationally more efficient than traditional code analysis methods, thereby improving productivity while reducing energy consumption.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

2Reliability

If traditional code clone detection methods are used, then code verification can be performed, but the complexity of the detection system increases

Engineering Contradiction:
Improvecode verification accuracyVSAvoiddetection system complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent creates a simplified visual model of the RTL code structure by extracting key constructs and representing them in a standardized image format. This visual copy preserves the essential structural information needed for verification while eliminating the complexity of parsing and analyzing the original code syntax, thereby maintaining verification accuracy with reduced system complexity.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent introduces an intermediate visual representation layer between the RTL code and the verification process. This intermediary image format serves as a bridge that simplifies the verification task by converting complex code structures into a format that can be processed by simpler, more reliable algorithms, thus improving reliability without increasing system complexity.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS11429768B2Register transfer level (RTL) image recognition
Publication Date: 2022.08.30 SYNOPSYS INC
  • US11429768B2 patent drawing
  • US11429768B2 patent drawing
  • US11429768B2 patent drawing

AI summary

A method of generating images from Register Transfer Level (RTL) code for clone detection or code verification is provided. The method includes obtaining a first RTL code, extracting first RTL constructs from the first RTL code, generating a first array from the extracted first RTL constructs, generating a first RTL image representation (RIR) image from the generated first array, wherein color in the first RIR image corresponds to values included in the first array, comparing the generated first RIR image to other RIR images to find a portion of an RIR image that matches at least a portion of the generated first RIR image, and determining that the portion of the first RTL code is validated as a result of finding the portion of the RIR image that matches the portion of the generated first RIR images.