本文へ移動
cccskills
無料GitHub で公開

rtl-specification-consistency-checker

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.

インストール方法を見る

含まれるファイル(3)

  • SKILL.md8.9 KB
  • references/common_violations.md10.6 KB
  • references/hdl_patterns.md9.6 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

RTL-Specification Consistency Checker

Overview

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.

Consistency Checking Workflow

Follow this sequential process to check RTL-specification consistency:

1. Parse and Understand Inputs

Read and analyze both the specification and RTL code:

Specification Analysis:

  • Identify the format (natural language, tables, timing diagrams, protocol rules)
  • Extract all behavioral requirements
  • Note any assumptions or constraints
  • Identify ambiguous or incomplete sections

RTL Analysis:

  • Identify the HDL language (Verilog, VHDL, SystemVerilog)
  • Locate key modules and their interfaces
  • Identify state machines, registers, and control logic
  • Note clock domains and reset strategies

2. Extract Behavioral Requirements

Formalize each requirement from the specification:

Requirement Types:

Functional Requirements:

  • Input-output relationships
  • State transitions
  • Data transformations
  • Protocol sequences

Timing Requirements:

  • Setup/hold times
  • Latency constraints
  • Throughput requirements
  • Clock cycle counts

Safety Properties:

  • Invariants that must always hold
  • Forbidden states or transitions
  • Mutual exclusion constraints
  • Data integrity conditions

Liveness Properties:

  • Progress guarantees
  • Eventual responses
  • Fairness conditions

For each requirement, document:

  • Requirement ID
  • Description in natural language
  • Formalized property (if possible)
  • Source location in specification
  • Priority/criticality

3. Map Requirements to RTL

Identify RTL constructs corresponding to each requirement:

Signal Mapping:

  • Map specification signals to RTL signals
  • Identify relevant registers and wires
  • Note signal widths and types

Logic Mapping:

  • Identify modules implementing each requirement
  • Locate state machines and control logic
  • Find combinational and sequential logic blocks
  • Note line numbers and code locations

State Mapping:

  • Map specification states to RTL state encodings
  • Identify state registers and transition logic
  • Document state machine structure

4. Check Consistency

For each requirement, verify RTL behavior:

Verification Methods:

Static Analysis:

  • Check signal connectivity
  • Verify state machine completeness
  • Analyze control flow paths
  • Check for missing cases or conditions

Trace Analysis:

  • Construct example execution traces
  • Check if traces satisfy requirements
  • Look for counterexamples
  • Verify timing constraints

Pattern Matching:

  • Compare RTL patterns against specification patterns
  • Check for common implementation errors
  • Verify protocol compliance

5. Classify Requirements

Assign each requirement to one of four categories:

✅ Satisfied:

  • RTL correctly implements the requirement
  • All test cases pass
  • No violations found

❌ Violated:

  • RTL behavior contradicts the requirement
  • Counterexample exists
  • Clear mismatch identified

⚠️ Underspecified:

  • Specification is ambiguous or incomplete
  • Multiple valid interpretations exist
  • Missing details prevent verification

❓ Uncheckable:

  • Missing environmental assumptions
  • Depends on external components
  • Requires information not provided

6. Document Violations

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]

7. Generate Consistency Report

Produce a structured report with all findings:

Report Structure

Executive Summary

Total Requirements: X
✅ Satisfied: Y (Z%)
❌ Violated: A (B%)
⚠️ Underspecified: C (D%)
❓ Uncheckable: E (F%)

Critical Violations: G

Detailed Findings

For each requirement, include:

REQ-001: [Requirement Name]

Status: [✅/❌/⚠️/❓] Priority: [High/Medium/Low] Category: [Functional/Timing/Safety/Liveness]

Specification: [Requirement description from spec]

RTL Mapping:

  • Module: [module_name]
  • Signals: [signal_list]
  • Lines: [line_numbers]

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]


Recommendations

Specification Improvements:

  • [List of specification clarifications needed]

RTL Fixes:

  • [List of required RTL corrections]

Verification Suggestions:

  • [Additional checks or formal verification recommendations]

Common Verification Patterns

Protocol Compliance

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

State Machine Verification

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

Timing Constraints

Specification Pattern: "Output must be valid within 3 clock cycles of input"

RTL Check:

  • Trace signal propagation through pipeline
  • Count register stages
  • Verify latency matches specification

Violation Example: Output appears after 4 cycles instead of 3

Reset Behavior

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

HDL-Specific Considerations

Verilog/SystemVerilog

Key Checks:

  • Blocking vs non-blocking assignments
  • Sensitivity list completeness
  • Latch inference (unintended)
  • Race conditions in always blocks
  • X-propagation issues

Common Patterns:

// State machine
always @(posedge clk) begin
    state <= next_state;
end

// Combinational logic
always @(*) begin
    case (state)
        // Check all states covered
    endcase
end

VHDL

Key Checks:

  • Process sensitivity lists
  • Signal vs variable usage
  • Incomplete case statements
  • Uninitialized signals
  • Clock edge detection

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;

Tips for Effective Checking

  • Start with critical requirements: Focus on safety-critical and high-priority items first
  • Use concrete examples: Create specific test scenarios for each requirement
  • Check edge cases: Verify boundary conditions and corner cases
  • Trace signal flow: Follow signals through the design hierarchy
  • Verify completeness: Ensure all specification requirements are addressed
  • Check for unintended behavior: Look for RTL functionality not in spec
  • Document assumptions: Make all implicit assumptions explicit
  • Suggest improvements: Recommend specification or RTL enhancements

Reference Materials

For detailed HDL syntax and common patterns:

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Applies abstract interpretation using different abstract domains (intervals, octagons, polyhedra, sign, congruence) to statically analyze program variables and infer invariants, value ranges, and relationships. Use when analyzing program properties, inferring loop invariants, detecting potential errors, or understanding variable relationships through static analysis.

日本語の概要は準備中です。原文の説明を表示しています。

ArabelaTso/Skills-4-SE2532026年8月21日 更新

Uses abstract interpretation to automatically infer loop invariants, function preconditions, and postconditions for formal verification. Generates invariants that capture program behavior and support correctness proofs in Dafny, Isabelle, Coq, and other verification systems. Use when adding formal specifications to code, generating verification conditions, inferring contracts for functions, or discovering loop invariants for proofs.

日本語の概要は準備中です。原文の説明を表示しています。

ArabelaTso/Skills-4-SE2532026年8月21日 更新

Performs abstract interpretation over source code to infer possible program states, variable ranges, and data properties without executing the program. Reports potential runtime errors including out-of-bounds accesses, null dereferences, type inconsistencies, division by zero, and integer overflows. Use when analyzing code for potential runtime errors, performing static analysis, checking safety properties, or verifying program behavior without execution.

日本語の概要は準備中です。原文の説明を表示しています。

ArabelaTso/Skills-4-SE2532026年8月21日 更新

Performs abstract interpretation to produce summarized execution traces and high-level program behavior representations. Highlights key control flow paths, variable relationships, loop invariants, function summaries, and potential runtime states using abstract domains (intervals, signs, nullness, etc.). Use when analyzing program behavior, understanding execution paths, computing loop invariants, tracking variable ranges, detecting potential runtime errors, or generating program summaries without concrete execution.

日本語の概要は準備中です。原文の説明を表示しています。

ArabelaTso/Skills-4-SE2532026年8月21日 更新

Create ACSL (ANSI/ISO C Specification Language) formal annotations for C/C++ programs. Use this skill when working with formal verification, adding function contracts (requires/ensures), loop invariants, assertions, memory safety annotations, or any ACSL specifications. Supports Frama-C verification and generates comprehensive formal specifications for C/C++ code.

日本語の概要は準備中です。原文の説明を表示しています。

ArabelaTso/Skills-4-SE2532026年8月21日 更新

CLI-based browser automation with persistent page state using ref-based element interaction. Use when users ask to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

日本語の概要は準備中です。原文の説明を表示しています。

ArabelaTso/Skills-4-SE2532026年8月21日 更新

ArabelaTso のスキルをすべて見る

このスキルの問題を報告する