HDL Code Slicing for LLM-Based Static Violation Fixing
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing EDA applications face challenges in efficiently fixing static violations in hardware description language (HDL) code due to the limitations of large language models (LLMs) when processing large code bases, which can lead to incorrect fixes or increased computational resources.
Innovation Solution
The generation of HDL slices, which are subsets of relevant HDL code lines, is used as input for LLMs to address static violations, ensuring the input size remains within the token limit of the LLM and enhances the accuracy and efficiency of the response.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the entire HDL code base is provided to LLMs for fixing static violations, then the LLM can access complete context, but the input size exceeds token limits and computational resources increase significantly
Solution Approach 1:
The patent divides the entire HDL code base into smaller, manageable slices that are relevant to the specific static violation being analyzed. This segmentation allows the LLM to process only the necessary portion of the code (within token limits) while still maintaining the contextual information needed to accurately understand and fix the violation. The system identifies and extracts only the code sections that are directly related to the violation location and its dependencies.
Solution Approach 2:
The patent extracts and isolates the specific code region containing the static violation and its immediate context from the larger code base. By taking out only the relevant code slice rather than processing the entire code base, the system reduces the input size to within LLM token limits while preserving the essential information needed for accurate violation fixing.
2Reliability
If the entire HDL code base is provided to LLMs for fixing static violations, then complete context is available, but computational resources and processing time increase
Solution Approach 1:
The patent segments the code base to process only relevant portions, significantly reducing the computational burden on the LLM. By dividing the code into focused slices around the violation, the system decreases the energy and computational resources required while maintaining the ability to accurately fix violations through contextual analysis.
Solution Approach 2:
The patent applies partial action by providing only the necessary code context (the slice containing the violation and its dependencies) rather than the complete code base. This partial input is sufficient for the LLM to understand and fix the specific violation without the excessive computational cost of processing unnecessary code sections.
3Loss of information
If larger code contexts are provided to LLMs, then more complete information is available for fixing violations, but the token limit is exceeded and processing efficiency decreases
Solution Approach 1:
The patent segments the code base to create focused slices that include the violation location and its immediate dependencies. This segmentation strategy captures the essential context information needed for understanding and fixing violations while keeping each slice within the LLM's token limit, thereby maintaining processing efficiency.
Solution Approach 2:
The patent dynamically adjusts the scope and size of code slices based on the specific violation being analyzed. By changing the parameters of what constitutes relevant context (expanding or contracting the slice boundaries based on violation type and dependencies), the system optimizes the balance between providing sufficient context information and maintaining processing efficiency within token limits.
Data Source
AI summary
Analysis may be performed on hardware description language (HDL) code to identify a violation, where the HDL code may describe an IC design, and where the violation may specify a line in the HDL code. The HDL code may be parsed to obtain a digital representation of the IC design. Connectivity information and semantic information of objects in the digital representation may be determined. A first object in the digital representation may be determined which corresponds to the line in the HDL code. The connectivity information and the semantic information may be used to identify a set of objects in the digital representation which are related to the first object. A set of lines in the HDL code may be selected which correspond to the set of objects in the digital representation.


