WorksComputer Science
LLM-Assisted Verilog Code Refinement for Efficient RTL Clock Gating
Abstract
RTL clock gating is a popular technique for reducing clock power at the early design stage. Iterative updates of Verilog code, clock-gating inference, and analysis of clock-gating efficiency (CGE) are time-consuming and pose challenges to RTL designers. LLM-assisted automatic refinement of Verilog code for improving CGE is proposed. Since CGE and power depend on switching activity, LLMs generate Idle, Typical, and Peak workloads of the design, one of which is selected by the user as the optimization target. Four LLM clock-gating agents, each given a guideline for a particular clock-gating technique, then sequentially refine the Verilog code, focusing on the registers with low flop-gating efficiency (FGE) under the selected workload. Code updates are accepted only if they are functionally equivalent and reduce post-synthesis power without violating area and timing constraints. Experimental results with five RTL designs show an average FGE improvement of 12.1 percentage points and an average power reduction of 23.6% (up to 59.3%) under the selected workloads, compared to the original Verilog code, outperforming a commercial tool and an LLM baseline, which achieve average power reductions of only 4.1% and 8.6%, respectively.
Introduction
RTL clock gating is a popular method to reduce clock power consumption through RTL design. A gating condition is written in RTL code, so that synthesis tools can infer integrated clock-gating (ICG) cells from it. Figure 1(a) illustrates a load-enable register, a frequent target of clock gating; it can easily be identified from the Verilog code and is implemented through a feedback multiplexer or by using an ICG cell if clock gating is inferred. Another example of RTL clock gating is a combinational loop shown in Figure 1(b), where the gating condition is extracted whereas the condition is explicit in the example of Figure 1(a).
Figure 1. Clock-gating inference: (a) load-enable register and (b) combinational loop.
After logic synthesis with clock-gating inference, the efficiency of clock gating can be assessed through a number of measures [4]. Clock-gating ratio (CGR) is popular; it represents the percentage of flops connected to ICG cells or, equivalently, the percentage of flops whose clock can be gated. Flop-gating efficiency (FGE) denotes the percentage of cycles when a particular flop is clock-gated under a given switching activity, represented by FSDB or VCD.
Clock-gating efficiency (CGE), either CGR or FGE or both, is often not high enough [11], in particular at the early stage of RTL design. To improve CGE at the RTL level, one of the popular options that commercial tools take [1, 6] is observability don't care (ODC) [3]. ODC identifies when a register’s output is not utilized by downstream logic, which becomes a clock-gating condition. However, many other gating opportunities are missed, especially when a register’s output is observable but kept unchanged. Commercial tools can identify such registers, but they do not support automatic RTL correction.
Motivations
The actual RTL modification to improve CGE still relies on the designer [23]. Developing effective gating functions requires an
This work is licensed under a Creative Commons Attribution 4.0 International License. ASPDAC ’27, Tokyo, Japan © 2027 Copyright held by the owner/author(s). ACM ISBN 978-4-8007-2923-2/2027/01 https://doi.org/10.1145/3840404.3860925 iterative process of code update and CGE analysis, which is time-consuming and demands a substantial understanding of both circuit functionality and switching activity.
Large language models (LLMs) offer a promising alternative, as they can comprehend the functionality of Verilog code and modify it accordingly. Applying LLMs to RTL clock gating, however, poses two challenges. First, appropriate switching activity for FGE and power analysis is often unavailable, leaving LLMs unable to identify clock-gating opportunities. Although functional verification testbenches provide a convenient source of switching activity, they aim to cover as much design functionality as possible rather than reflect how the design is actually used. Second, LLMs lack expertise in RTL clock gating; as demonstrated in § 3.2 and § 3.4, they fail to apply clock-gating techniques effectively without explicit guidance or when all techniques are provided at once.
This paper proposes an LLM-assisted refinement of Verilog code to improve CGE. LLMs first generate workloads representing specific usage scenarios [7], i.e., Idle, Typical, and Peak, so that the refinement is guided by switching activity under the intended scenario. The refinement is then performed by four LLM clock-gating agents, each specialized in a single clock-gating technique.
Proposed Method
As illustrated in Figure 2, given the RTL design and its specification, an LLM generates transactions, each representing one type of operation of the design (e.g., encrypting a data block in AES), and combines them into three workloads representing usage scenarios (Idle, Typical, and Peak). Each workload is implemented as a Verilog testbench (or a C program for processors), whose simulation yields switching activity for each scenario. The switching activity of a user-selected target workload is used to evaluate FGE and power during RTL refinement.
Figure 2. Proposed flow for RTL clock gating.
The RTL design is then refined by four LLM-based clock-gating agents, each responsible for a different clock-gating technique. The agents operate sequentially, and each agent starts from the most recently accepted RTL. To help identify clock-gating opportunities, each agent is given a guideline for its technique and the 20 register groups with the highest waste scores under the target workload. Since practical designs are large and hierarchical, each agent iteratively invokes tools to read and modify Verilog code and to query
the switching activity and FGE of selected registers. Once the agent has applied its technique to all applicable parts of the design, it submits the modified RTL for verification.
The submitted RTL is checked for functional equivalence against the original RTL. Once equivalence is verified, the RTL is synthesized, and the netlist is simulated under the target workload to evaluate power and FGE. The refined design is accepted only if it reduces power and satisfies the area and timing constraints. Any equivalence or PPA check failure triggers a feedback loop, providing the agent with error messages or evaluation reports to guide correction. If the RTL is not accepted within ten submissions, the agent’s changes are discarded. This process is repeated for all agents.
LLM-Assisted RTL Clock Gating
Switching Activity Generation
As illustrated in Figure 3(a), each transaction is described in JSON, specifying its name, arguments with their types and bit-widths, and a natural-language description of input port signals for each clock cycle. For example, the AES encoder has two transactions: encrypt(data, key) for encrypting a data block and wait(n) for keeping the inputs inactive for a specified number of cycles. For each transaction, the LLM then generates a Verilog driver that converts its arguments into the corresponding input port values for each clock cycle. For processors, it instead generates a C function executed by the core.
Figure 3. Workload generation for the AES encoder: (a) a transaction described in JSON and its Verilog driver, and (b) workloads composed of transactions.
The generated transactions are then used to construct workloads for three usage scenarios (Idle, Typical, and Peak), defined by how the wait transaction, common to all designs, is used. Idle consists only of wait, Typical interleaves wait with other transactions to represent typical usage, and Peak executes transactions back-to-back without wait at the fastest rate permitted by the design. Given these descriptions and the available transactions, the LLM generates a workload for each scenario by determining the order, arguments, and number of repetitions of transactions. Figure 3(b) illustrates the three workloads generated for the AES encoder. Each workload is then written as a Verilog file that executes its transaction sequence using the corresponding drivers, or as a C program for processors. Simulating the RTL design with the three workloads yields switching activity under each usage scenario.
LLM-Agents for Clock Gating
Once the user selects the target workload used to measure CGE and power, the Verilog code is refined. Since clock gating involves various implementation techniques, multiple agents are employed, each focusing on one technique. Each agent examines whether its technique is applicable and refines the code accordingly.
Agent Role Design
Agent-1 aims to transform the non-load-enable registers, which are not clock-gated, into load-enable ones. Assume a register with input signal ; assume also that is conditionally valid. The goal of this agent is to extract such condition, and convert into a load-enable register while the condition is used for the gating function.
Agent-2 tries to refine the enable condition of load-enable register. Note from Figure 4(a) that the clock can be gated (EN = 0) more often if EN becomes more restrictive and becomes 1 less frequently.
Figure 4. Clock gating of binary counter: (a) the whole register is gated and (b) the register is divided into two smaller ones, each gated separately.
This is possible if EN is ANDed with additional conditions under which the register retains its current value.
Agent-3 targets registers whose bits exhibit non-uniform switching activities and divides them into smaller registers, each containing bits with similar switching activities and gated separately. An example is illustrated in Figure 4(a) for an 8-bit binary counter (). Using a single gating function for causes unnecessary clock activity in the upper bits, because the lower bits toggle frequently while the upper bits toggle much less. Agent-3 may propose separate gating functions for and , so that is loaded only when contains 4’b1111, as shown in Figure 4(b).
Agent-4 modifies datapath computations to eliminate unnecessary register updates and improve clock gating. Figure 5(a) shows an example of shift-and-add multiplication, where is a multiplier and is a multiplicand. Register is loaded in two branches, so its enable condition is the OR of the two corresponding branch conditions. In Figure 5(b), is not loaded in the second branch; instead, it is shifted by positions when added to the partial product. Its enable condition then follows only the first branch and becomes more restrictive, allowing its clock to be gated more often.
Figure 5. Change in the gating condition for mcand through datapath restructuring in shift-and-add multiplication: (a) start | !done and (b) start.
Agent Prompt and Tool Design
Each agent prompt consists of a system prompt and a user prompt. The system prompt includes (1) a clock-gating guideline describing the agent’s technique with Verilog examples, (2) rules such as preserving functional correctness and satisfying area and timing constraints, and (3) descriptions of the available tools. The user prompt consists of (1) an instruction to reduce power consumption through RTL clock gating and (2) a register activity table under the target workload.
The activity table lists the register groups most likely to benefit from clock gating, ranked by a waste score. The score favors wide registers clocked far more often than their values change, and is defined as , where is the total number of flip-flop bits in a register group and is the fraction of cycles in which the register value changes under the target workload; thus, approximates the fraction of cycles in which the register is clocked without changing its value. The 20 register groups with the highest waste scores are included in the table, along with their module paths, bit widths, switching activity, and FGE. Each agent iteratively refines the RTL design by invoking tools to inspect and edit Verilog files and to query detailed switching activity and FGE of individual registers, including those omitted from the activity table. Once the agent completes its refinement, it submits the modified RTL for verification and evaluation, as described in § 2.3.
RTL Verification and Evaluation
Sequential equivalence checking via [15] verifies the submitted RTL against the original design. If the check fails, the error messages are fed back to the agent, along with the previous prompt-response interaction, for revision.
The verified RTL is then synthesized and simulated with the testbench for the target workload (§ 2.1) to evaluate power and FGE. It is accepted only if (1) its power is lower than that of the previously accepted design, (2) its area overhead relative to the original design does not exceed 10%, and (3) it meets timing at the target clock period after synthesis (WNS ). Otherwise, the design is restored to the previously accepted one, and the agent receives the rejection reason and evaluation reports. If no submission is accepted within ten attempts, the agent’s changes are discarded.
Once an agent finishes, the next agent starts from the most recently accepted RTL. The process continues until all four agents have completed their refinement, and the last accepted RTL becomes the final design.
Experimental Results
We evaluate five RTL designs listed in Table 1: AES encoder, AES decoder, UART, SD card controller, and RISC-V core. Four designs are taken from [12], and UART from [9]. The designs are not modified to expose clock-gating opportunities, except for minor fixes for tool compatibility.
Table 1. Benchmark designs.
The entire flow in Figure 2 is automated using Python scripts, with Claude Sonnet 5.5 [2] (medium reasoning effort) as the LLM. Verilog simulation [17] is performed with each LLM-generated workload to generate an FSDB, from which the FGE of the RTL design is estimated using [4]. Each RTL design is then synthesized using [18] with a 14-nm standard-cell library [16], applying compile_ultra -gate_clock and set_clock_gating_style -minimum_bitwidth 3, with the target clock period set to 1.2 times the critical path delay of the original design. The netlist is simulated again with the same workload, and the resulting FSDB is used to measure FGE using [21] and, after conversion to SAIF, to estimate dynamic power using [19]. For the RISC-V core, the power of the SRAM, modeled using [5], is excluded to focus on logic power.
LLM-Generated Workloads
For each design, the LLM generates Idle, Typical, and Peak workloads as described in § 2.1. To verify that each workload represents its intended usage scenario (Idle issues no requests, Typical interleaves requests with idle intervals, and Peak issues requests back-to-back), Table 2 reports the number of transaction types, the total number of transactions, the number of simulated cycles, the fraction of active cycles, and code coverage of each workload. An active cycle is a cycle in which the design is processing a request, from its acceptance to its completion. For the RISC-V core, active cycles are measured as cycles outside WFI-based sleep periods.
| Design | Workload | Transactions Types (#) | Transactions Total (#) | Simulated cycles Total (K) | Simulated cycles Active (%) | Code coverage Line (%) | Code coverage Toggle (%) |
| AES encoder | Idle | 1 | 1 | 0.2 | 0 | 55 | 73 |
| AES encoder | Typical | 2 | 22 | 0.4 | 38 | 71 | 89 |
| AES encoder | Peak | 1 | 16 | 0.2 | 100 | 45 | 86 |
| AES encoder | All | 2 | 39 | 0.8 | 45 | 90 | 89 |
| AES decoder | Idle | 1 | 1 | 0.1 | 0 | 45 | 69 |
| AES decoder | Typical | 3 | 18 | 0.3 | 46 | 74 | 89 |
| AES decoder | Peak | 1 | 16 | 0.2 | 100 | 56 | 86 |
| AES decoder | All | 3 | 35 | 0.7 | 52 | 93 | 90 |
| UART | Idle | 1 | 1 | 5.0 | 0 | 29 | 1 |
| UART | Typical | 3 | 24 | 4.4 | 43 | 52 | 38 |
| UART | Peak | 2 | 24 | 3.7 | 97 | 52 | 39 |
| UART | All | 3 | 49 | 13.1 | 42 | 52 | 41 |
| SD card controller | Idle | 1 | 1 | 100.0 | 0 | 16 | 1 |
| SD card controller | Typical | 5 | 21 | 27.8 | 63 | 70 | 48 |
| SD card controller | Peak | 2 | 11 | 26.5 | 98 | 70 | 47 |
| SD card controller | All | 5 | 33 | 154.4 | 28 | 70 | 49 |
| RISC-V core | Idle | 1 | 1 | 20.0 | 0 | 25 | 0 |
| RISC-V core | Typical | 4 | 23 | 89.0 | 51 | 74 | 55 |
| RISC-V core | Peak | 1 | 1 | 5.6 | 100 | 62 | 38 |
| RISC-V core | All | 5 | 25 | 114.5 | 44 | 74 | 56 |
Table 2. Workloads generated by the LLM.
For the non-processor designs, the LLM composes the Idle workload using only the wait transaction, whereas it uses the largest number of transaction types (2–5) for the Typical workload. For the Peak workload, it uses fewer types (1–2), repeating only the main operations. For the RISC-V core, the LLM generates a C program whose transactions are C functions, including control-oriented routines (e.g., sorting) and an ALU-intensive kernel (e.g., matrix multiplication), while wait is implemented as WFI-based sleep.
Active cycles account for 0%, 38–63%, and 97–100% of the Idle, Typical, and Peak workloads across the five designs, showing that the generated workloads reflect the distinct activity levels of the three scenarios. For Peak, the LLM also selects argument values that maximize the operating rate (e.g., a baud divisor of 1 for UART). Combining the workloads of all scenarios, the five designs achieve 52–93% line coverage, excluding the reset and configuration phases. The lowest value is for UART, whose reset and configuration code is executed only outside the measured workloads; including the entire simulation raises its coverage to 82%.
FGE Improvement and Power Reduction
The proposed method (§ 2.2) refines the RTL with four agents, each specialized in one clock-gating technique, using guidelines and the 20 most promising candidates ranked by waste score (§ 2.2.2). We compare it with two baselines: a commercial tool [14] that automatically applies stability-based clock gating (gating a register when its input remains unchanged) and ODC-based clock gating (when its output is not observed), and an LLM baseline in which a single agent receives the same candidates but no technique-specific guidelines, with all other settings unchanged. The two LLM-based methods are run three times per target workload and averaged, whereas the commercial tool is run once. Each refined design is implemented through CTS [20] and evaluated under its target workload.
As shown in Table 3, the proposed method improves FGE and reduces power for all designs and target workloads, by 23.6% on average and up to 59%, with an area overhead of at most 2.9%; WNS after CTS is negative only for the SD card controller refined for Idle (−4 ps). In contrast, the commercial tool succeeds only for UART, and the LLM baseline only for the AES decoder and UART, reducing power by 4.1% and 8.6% on average, respectively.
| Design | Target workload | Original CGR (%) | Original FGE (%) | Original Pwr (μW) | Original Area (μm²) | Original WNS (ps) | Commercial tool [14] ΔCGR (%) | Commercial tool [14] ΔFGE (%) | Commercial tool [14] ΔPwr (%) | Commercial tool [14] ΔArea (%) | Commercial tool [14] WNS (ps) | Commercial tool [14] Time (min) | LLM baseline ΔCGR (%) | LLM baseline ΔFGE (%) | LLM baseline ΔPwr (%) | LLM baseline ΔArea (%) | LLM baseline WNS (ps) | LLM baseline Time (min) | Multi-agent (Proposed method) ΔCGR (%) | Multi-agent (Proposed method) ΔFGE (%) | Multi-agent (Proposed method) ΔPwr (%) | Multi-agent (Proposed method) ΔArea (%) | Multi-agent (Proposed method) WNS (ps) | Agent | Multi-agent (Proposed method) Time (min) |
| AES encoder | Idle | 25 | 25 | 3,722 | 3,113 | 57 | 0 | 0 | 0 | 0.0 | 57 | 1 | 0 | 0 | 0 | 0.0 | 57 | 0 | +48 | +48 | −59 | +0.5 | 47 | 1 | 84 |
| AES encoder | Typical | 25 | 24 | 3,761 | 0 | 0 | 0 | 0.0 | 57 | 1 | 0 | 0 | 0 | 0.0 | 57 | 0 | +48 | +40 | −50 | −0.1 | 42 | 1 | 34 | ||
| AES encoder | Peak | 25 | 22 | 3,811 | 0 | 0 | 0 | 0.0 | 57 | 1 | 0 | 0 | 0 | 0.0 | 57 | 0 | +48 | +28 | −23 | +0.2 | 58 | 1, 4 | 28 | ||
| AES decoder | Idle | 81 | 75 | 3,702 | 5,270 | 73 | 0 | 0 | 0 | 0.0 | 73 | 5 | +7 | +7 | −35 | −0.3 | 23 | 6 | +7 | +13 | −38 | −0.1 | 21 | 1, 2 | 14 |
| AES decoder | Typical | 81 | 75 | 3,840 | 0 | 0 | 0 | 0.0 | 73 | 5 | +7 | +7 | −30 | −0.3 | 23 | 6 | +7 | +10 | −31 | +0.1 | 43 | 1, 2 | 12 | ||
| AES decoder | Peak | 81 | 75 | 4,189 | 0 | 0 | 0 | 0.0 | 73 | 1 | +7 | +7 | −30 | −0.3 | 23 | 6 | +7 | +7 | −28 | −0.2 | 18 | 1 | 7 | ||
| UART | Idle | 80 | 73 | 600 | 1,094 | 142 | +7 | +14 | −27 | +6.8 | 156 | 4 | +5 | +5 | −20 | +0.6 | 138 | 9 | +7 | +7 | −26 | +0.1 | 154 | 1–3 | 30 |
| UART | Typical | 80 | 73 | 614 | +2 | +7 | −19 | +5.5 | 147 | 4 | 0 | 0 | 0 | 0.0 | 142 | 6 | +9 | +10 | −41 | +0.3 | 156 | 1–4 | 27 | ||
| UART | Peak | 80 | 72 | 636 | +7 | +9 | −16 | +4.3 | 149 | 4 | +5 | +3 | −14 | +0.6 | 138 | 10 | +7 | +7 | −19 | +2.9 | 170 | 1–4 | 30 | ||
| SD card controller | Idle | 95 | 85 | 1,073 | 3,907 | 140 | 0 | 0 | 0 | 0.0 | 140 | 5 | 0 | 0 | 0 | 0.0 | 140 | 5 | 0 | +4 | −16 | +0.4 | −4 | 1, 2, 4 | 48 |
| SD card controller | Typical | 95 | 85 | 1,089 | 0 | 0 | 0 | 0.0 | 140 | 6 | 0 | 0 | 0 | 0.0 | 140 | 6 | 0 | +2 | −3 | 0.0 | 45 | 3 | 31 | ||
| SD card controller | Peak | 95 | 85 | 1,093 | 0 | 0 | 0 | 0.0 | 140 | 6 | 0 | 0 | 0 | 0.0 | 140 | 6 | 0 | +2 | −6 | +0.5 | 91 | 2 | 24 | ||
| RISC-V core | Idle | 97 | 97 | 26 | 50,048 | 1,792 | 0 | 0 | 0 | 0.0 | 1,792 | 2 | 0 | 0 | 0 | 0.0 | 1,792 | 0 | 0 | +1 | −6 | 0.0 | 1,855 | 1 | 20 |
| RISC-V core | Typical | 97 | 92 | 99 | 0 | 0 | 0 | 0.0 | 1,792 | 2 | 0 | 0 | 0 | 0.0 | 1,792 | 1 | 0 | +2 | −3 | 0.0 | 1,653 | 1, 2, 4 | 54 | ||
| RISC-V core | Peak | 97 | 88 | 192 | 0 | 0 | 0 | 0.0 | 1,792 | 4 | 0 | 0 | 0 | 0.0 | 1,792 | 0 | 0 | +2 | −4 | 0.0 | 1,834 | 1 | 29 |
Table 3. Post-CTS CGR, FGE, power, area, and WNS under the target workload for three RTL refinement methods: commercial tool vs. LLM baseline vs. proposed method (averaged over three runs, except for the commercial tool, which is run once; WNS: worst of the three runs; Agent: clock-gating agents whose refinements are accepted)
Even for UART, the commercial tool generates gating conditions by adding comparators and flip-flops that detect whether a register input remains constant; the 32-bit register that latches bus write data is gated only when its input remains zero for two consecutive cycles. For the same register, both LLM-based methods derive the gating condition from the existing bus control signals and , which indicate when the input is valid, resulting in smaller area overheads (at most 0.6% and 2.9% vs. 4.3–6.8%). The proposed method also achieves comparable or larger power reductions (26%, 41%, and 19% vs. 27%, 19%, and 16% under Idle, Typical, and Peak).
Although the LLM baseline receives the same candidates, all of its refinements are limited to converting registers into load-enable registers, the most common technique (Agent-1). For the RISC-V core, for example, it concludes that the cycle counter cannot be gated because its value changes every cycle, whereas the proposed method splits the counter and gates its upper bits, which toggle much less often than the lower bits. As shown in Table 3, the proposed method applies various techniques across the designs, suggesting that, without explicit guidelines, an LLM rarely explores techniques beyond adding an enable.
All designs refined by the proposed method are functionally equivalent to the originals, whereas some refinements by the commercial tool, e.g., for the AES decoder, are rejected because their equivalence cannot be verified. However, equivalence checking and synthesis dominate the runtime, which reaches up to 84 minutes.
Impact of Target Workload
The proposed refinement is tailored to a target workload in two ways: the agents receive the 20 most promising candidates ranked by waste score under that workload (§ 2.2.2), and a refined design is accepted only if it reduces power under the same workload (§ 2.3). To examine the impact of this targeting, we also evaluate each design refined in Table 3 under the two non-target workloads. Table 4 lists all registers whose FGE improves under at least one target workload, along with their original FGE, and Table 5 reports the resulting power changes.
| Design | Register (#FFs) | Original FGE (%) I | Original FGE (%) T | Original FGE (%) P | FGE improved under target I | FGE improved under target T | FGE improved under target P |
| AES enc. | State (16×8) | 0 | 0 | 0 | ✓ | ✓ | ✓ |
| AES enc. | Output fetch (128) | 0 | 0 | 0 | ✓ | ✓ | ✓ |
| AES dec. | Key expansion (140) | 0 | 0 | 0 | ✓ | ✓ | ✓ |
| AES dec. | Round key (4×32) | 0 | 7 | 15 | ✓ | ✓ | ✓ |
| UART | Bus write data (32) | 0 | 0 | 0 | ✓ | ||
| UART | Divisor counter (16) | 0 | 0 | 0 | ✓ | ||
| SD ctrl. | Cmd. output buffer (40) | 0 | 0 | 0 | ✓ | ✓ | ✓ |
| SD ctrl. | Cmd. CRC (8) | 0 | 0 | 0 | ✓ | ✓ | |
| SD ctrl. | Cmd. argument (32) | 0 | 60 | 98 | ✓ | ||
| SD ctrl. | DMA address (32) | 0 | 60 | 98 | ✓ | ||
| RISC-V | Cycle counter (32) | 0 | 0 | 0 | ✓ | ✓ | ✓ |
| RISC-V | Retired-instr. counter (32) | 100 | 57 | 3 | ✓ | ✓ | ✓ |
Table 4. Register-level FGE improvement under different refinement targets: original FGE (%) under Idle/Typical/Peak (I/T/P) and whether FGE improved for each target workload (✓: improvement in the majority of runs)
| Design | Refinement target workload | Evaluation workload | |||
| Idle | Typical | Peak | |||
| AES enc. | Idle | −59.3 | −43.3 | −17.6 | |
| Typical | −68.4 | −50.4 | −20.7 | ||
| Peak | −67.7 | −50.7 | −22.6 | ||
| AES dec. | Idle | −38.4 | −30.6 | −29.1 | |
| Typical | −38.6 | −30.7 | −29.1 | ||
| Peak | −32.5 | −27.9 | −28.1 | ||
| UART | Idle | −25.9 | −25.2 | −20.1 | |
| Typical | −42.1 | −40.8 | −36.1 | ||
| Peak | −20.6 | −20.1 | −19.3 | ||
| SD ctrl. | Idle | −15.7 | −7.7 | −2.8 | |
| Typical | −3.8 | −3.4 | −3.3 | ||
| Peak | −6.5 | −6.2 | −6.0 | ||
| RISC-V | Idle | −6.1 | −0.9 | 0.0 | |
| Typical | −4.9 | −3.1 | −2.6 | ||
| Peak | −12.5 | −5.1 | −3.6 |
Table 5. Post-CTS power changes (%) of designs refined for different target workloads, evaluated under all three workloads (gray: target = evaluation workload; bold: largest power reduction for each evaluation workload)
As shown in Table 4, registers with zero original FGE under all workloads, such as the AES state and the RISC-V cycle counter, are gated regardless of the target. In contrast, registers whose FGE varies across workloads are gated only when the target workload is one under which their FGE is low. For example, the command argument and DMA address registers of the SD card controller have FGE of 0%, 60%, and 98% under Idle, Typical, and Peak, and thus are gated only when targeting Idle. Conversely, the RISC-V retired-instruction counter is already fully gated under Idle (100%) and is therefore gated only when targeting Typical or Peak.
As shown in Table 5, every refined design reduces or maintains power under all workloads, since most gated registers have low FGE under all workloads. Thus, a design that gates registers missed by other targets can perform best even under non-target workloads: refining for the evaluation workload itself yields the largest reduction in only 6 of the 15 cases. For example, the SD card controller refined for Idle, the only one that gates the command argument and DMA address registers, performs best under Idle and Typical, and the UART refined for Typical does so under all three workloads. This suggests that, since each target exposes different opportunities (e.g., different counters in UART), combining candidates from multiple workloads may further improve refinement.
Ablation Study: Multi-Agent Refinement
To evaluate the effectiveness of multiple agents, we compare the proposed method with two single-agent variants, with all other settings unchanged: one can read each technique-specific guideline
from a separate skill document on demand, and the other receives all four guidelines in its prompt. Each variant is run once for each of the 15 cases, i.e., the five designs refined for each of the three target workloads, and the results of the proposed method are taken from Table 3.
As shown in Table 6, the single agent with skill documents refines only 7 of the 15 cases, improving FGE by 2.1% and reducing power by 10.1% on average. Although the agent is explicitly instructed on the availability of the skill documents and how to read them, it never opens them in any of the 15 runs. The single agent with all guidelines in its prompt refines 9 cases, improving FGE by 2.3% and reducing power by 8.5%. It applies at most one technique per run, mostly load-enable conversion (Agent-1; 8 of the 15 runs) and rarely the others (Agent-2, -3, and -4 in 1, 3, and 0 runs, respectively). Both ignoring the skill documents and applying only one technique stem from LLM laziness [13, 27], where the model neglects some instructions. In contrast, the proposed method assigns a dedicated agent to each technique, so that all four techniques are explored and contribute to the improvement (Table 3).
| Single agent + Skill | Single agent + Prompt | Multi-agent + Prompt (Proposed) | |
| Average ΔFGE (%) | +2.1 | +2.3 | +12.1 |
| Average ΔPower (%) | −10.1 | −8.5 | −23.6 |
| Refined cases | 7/15 | 9/15 | 15/15 |
Table 6. Comparison of three agent configurations: single agent with skill documents vs. single agent with guidelines in the prompt vs. multiple agents (proposed method)
Related Works
Recent studies have explored LLM-assisted RTL refinement by improving LLM capabilities or guiding their RTL modifications. One study fine-tunes an LLM through direct preference optimization using functionally equivalent RTL designs ranked by user-weighted PPA costs [26], while another uses reinforcement learning with advantages computed from correctness checks and PPA ratios relative to a reference design [10].
Other studies guide existing LLMs in RTL optimization. An LLM is given post-synthesis reports, PPA objectives, and optimization techniques (e.g., clock gating), from which it selects techniques [22]. Monte Carlo tree search is used to select retrieved optimization instructions, algorithms, and code examples for RTL rewriting [25], while retrieval-augmented generation is used to select optimization rules and generate AST-based transformations [24]. Multiple agents also collaborate on planning, RTL rewriting, and evaluation [8].
For low-power RTL design, however, two aspects remain underexplored. First, prior work has not investigated how to generate switching activity reflecting actual usage scenarios for RTL refinement. Second, while existing approaches provide multiple optimization techniques together, how to effectively guide LLMs in applying individual clock-gating techniques remains unclear.
Conclusion
We have presented LLM-assisted refinement of Verilog code to improve CGE. LLMs generate Idle, Typical, and Peak workloads to obtain switching activity under each usage scenario, and the registers with low FGE under the selected workload are provided as candidates. Four LLM clock-gating agents, each given a guideline for a different clock-gating technique, then sequentially refine the code. A code update is accepted only if it is functionally equivalent and reduces power without violating area and timing constraints.
Experimental results with five RTL designs have demonstrated an average FGE improvement of 12.1%p and an average power reduction of 23.6% (up to 59.3%) after CTS under the selected workloads, outperforming a commercial tool and an LLM baseline (4.1% and 8.6%). The results also show that the selected workload determines which registers are gated, and that a single agent given all guidelines neglects some techniques, which dedicated agents avoid.
References
- [1]Ansys, Inc. 2025. PowerArtist User’s Guide.
- [2]Anthropic. 2026. Claude Sonnet 5.5. https://www.anthropic.com/news/claude-sonnet-5-5
- [3]Pietro Baghian, Luca Benini, and Enrico Macii. 2004. A scalable algorithm for RTL insertion of gated clocks based on ODCs computation. IEEE Trans. Comput.-Aided Design Integr. Circuits Syst. 24, 1 (Jan. 2004), 29–42.
- [4]Baum Design Systems. 2025. PowerSpion User Guide.
- [5]Bespoke Silicon Group. 2019. FakeRAM: Black-box SRAM generator for researchers without access to commercial RAM generators. https://github.com/bespoke-silicon-group/bsg_fakeram
- [6]Cadence Design Systems, Inc. 2024. Joules RTL Power Solution User Guide.
- [7]Aaron Carroll and Robert Heiser. 2010. An Analysis of Power Consumption in a Smartphone. In Proc. USENIX Annual Technical Conf. 271–284.
- [8]Che-Ming Chang et al. 2026. CODMAS: A Dilectic Multi-Agent Collaborative Framework for Structured RTL Optimization. In Proc. Conf. of the European Chapter of the Association for Computational Linguistics. 777–788.
- [9]Geuma Chang et al. 2025. Verilog code generation of hierarchical design using LLMs. In Proc. Int. Symp. on Machine Learning for CAD. 1–7.
- [10]Zhirong Chen et al. 2026. ChipSeek: Optimizing Verilog Generation via EDA-Integrated Reinforcement Learning. In Proc. Annual Meeting of the Association for Computational Linguistics. 25180–25201.
- [11]Ranan Fraer, Gila Kamhi, and Muhammad K Mhamed. 2008. A new paradigm for synthesis and propagation of clock gating conditions. In Proc. Design Automation Conf. 658–663.DOI
- [12]Pengwei Jin et al. 2025. RealBench: Benchmarking Verilog Generation Models with Real-World IP Designs. arXiv:2507.16200 [cs.LG] (Jul. 2025), 1–10.arxiv.org/abs/2507.16200
- [13]Nelson F. Liu et al. 2023. Lost in the middle: How language models use long contexts. arXiv:2307.03172 [cs.CL] (Nov. 2023), 1–18.arxiv.org/abs/2307.03172
- [14]Siemens EDA. 2025. PowerPro RTL Power Optimization User Guide.
- [15]Siemens EDA. 2025. SLEC-Pro User Guide.
- [16]Synopsys Inc. 2017. SAED14nm FinFET Educational Design Kit.
- [17]Synopsys Inc. 2019. VCS User Guide.
- [18]Synopsys Inc. 2020. Design Compiler User Guide.
- [19]Synopsys Inc. 2021. PrimePower User Guide.
- [20]Synopsys Inc. 2025. IC Compiler II User Guide.
- [21]Synopsys Inc. 2026. PrimeTime User Guide.
- [22]Kimia Tasnia et al. 2025. Verilog generation via multi-role LLMs. In Proc. Int. Conf. on CAD. 1–9.
- [23]Osama Elsayed Ahmed Mowafy Teaim, 2022. RTL Power Estimation & Optimization of Kalray’s MPPA using PowerArtist & Joules. Ph. D. Dissertation. Politecnico di Torino.
- [24]Yiting Wang et al. 2025. SymRTLIO: Enhancing RTL Code Optimization with LLMs and Neuron-Inspired Symbolic Reasoning. arXiv:2504.10369 [cs.AR] (Apr. 2025), 1–16.arxiv.org/abs/2504.10369
- [25]Xufeng Yao et al. 2024. RTLRewriter: Methodologies for large models aided RTL code optimization. In Proc. Int. Conf. on CAD. 1–7.arxiv.org/abs/2409.11414
- [26]Yifang Zhao et al. 2025. Hardware Generation with High Flexibility using Reinforcement Learning Enhanced LLMs. In Proc. Design Automation Conf. 453–459.
- [27]Zirui Zhao et al. 2024. Automatic curriculum expert iteration for reliable LLM reasoning. arXiv:2410.07627 [cs.LG] (Oct. 2024), 1–20.arxiv.org/abs/2410.07627




