RTL Statement Block Encapsulation via Black Box Signal Clustering
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing RTL segmentation tools face difficulties in encapsulating statement blocks with complex structures, leading to irreversible changes in user code and inefficient processing due to the need for deep recursive analysis and syntax parsing, which breaks the original code structure and hinders rapid layout planning.
Innovation Solution
The method involves identifying black box signals as clues to cluster related modules and avoid recursive searches, encapsulating these signals into new modules, and reversing the encapsulation process to restore the original code hierarchy, thus minimizing changes to the user's code and improving processing efficiency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Manufacturing precision
If deep recursive analysis and syntax parsing are performed on composite structures to ensure correct encapsulation, then encapsulation accuracy is improved, but processing time increases and code structure changes become irreversible
Solution Approach 1:
The patent extracts only the necessary port information from statement blocks without performing deep recursive analysis of composite structures. By taking out only the essential encapsulation data (port signals) and leaving the internal composite structure analysis aside, the method achieves accurate encapsulation while avoiding time-consuming deep parsing of nested structures.
Solution Approach 2:
The patent segments the encapsulation process into two parts: (1) extracting port information from statement blocks at the top level, and (2) leaving composite structure analysis for later or skipping it entirely. This segmentation allows the tool to complete encapsulation quickly without getting stuck in deep recursive parsing of complex nested structures.
2Measurement precision
If deep recursive analysis of composite structures is performed to ensure correct parsing, then parsing accuracy is improved, but code structure changes become irreversible and complexity increases
Solution Approach 1:
The patent extracts only the necessary port information from statement blocks without performing deep recursive analysis of composite structures. By taking out only the essential encapsulation data (port signals) and leaving the internal composite structure analysis aside, the method achieves accurate encapsulation while avoiding time-consuming deep parsing of nested structures.
Solution Approach 2:
Instead of starting with deep recursive parsing and then extracting port information, the patent inverts the approach by directly extracting port information from the top level without entering composite structures. This inversion avoids the complexity of building dedicated syntax parsing libraries while still achieving the necessary parsing accuracy for encapsulation.
3Reliability
If statement blocks with composite structures are encapsulated into new modules, then encapsulation completeness is improved, but original code structure is changed irreversibly
Solution Approach 1:
The patent creates simplified copies of statement blocks for encapsulation purposes, extracting only the essential port information and functionality needed for segmentation. These copies are used for RTL-to-hypergraph conversion while the original code structure remains intact and can be restored after segmentation, thus maintaining code structure stability while achieving encapsulation completeness.
Solution Approach 2:
The patent temporarily modifies code structures during the encapsulation process for segmentation purposes, but then recovers and restores the original code structure after segmentation is complete. This allows the tool to achieve complete encapsulation and accurate segmentation while ensuring the user's original code remains unchanged and can be fully recovered.
Data Source
AI summary
Embodiments of the present description provide a statement block encapsulation method and apparatus, an electronic device, and a storage medium, being applied to the technical field of electronic design automation. The encapsulation method comprises: according to a segmentation boundary obtained by an RTL segmentation tool, determining a plurality of statement blocks to be encapsulated; traversing each statement block to be encapsulated, wherein a module where the current statement block to be encapsulated is located is used as the current processing module; and scanning the current processing module, determining whether the current processing module comprises a black box signal, and according to the black box signal, clustering a sub-module and the statement block to perform encapsulation processing. The black box signal is used as a bond to perform encapsulation processing, so that the RTL segmentation tool is suitable for performing encapsulation processing on the sub-modules and the statement blocks under different syntax rules, improving the processing efficiency, and achieving fast layout planning.


