🤖 AI Summary
This work addresses the challenge of optimizing register-transfer level (RTL) designs with long contexts, which are difficult for large language models (LLMs) to handle effectively due to their structural complexity and insufficient modularity. To overcome this, the authors propose a graph similarity–guided multi-agent LLM framework comprising three collaborative agents—partitioning, optimization, and reconstruction—that jointly perform structure-aware RTL optimization. The approach innovatively integrates abstract syntax tree (AST) graph similarity analysis with multimodal retrieval-augmented generation (RAG), introduces a logic-aware submodule reorganization mechanism, and employs a Graph-RAG prompting strategy. Evaluated on industrial-scale long-context RTL code, the method significantly improves optimization efficiency while preserving functional equivalence, thereby effectively bridging the gap between academic research and practical hardware design.
📝 Abstract
Large Language Models (LLMs) show great promise in RTL code generation and optimization. However, real-world RTL designs are typically long, entangled, and poorly modularized, posing a major challenge due to context-length limitations and lack of structure. To overcome these obstacles, we propose a scalable LLM-based RTL optimization framework guided by graph similarity. Our method introduces three collaborative agents: (1) a Partition Agent that decomposes RTL designs into semantically meaningful AST subtrees, guided by AST graph similarity to reusable design templates; (2) an Optimization Agent that generates RTL submodule code based on partitioned subtrees using multi-modal Retrieval-Augmented Generation (RAG) with both AST and RTL guidance; and (3) a Reconstruction Agent that reassembles optimized submodules based on logic-aware ordering and Graph-RAG prompting, ensuring global functional equivalence. Together, these components enable robust, structure-aware optimization of long-context RTL designs, bridging the gap between toy examples and industrial-scale hardware codebases.