AgRefactor: Self-Evolving Agentic Workflow for HLS Compatibility and Performance
Yang Zou, Zijian Ding, Yizhou Sun, Jason Cong
cs.AI, cs.AR
Submitted: 2026-08-20
Updated: 2026-08-24
Code: https://github.com/lh3/minimap2
License: http://creativecommons.org/licenses/by/4.0/
The gist: High-Level Synthesis (HLS) provides a fast path from concepts to silicon, but converting real-world software into synthesizable HLS code remains challenging due to restrictive language support and
Terminology
Abstract
High-Level Synthesis (HLS) provides a fast path from concepts to silicon, but converting real-world software into synthesizable HLS code remains challenging due to restrictive language support and the gap between software and hardware programming practices. Existing automated and LLM-based refactoring approaches partially address this problem, yet they often lack flexibility, struggle to scale, and incur high computational costs. We introduce AgRefactor, an LLM-based multi-agent workflow for refactoring software into HLS-compatible programs. AgRefactor incorporates a self-evolving memory system that accumulates and retrieves factual and strategic knowledge across tasks, improving robustness and efficiency on unseen programs. To reduce cost and enhance scalability, it integrates automated refactoring tools, enabling agents to balance LLM-driven rewrites with efficient tool-based transformations. On 9 out of 11 challenging real-world benchmarks, which are 5-10x longer than the most complex cases studied in prior work, AgRefactor outperforms or matches the state-of-the-art automated refactoring tool and a strong LLM-based baseline built on the same framework backbone. Further agentic performance optimization yields a 6.51x geometric mean speedup over the SoTA pragma tuning tool and a 1.20x speedup over optimized open-source designs with less than 20% extra resources. AgRefactor is fully-automated and open-sourced.
Sources
- C2HLSC: Can LLMs Bridge the Software-to-Hardware Design Gap?
- Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
- MemGPT: Towards LLMs as Operating Systems
- HippoRAG: Neurobiologically Inspired Long-Term Memory for Large Language Models
- Agent Workflow Memory
- MEMORYLLM: Towards Self-Updatable Large Language Models
- A-MEM: Agentic Memory for LLM Agents
- AlphaEvolve: A coding agent for scientific and algorithmic discovery
Related papers
- MAVEN-T: Reinforced Heterogeneous Distillation for Real-Time Multi-Agent Trajectory Prediction
- Model Discovery Agent: LLM-assisted Bayesian experiment design for data-efficient discovery of mechanistic world models
- Agents' Last Exam
- The Clinician's Veto: Navigating Trust, Liability, and Uncertainty in Autonomous AI Prescribing
- MindHelper: Closed-Loop Embodied Mental-State Reasoning for Precision Intervention
- Incumbent Advantage: Brand Bias and Cognitive Manipulation Dynamics in LLM Recommendation Systems