Evaluating LLMs for RTL Rewriting: Benchmark Design and Engineering Practice

    This article examines how to evaluate large language models on RTL rewriting, a verifiable hardware engineering task where correctness depends on cycle-accurate simulation, area limits, and timing closure rather than fluent output. It breaks down a three-gate benchmark (regression simulation, area ceiling, hidden workload), compares legacy-core modification with spec-to-RTL reconstruction, reviews production signals from in-house inference chips and GPU IP collaboration, and offers practical guidance for engineering teams building hardware agents.

    1. Why “Being Good at Chat” Is Not the Same as Rewriting Circuits

    Over the past year, competition on general-purpose LLM leaderboards has shifted from natural language understanding toward verifiable engineering tasks. Hardware design is one of the most demanding validation scenarios: whether a circuit description is correct does not depend on how fluent it reads, but on whether it matches expectations cycle by cycle in simulation and whether post-synthesis area and frequency stay within constraints. In a recent technical post, a cloud vendor placed several consecutive generations of models into the same open-source processor benchmark to see which was better at modifying circuit descriptions. The newest generation achieved the highest average scores on both task types under a comparable budget. What deserves attention here is not the ranking, but the benchmark design itself.

    “Rewriting” a hardware description language is fundamentally different from “refactoring” software. Software mistakes can be rolled back or rolled out gradually; once a circuit description reaches tape-out, the cost of an error is extremely high. So evaluating whether a model is usable requires looking at three things at once: functional correctness, acceptable resources, and timing closure. Any evaluation that reports only a “pass rate” tends to overestimate model capability.

    2. Benchmark Skeleton: Three Gates Decide Whether Scores Are Trustworthy

    The described evaluation can be abstracted into a reusable skeleton for any team building hardware agents.

    The first gate is simulation. A model’s output must pass full regression simulation; failing that scores zero. This gate eliminates pseudo-successes that “look like code but do not run at all.”

    The second gate is the area ceiling. If post-synthesis area exceeds roughly sixteen times the original core, the design scores zero. This constraint prevents a model from trading functional correctness for extreme redundant combinational logic, which would shift the problem from design to cost.

    The third gate is the hidden workload. Designs that pass the first two gates are measured on an undisclosed workload for instructions per cycle, multiplied by the maximum clock frequency estimated by the synthesis tool, and then normalized into a relative score. The hidden workload avoids overfitting to public samples and is the most valuable part of the whole evaluation.

    The scoring logic can be sketched as:

    1. def score(rtl, hidden_workload, area_limit=16.0):
    2. if not regression_simulation(rtl):
    3. return 0.0 # Gate 1: functional correctness
    4. area = synthesize(rtl).area
    5. if area > area_limit * baseline.area:
    6. return 0.0 # Gate 2: resource constraint
    7. ipc = measure_ipc(rtl, hidden_workload)
    8. fmax = estimate_fmax(rtl)
    9. return normalize(ipc * fmax) # Gate 3: real throughput under hidden workload

    Nearly ten thousand scoring runs in total show that this evaluation is not cheap to run, which also explains why most teams cannot produce comparable conclusions: they lack automated regression and synthesis pipelines.

    3. Score Gaps Across Two Task Types: Modifying Legacy Code vs. Rebuilding from Specs

    The evaluation splits tasks into two tracks. One provides the original circuit description and asks only for higher instructions per second; the other provides only a text specification and an interface template, leaving the model to decide pipeline depth and datapath. The targets were a compact open-source core with an FPGA-oriented design style and an embedded open-source core commonly used in security chips, representing area-sensitive and security-sensitive design styles respectively.

    Two conclusions are worth remembering. First, when modifying an existing core, the newest generation was best on both targets, with average performance on the compact core roughly twice that of the previous generation. Second, when starting from a specification on a blank page, all five models generally scored higher, with the gap especially clear on the embedded core, where the relative score exceeded 0.7.

    The original post is candid about why: starting from a specification legitimately allows omitting counters and rarely used instructions that contribute little to throughput, so the constraints are looser. If the full feature set is required, the area is tightened, and post-physical-synthesis timing checks are added, scores drop noticeably. This is a reminder that the comparability of benchmark scores depends entirely on whether constraints are written identically. The score gap for the same model between “modifying legacy code” and “rebuilding” is often larger than the gap between models; get the prompt or constraints wrong, and the scores will mislead you.

    4. From Benchmark to Production: Two Kinds of Corroborating Signals

    Two signals from real engineering work are more convincing than any leaderboard.

    The first is iteration on an in-house inference chip. Model suggestions reduced the standard-cell area of the vector unit by about 13% and the matrix unit by about 10%, passing post-silicon validation; in the matrix unit, one version of a multiplier reduced post-synthesis area by about 15% and converged latency from two cycles to one. The value of such changes lies in improving area and latency at the same time, not in a single-point number.

    The second is collaboration with a chip vendor: relative to a highly optimized baseline, a GPU IP core improved by about 14% on a combined PPA (performance, power, area) metric, with some changes already heading to tape-out; key modules of the next-generation flagship processor also saw single-digit percentage gains. The method path is straightforward: modify the RTL description, then verify behavior and synthesis metrics with a mainstream EDA toolchain. The next direction is joint training with tool vendors so the model can operate the toolchain directly, moving from “writing descriptions” to “running the flow.”

    5. Practical Advice for Engineering Teams

    • Build the pipeline before evaluating models. Without automated regression, synthesis, and a hidden workload, no comparison is reproducible.
    • Write constraints explicitly. The area ceiling, full feature set requirement, and whether post-physical-synthesis timing is checked must be declared in the prompt and configuration.
    • Select by scenario. Legacy code rewriting and spec reconstruction are two different capabilities; do not cover both with one prompt.
    • Prefer small changes. Local rewrites that improve area and latency together pass verification and review more easily than a full rewrite.
    • Keep the human-machine boundary clear. The model generates candidate solutions and explores parameters; formal equivalence proofs and sign-off remain with the existing toolchain and engineers.

    6. Another Engineering-Side Development: Hot-Update Boundaries in Hybrid Apps

    A related front-end container development is also worth recording: a cross-platform development framework’s “steam mode” began supporting hot updates of application resource bundles and provided a restart interface. The boundary must be clear: only UI description files, scripts, and static resources can be replaced; native plugins and manifest configuration are out of scope; some OS versions remain unsupported due to runtime constraints. For hybrid apps, the correct use of hot updates is fixing copy and logic defects, not bypassing release review to change app capabilities.

    7. Conclusion

    The real lesson from this round of evaluation is that the value of LLMs in hardware should be measured by whether they can produce verified circuit descriptions under hard constraints. Treating simulation gates, area ceilings, and hidden workloads as the three pillars of your own evaluation yields more long-term benefit than chasing any single score.