Evaluating LLM-Based Processor RTL Rewriting: A Constraint-Aware Engineering Framework
Processor RTL modification is a frequent engineering task, but generic question-answering benchmarks do not show whether an LLM can produce synthesizable, simulatable code that meets functional, area, and performance constraints. This article presents an evaluation framework built around three gates: regression simulation, an area cap, and hidden-workload performance normalized to a baseline. It also distinguishes modifying existing RTL from rebuilding a design from a specification, examines how prompt and constraint errors can distort scores, and offers practical recommendations for hardware-assisted tooling and software orchestration teams. The article closes with limitations, including tool-version dependence, hidden-workload coverage, and the way normalized scores can obscure absolute differences.
1. Why Evaluate “Rewrite” Capability
In processor design, modifying hardware description language code (RTL) is a high-frequency task. Engineers need to improve throughput while preserving functional correctness and controlling area and power. This type of task imposes specific requirements on large models: the model must understand pipelines, datapaths, and interface timing, and it must output code that can be synthesized and simulated.
Ordinary question-answering leaderboards cannot reflect this capability. An answer that looks reasonable does not mean the modification will pass regression tests, nor does it mean the post-synthesis area will be acceptable. Evaluation therefore needs to examine function, resources, and performance within a single framework.
2. Three Gates in the Evaluation Skeleton
A reliable evaluation usually consists of three steps.
1. Simulation gate. Candidate modifications must first pass regression simulation. Any compilation failure, simulation failure, or functional mismatch is scored as zero. This step ensures that subsequent metrics are discussed only for correct designs.
2. Area cap. Designs that pass the gate undergo logic synthesis, and standard-cell area is measured. The area cap is usually set to a fixed multiple of the baseline; exceeding it results in a zero score. Without a cap, evaluation tends to reward “performance by adding resources,” which has no value in real engineering.
3. Hidden workloads and normalization. Performance is measured as instructions per cycle (IPC) on a set of undisclosed workloads, combined with an estimated maximum clock frequency from synthesis. Multiplying the two and dividing by the baseline value produces a relative score. Hidden workloads reduce the risk of models overfitting to public examples.
The following schematic code shows the flow. The function implementations must be replaced according to the team’s toolchain:
AREA_LIMIT_RATIO = 4.0 # Area cap as a multiple of the baseline, set per taskdef score_candidate(rtl_path, base_area, base_ipc, base_fmax):# Gate 1: regression simulationif not run_regression(rtl_path):return 0.0# Gate 2: area caparea = synth_area(rtl_path)if area > AREA_LIMIT_RATIO * base_area:return 0.0# Gate 3: performance and clock estimate under hidden workloadsipc = run_hidden_workloads(rtl_path)fmax = estimate_fmax(rtl_path)# Normalize against the baselinereturn (ipc * fmax) / (base_ipc * base_fmax)
The order of the three gates must not be reversed. If performance is measured before function is checked, compute resources will be wasted on incorrect designs.
3. Two Task Types: Modifying Existing Designs vs. Rebuilding from Specification
Evaluation tasks fall roughly into two types.
Modifying an existing design. The input is existing RTL code, and the goal is to improve performance or reduce area while preserving interfaces and function. The model needs to understand implicit assumptions in the old code, such as reset behavior, boundary conditions, and timing dependencies. A smaller change scope lowers risk, but the model can easily be constrained by the old structure.
Rebuilding from a specification. The input is a textual specification and an interface template, and the model decides pipeline stages, datapaths, and storage organization. This type of task has no legacy burden, so the design space is larger. However, specifications often omit some functions, such as performance counters or rarely used instructions, so results tend to favor an “easy-to-implement subset.”
Results for the two task types can differ greatly. The same model may score lower on modification tasks and higher on rebuild tasks; the reason is often different task difficulty and constraint scope, not a change in the model’s capability. Scores must therefore always be reported together with the task type.
To make results closer to production, three additional requirements are needed: enforce implementation of the full instruction set, tighten the area cap, and check timing after physical synthesis. Without these conditions, scores only indicate the quality of a design draft.
4. Mis-specified Constraints Can Mislead Scores
Evaluation results are highly sensitive to prompts and constraints. Common problems include the following.
- Inconsistent functional scope. The specification omits certain instructions, but acceptance requires full implementation, giving the model an unfairly low score.
- Missing resource constraints. Without an area cap, models tend to duplicate multiple compute units. Performance numbers look good, but the result has no engineering meaning.
- Workload leakage. Public test programs are written into the prompt, and the model may optimize only for those programs.
- Poor baseline choice. A baseline that is too strong or too weak makes relative scores lose comparative value.
Prompts should explicitly state the interface, clock target, area budget, regression set that must pass, and parts that must not be modified. The clearer the constraints, the better the evaluation can distinguish real capability from luck.
5. Deployment Recommendations
For teams building hardware-assisted tools. Simulation gates, area caps, and hidden workloads can serve as an internal evaluation skeleton, with post-physical-synthesis timing results added gradually. Each change should retain synthesis reports and simulation logs for traceability.
For software orchestration teams. The scheduling layer needs to record task type, constraint version, and baseline version. Scores for the same model on different tasks cannot be compared directly across tasks. The orchestration system should also classify failure cases, such as compilation errors, functional errors, area overruns, and timing non-convergence, to help determine whether the problem lies with the model or the constraints.
General principles. Evaluation scores only indicate performance under specific constraints. Reports should include the task description, constraint parameters, baseline definition, and test-set source so that readers can reproduce the results.
6. Limitations and Caveats
The framework depends on the stability of synthesis tools and simulation environments. Different tool versions may produce different area and frequency estimates, so versions must be fixed and configurations recorded. Hidden-workload coverage is also limited and cannot replace formal verification or long random regression.
In addition, score normalization can mask absolute performance differences. If two designs have close relative scores, their actual area, power, and timing margin still need to be compared. The goal of evaluation is to support engineering decisions, not to produce a single ranking.
