Automated HDL Refactoring via Syntax Tree Transformation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current hardware design languages (HDLs) are verbose, error-prone, and require manual modifications, making it difficult and costly to make changes to digital circuit designs, especially for encapsulating legacy code and achieving code reuse, as existing refactoring tools are not applicable to hardware due to fundamental differences between software and hardware design languages.

Innovation Solution

A tool and method for automatically rewriting HDL code by generating a syntax representation, determining modifications to the syntax, and computing textual changes, which includes features like error recovery and a graphical user interface for refactoring operations, allowing for localized and global modifications to HDL code, including encapsulation, adding ports, and correcting semantic errors.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If manual modification of HDL code is performed, then design changes can be made, but it is time consuming and error prone

Engineering Contradiction:
Improvemodification speedVSAvoiderror rate
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent replaces manual mechanical code modification with an automated computational system. The refactoring tool uses a parser to convert HDL code into an abstract syntax tree, applies transformation rules automatically, and generates modified code, eliminating manual typing and reducing errors while increasing modification speed.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Solution Approach 2:

The system performs self-service by automatically analyzing its own input code, generating appropriate transformations, and producing modified output without human intervention in the core refactoring process. The tool maintains design consistency and correctness through automated validation.

Inventive Principle:
Principle #25Self-service

2Quantity of substance

If HDL code is made more concise, then redundancy is reduced, but it becomes harder to read and understand

Engineering Contradiction:
Improvecode volumeVSAvoidcode readability
Core Design Contradiction:
Quantity of substanceVSEase of operation

Solution Approach 1:

The patent changes the parameter of code density by providing transformation rules that selectively remove redundant portions while preserving essential functional elements. The system can adjust the level of conciseness to balance code volume reduction with maintainability requirements.

Inventive Principle:
Principle #35Parameter changes

3Adaptability or versatility

If drastic architectural changes are made near completion, then design flexibility is improved, but it requires manual rewriting of large portions which is time consuming and error prone

Engineering Contradiction:
Improvedesign flexibilityVSAvoidrewriting time
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

Solution Approach 1:

The patent segments the HDL code into modular components represented as nodes in an abstract syntax tree. This segmentation allows targeted refactoring of specific architectural elements without requiring manual rewriting of the entire codebase, reducing time while maintaining flexibility.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system introduces dynamic capabilities by allowing architectural changes to be applied through automated transformations that adapt the code structure in real-time. The refactoring tool can dynamically reorganize modules, adjust interfaces, and update connections without manual intervention.

Inventive Principle:
Principle #15Dynamics

4Adaptability or versatility

If legacy code is encapsulated and parameterized, then code reuse opportunities are improved, but it is prohibitively expensive

Engineering Contradiction:
Improvecode reuse capabilityVSAvoidencapsulation cost
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

Solution Approach 1:

The patent implements nesting by automatically identifying and encapsulating legacy code modules within new parameterized interfaces. The refactoring tool creates hierarchical structures where legacy functionality is nested within reusable components, enabling code reuse without manual encapsulation work.

Inventive Principle:
Principle #7Nested doll (Nesting)

Solution Approach 2:

The system achieves universality by generating parameterized interfaces that can accommodate multiple use cases. The refactoring tool creates generic encapsulations that can be instantiated in different contexts, providing multi-functionality without requiring separate manual encapsulation for each use case.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Data Source

PatentUS8881074B2Device and method for refactoring hardware code
Publication Date: 2014.11.04 SIGASI NV
  • US8881074B2 patent drawing
  • US8881074B2 patent drawing
  • US8881074B2 patent drawing

AI summary

A tool for rewriting hardware design hardware design language (HDL) code is arranged for receiving HDL code (2) expressing a hardware design of a digital circuit. The tool comprises means (4) for generating a representation (6) of the syntax of the received HDL code, the representation containing a plurality of nodes. The tool further comprises means (3) for determining modifications to the representation of the syntax whereby at least one node is added to or removed from the representation and computation means (9) for generating a modified version (10) of the received HDL code using the received HDL code and modifications to the received HDL code, the modifications determined from the modified representation of the syntax.