Check behavioral consistency between high-level hardware specifications and RTL implementations. Use when asked to check RTL consistency, verify RTL against spec, check hardware specification compliance, validate RTL implementation, find spec violations in RTL, check behavioral consistency, or when working with hardware designs that need verification against protocol specifications, timing requirements, or functional specifications in Verilog, VHDL, or SystemVerilog.
This skill enables systematic checking of behavioral consistency between high-level hardware specifications and RTL implementations. It extracts requirements from specifications, maps them to RTL logic, and classifies each requirement as satisfied, violated, underspecified, or uncheckable.
Follow this sequential process to check RTL-specification consistency:
Read and analyze both the specification and RTL code:
Specification Analysis:
RTL Analysis:
Formalize each requirement from the specification:
Requirement Types:
Functional Requirements:
Timing Requirements:
Safety Properties:
Liveness Properties:
For each requirement, document:
Identify RTL constructs corresponding to each requirement:
Signal Mapping:
Logic Mapping:
State Mapping:
For each requirement, verify RTL behavior:
Verification Methods:
Static Analysis:
Trace Analysis:
Pattern Matching:
Assign each requirement to one of four categories:
✅ Satisfied:
❌ Violated:
⚠️ Underspecified:
❓ Uncheckable:
For each violated requirement, provide detailed analysis:
Violation Report Structure:
Requirement ID: REQ-XXX
Status: ❌ VIOLATED
Description:
[What the requirement specifies]
RTL Location:
Module: [module_name]
File: [file_path]
Lines: [line_numbers]
Mismatch Explanation:
[Clear explanation of how RTL differs from spec]
Example Trace:
Cycle | Signal1 | Signal2 | State | Expected | Actual
------|---------|---------|-------|----------|-------
0 | 0 | 1 | IDLE | IDLE | IDLE
1 | 1 | 1 | IDLE | BUSY | IDLE <- Violation
2 | 1 | 0 | IDLE | DONE | IDLE
Root Cause:
[Analysis of why the violation occurs]
Suggested Fix:
[Proposed correction to RTL]
Produce a structured report with all findings:
Total Requirements: X
✅ Satisfied: Y (Z%)
❌ Violated: A (B%)
⚠️ Underspecified: C (D%)
❓ Uncheckable: E (F%)
Critical Violations: G
For each requirement, include:
Status: [✅/❌/⚠️/❓] Priority: [High/Medium/Low] Category: [Functional/Timing/Safety/Liveness]
Specification: [Requirement description from spec]
RTL Mapping:
Analysis: [Detailed consistency check results]
[If violated] Violation Details: [Explanation, trace, root cause, suggested fix]
[If underspecified] Clarification Needed: [What information is missing or ambiguous]
[If uncheckable] Missing Assumptions: [What additional information is required]
Specification Improvements:
RTL Fixes:
Verification Suggestions:
Specification Pattern: "When valid is asserted, data must remain stable until ready is asserted"
RTL Check:
// Look for:
always @(posedge clk) begin
if (valid && !ready) begin
// data should not change
assert(data == $past(data));
end
end
Violation Example: Data changes while valid=1 and ready=0
Specification Pattern: "System must transition from IDLE to BUSY when start signal is asserted"
RTL Check:
// Look for:
case (state)
IDLE: if (start) next_state = BUSY;
// Check if this transition exists
endcase
Violation Example: Missing transition or wrong next state
Specification Pattern: "Output must be valid within 3 clock cycles of input"
RTL Check:
Violation Example: Output appears after 4 cycles instead of 3
Specification Pattern: "All registers must reset to known values"
RTL Check:
// Look for:
always @(posedge clk or negedge rst_n) begin
if (!rst_n) begin
// Check all registers have reset values
end
end
Violation Example: Register missing from reset logic
Key Checks:
Common Patterns:
// State machine
always @(posedge clk) begin
state <= next_state;
end
// Combinational logic
always @(*) begin
case (state)
// Check all states covered
endcase
end
Key Checks:
Common Patterns:
-- Sequential process
process(clk, rst)
begin
if rst = '1' then
-- Reset logic
elsif rising_edge(clk) then
-- State updates
end if;
end process;
For detailed HDL syntax and common patterns: