FLAG: Finding Line Anomalies (in RTL code) with Generative AI. Ahmad, B., Ah-kiow, J., Tan, B., Karri, R., & Pearce, H. ACM Trans. Des. Autom. Electron. Syst., Association for Computing Machinery, May, 2025. Place: New York, NY, USA
Paper doi abstract bibtex Bug detection in Hardware Design Languages (HDLs) is an important problem in the System-on-Chip (SoC) development cycle. It is crucial to find defects at the earliest stage possible. While most fault localization requires the use of ‘tests’ (e.g. test benches, fuzzing and assertions) and a simulation or emulation framework, the advent of Large Language Models (LLMs) provides an opportunity for a test-free fault localization approach. This paper proposes such a tool, called FLAG, which can identify functional and security defects in Register Transfer Level (RTL) code without synthesis or simulation. FLAG combines syntactic and generative AI techniques to implement fault localization in RTL code. It takes an RTL design as an input and outputs a set of line(s) that likely contain defects. It targets elements of RTL code most likely to contain bugs through static analysis means and then implements token-level and line-level analysis to obtain differences in original code and code generated by LLM to identify a line as buggy or not. The token-level approach evaluates each generated token (one at a time) and the line level approach evaluates the entire line generated by the LLM. We evaluate our approach on a corpus of synthetic and real-world bugs, of both functional and security related issues, in Verilog and SystemVerilog. Using line-level analysis, FLAG can identify 38 out of 120 real-world bugs and using token-level analysis, FLAG can identify 32 out of 81 synthetic bugs through the top-5 most likely bug locations identified without tests.
@article{ahmad_flag_2025,
title = {{FLAG}: {Finding} {Line} {Anomalies} (in {RTL} code) with {Generative} {AI}},
issn = {1084-4309},
url = {https://doi.org/10.1145/3736411},
doi = {10.1145/3736411},
abstract = {Bug detection in Hardware Design Languages (HDLs) is an important problem in the System-on-Chip (SoC) development cycle. It is crucial to find defects at the earliest stage possible. While most fault localization requires the use of ‘tests’ (e.g. test benches, fuzzing and assertions) and a simulation or emulation framework, the advent of Large Language Models (LLMs) provides an opportunity for a test-free fault localization approach. This paper proposes such a tool, called FLAG, which can identify functional and security defects in Register Transfer Level (RTL) code without synthesis or simulation. FLAG combines syntactic and generative AI techniques to implement fault localization in RTL code. It takes an RTL design as an input and outputs a set of line(s) that likely contain defects. It targets elements of RTL code most likely to contain bugs through static analysis means and then implements token-level and line-level analysis to obtain differences in original code and code generated by LLM to identify a line as buggy or not. The token-level approach evaluates each generated token (one at a time) and the line level approach evaluates the entire line generated by the LLM. We evaluate our approach on a corpus of synthetic and real-world bugs, of both functional and security related issues, in Verilog and SystemVerilog. Using line-level analysis, FLAG can identify 38 out of 120 real-world bugs and using token-level analysis, FLAG can identify 32 out of 81 synthetic bugs through the top-5 most likely bug locations identified without tests.},
journal = {ACM Trans. Des. Autom. Electron. Syst.},
publisher = {Association for Computing Machinery},
author = {Ahmad, Baleegh and Ah-kiow, Joey and Tan, Benjamin and Karri, Ramesh and Pearce, Hammond},
month = may,
year = {2025},
note = {Place: New York, NY, USA},
keywords = {\#nosource, Fault Localization, GPT, LLM, RTL, Transformers, Verilog},
}
Downloads: 0
{"_id":"Fhy8qHiuCd92eGZLn","bibbaseid":"ahmad-ahkiow-tan-karri-pearce-flagfindinglineanomaliesinrtlcodewithgenerativeai-2025","author_short":["Ahmad, B.","Ah-kiow, J.","Tan, B.","Karri, R.","Pearce, H."],"bibdata":{"bibtype":"article","type":"article","title":"FLAG: Finding Line Anomalies (in RTL code) with Generative AI","issn":"1084-4309","url":"https://doi.org/10.1145/3736411","doi":"10.1145/3736411","abstract":"Bug detection in Hardware Design Languages (HDLs) is an important problem in the System-on-Chip (SoC) development cycle. It is crucial to find defects at the earliest stage possible. While most fault localization requires the use of ‘tests’ (e.g. test benches, fuzzing and assertions) and a simulation or emulation framework, the advent of Large Language Models (LLMs) provides an opportunity for a test-free fault localization approach. This paper proposes such a tool, called FLAG, which can identify functional and security defects in Register Transfer Level (RTL) code without synthesis or simulation. FLAG combines syntactic and generative AI techniques to implement fault localization in RTL code. It takes an RTL design as an input and outputs a set of line(s) that likely contain defects. It targets elements of RTL code most likely to contain bugs through static analysis means and then implements token-level and line-level analysis to obtain differences in original code and code generated by LLM to identify a line as buggy or not. The token-level approach evaluates each generated token (one at a time) and the line level approach evaluates the entire line generated by the LLM. We evaluate our approach on a corpus of synthetic and real-world bugs, of both functional and security related issues, in Verilog and SystemVerilog. Using line-level analysis, FLAG can identify 38 out of 120 real-world bugs and using token-level analysis, FLAG can identify 32 out of 81 synthetic bugs through the top-5 most likely bug locations identified without tests.","journal":"ACM Trans. Des. Autom. Electron. Syst.","publisher":"Association for Computing Machinery","author":[{"propositions":[],"lastnames":["Ahmad"],"firstnames":["Baleegh"],"suffixes":[]},{"propositions":[],"lastnames":["Ah-kiow"],"firstnames":["Joey"],"suffixes":[]},{"propositions":[],"lastnames":["Tan"],"firstnames":["Benjamin"],"suffixes":[]},{"propositions":[],"lastnames":["Karri"],"firstnames":["Ramesh"],"suffixes":[]},{"propositions":[],"lastnames":["Pearce"],"firstnames":["Hammond"],"suffixes":[]}],"month":"May","year":"2025","note":"Place: New York, NY, USA","keywords":"#nosource, Fault Localization, GPT, LLM, RTL, Transformers, Verilog","bibtex":"@article{ahmad_flag_2025,\n\ttitle = {{FLAG}: {Finding} {Line} {Anomalies} (in {RTL} code) with {Generative} {AI}},\n\tissn = {1084-4309},\n\turl = {https://doi.org/10.1145/3736411},\n\tdoi = {10.1145/3736411},\n\tabstract = {Bug detection in Hardware Design Languages (HDLs) is an important problem in the System-on-Chip (SoC) development cycle. It is crucial to find defects at the earliest stage possible. While most fault localization requires the use of ‘tests’ (e.g. test benches, fuzzing and assertions) and a simulation or emulation framework, the advent of Large Language Models (LLMs) provides an opportunity for a test-free fault localization approach. This paper proposes such a tool, called FLAG, which can identify functional and security defects in Register Transfer Level (RTL) code without synthesis or simulation. FLAG combines syntactic and generative AI techniques to implement fault localization in RTL code. It takes an RTL design as an input and outputs a set of line(s) that likely contain defects. It targets elements of RTL code most likely to contain bugs through static analysis means and then implements token-level and line-level analysis to obtain differences in original code and code generated by LLM to identify a line as buggy or not. The token-level approach evaluates each generated token (one at a time) and the line level approach evaluates the entire line generated by the LLM. We evaluate our approach on a corpus of synthetic and real-world bugs, of both functional and security related issues, in Verilog and SystemVerilog. Using line-level analysis, FLAG can identify 38 out of 120 real-world bugs and using token-level analysis, FLAG can identify 32 out of 81 synthetic bugs through the top-5 most likely bug locations identified without tests.},\n\tjournal = {ACM Trans. Des. Autom. Electron. Syst.},\n\tpublisher = {Association for Computing Machinery},\n\tauthor = {Ahmad, Baleegh and Ah-kiow, Joey and Tan, Benjamin and Karri, Ramesh and Pearce, Hammond},\n\tmonth = may,\n\tyear = {2025},\n\tnote = {Place: New York, NY, USA},\n\tkeywords = {\\#nosource, Fault Localization, GPT, LLM, RTL, Transformers, Verilog},\n}\n\n","author_short":["Ahmad, B.","Ah-kiow, J.","Tan, B.","Karri, R.","Pearce, H."],"key":"ahmad_flag_2025","id":"ahmad_flag_2025","bibbaseid":"ahmad-ahkiow-tan-karri-pearce-flagfindinglineanomaliesinrtlcodewithgenerativeai-2025","role":"author","urls":{"Paper":"https://doi.org/10.1145/3736411"},"keyword":["#nosource","Fault Localization","GPT","LLM","RTL","Transformers","Verilog"],"metadata":{"authorlinks":{}}},"bibtype":"article","biburl":"https://api.zotero.org/users/4645877/collections/5QADJUWI/items?key=OGCZ3uLZZq4lLIXadnuJrB1J&format=bibtex&limit=100","dataSources":["Wsv2bQ4jPuc7qme8R"],"keywords":["#nosource","fault localization","gpt","llm","rtl","transformers","verilog"],"search_terms":["flag","finding","line","anomalies","rtl","code","generative","ahmad","ah-kiow","tan","karri","pearce"],"title":"FLAG: Finding Line Anomalies (in RTL code) with Generative AI","year":2025}