Structure-augmented LLMs for High-Level Synthesis Pragma Optimization
Haocheng Xu, Ye Qiao, Phyo Pyae Moe Aung, Alok Mishra, Pavana Prakash, Rolando Pablo Hong Enriquez, Adam Han Wu, Zhiheng Chen, Dejan Milojicic, Sitao Huang
Abstract
Pragma insertion drives the quality of high-level synthesis (HLS) designs. Choosing the right directives demands expert knowledge and reasoning about loop nesting, data dependences, and memory layout. While existing large language models (LLMs) show promise in code generation, they lack explicit program-structure awareness, limiting their ability to suggest effective pragmas. We present PRISM, a novel structure-augmented LLM that closes this gap by adding compiler-grade structural reasoning to a pretrained, frozen code LLM. It combines three hierarchical program representations, Abstract Syntax Tree (AST), Control-Flow Graph (CFG), and Data-Flow Graph (DFG), injecting them into a specific transformer layer while keeping original code tokens in a separate stream. The cross-attention gate at the injection point allows falling back to the pretrained representation when its structural signal is unhelpful. On zero-shot evaluation in HLS-Eval, PRISM synthesizes 3.5× as many kernels as Llama3-8B (26.9\% vs. 7.7\%), and on the kernels where it does succeed, it produces designs that are 2.31× faster (geomean) than GPT-5-mini's. In the agentic flow, the PRISM codegen outperforms other baselines when optimizing complex code and drives the average normalized improvement across the HLS-Eval suite to 26.4\%.
Create a lesson
Related papers
SyntheticHLS: Building Diverse Synthetic High-Level Synthesis Datasets using LLMs
Shared title terminology · Stefan Abi-Karam, Miaoyan Zhou, Callie Hao
Native FPGA Hard-Block Implementation from High-Level Synthesis
Shared title terminology · Mohamed Bouaziz, Mahmoud A. Elshenawy, Krishnan B. Iyer et al.
An ASIC Design Flow for High-Level Synthesis of Asynchronous Circuits
Shared title terminology · Mayuresh Warunjikar, Madhav Desai
Low-level optimizations in high-level HDLs: Is there a benefit?
Shared title terminology · Oliver Keszocze, Tjark Petersen, Arved Friedemann et al.
Integrating Approximate Logic Synthesis into Approximate High-Level Synthesis
Shared title terminology · Jian Shi, Ruicheng Dai, Chang Meng et al.
RTLREX: LLM-Guided Framework for Exact High-Level RTL Recovery
Shared title terminology · Wuqian Tang, Fangzhou Liu, Ruijie Wang et al.