RTL Agent: An Agent-Based Approach for Functionally Correct HDL Generation via LLMs

LLMs as code generators have undergone rapid progress over the past couple of years. However, the models on their own provide no guarantees for the functional correctness of the generated code. Functional tests can not only be used by designers to assess the functional correctness of code, but also to guide them towards the solution of the problem. The same can be applied to LLMs performing automatic code generation through the use of the Reflexion technique. Reflexion is an agent-based workflow where the model generating code iterates over a loop of code generation, getting feedback from the test bench, reflecting on the feedback, and making appropriate changes to the code. The technique is known to drastically improve the performance of LLMs on software code generation. In this work, we adopt the technique for hardware description language (HDL) code generation as RTL Agent - an implementation of the workflow for Verilog generation with Reflexion. We compare multiple LLMs with standard inference vs with Reflexion on the VerilogEval benchmark. Within 5 iterations of the feedback loop, we observe a relative improvement of 33.2% for the low-performance model Llama3 and an average of 17.7% for the high-performance models GPT-4o and GPT-4o-mini in their Pass@1 performance. We present a cost analysis of the technique to enable cost-performance trade-offs.

Authors

Institutions

Publication Details

Published
2024-12-17
DOI
https://doi.org/10.1109/ats64447.2024.10915277
Citations
3
Primary Topic
Advanced Control Systems Optimization
Type
article
Field-Weighted Citation Impact
0.98

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

RTL Agent: An Agent-Based Approach for Functionally Correct HDL Generation via LLMs

Rui Mao, Debjyoti Bhattacharjee, Erik Cambria, Anupam Chattopadhyay et al.
3 citations
Advanced Control Systems Optimization
0.98
article

RTL Agent: An Agent-Based Approach for Functionally Correct HDL Generation via LLMs

Rui Mao, Debjyoti Bhattacharjee, Erik Cambria, Anupam Chattopadhyay, Sriram Ranga
article en
3 citations

Abstract

LLMs as code generators have undergone rapid progress over the past couple of years. However, the models on their own provide no guarantees for the functional correctness of the generated code. Functional tests can not only be used by designers to assess the functional correctness of code, but also to guide them towards the solution of the problem. The same can be applied to LLMs performing automatic code generation through the use of the Reflexion technique. Reflexion is an agent-based workflow where the model generating code iterates over a loop of code generation, getting feedback from the test bench, reflecting on the feedback, and making appropriate changes to the code. The technique is known to drastically improve the performance of LLMs on software code generation. In this work, we adopt the technique for hardware description language (HDL) code generation as RTL Agent - an implementation of the workflow for Verilog generation with Reflexion. We compare multiple LLMs with standard inference vs with Reflexion on the VerilogEval benchmark. Within 5 iterations of the feedback loop, we observe a relative improvement of 33.2% for the low-performance model Llama3 and an average of 17.7% for the high-performance models GPT-4o and GPT-4o-mini in their Pass@1 performance. We present a cost analysis of the technique to enable cost-performance trade-offs.

Nanyang Technological University (SG), IMEC (BE)
Google
Openalex Percentile: Top 22%
Advanced Control Systems Optimization
0.98
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

RTL Agent: An Agent-Based Approach for Functionally Correct HDL Generation via LLMs — Rui Mao, Debjyoti Bhattacharjee, et al. · (2024) | TGRS Research Map | TGRS