Step 3 of 9 — Claude for VLSI Series

Master Claude

The advanced prompting techniques that separate average results from expert-level output. Learn chain-of-thought, role priming, few-shot examples, and iterative refinement — with VLSI examples throughout.

Chain-of-Thought Role Priming Few-Shot Iterative Refinement Adversarial Review Prompt Anatomy

Bad Prompt vs Good Prompt — Output Quality Difference

Basic prompt
25%
+ System prompt
55%
+ Role priming
70%
+ Chain-of-thought
82%
+ Few-shot example
90%
+ Iterative refine
97%

Estimated output quality improvement — each technique compounds on the previous

01 Anatomy of a Perfect VLSI Prompt

Every great Claude prompt for engineering work has six components. Missing any one of them forces Claude to guess — and guessing introduces errors.

ROLE
Who Claude should be. Act as a senior RTL design engineer with 10+ years of ASIC experience. This primes Claude's vocabulary, reasoning depth, and assumptions.
CONTEXT
Your project details. I'm designing a RISC-V cache controller for TSMC N7, targeted at 1.5 GHz. Claude tailors its advice to your specific constraints.
TASK
Exactly what you need. Review this FSM for latch inference, reset completeness, and any state encoding issues. Be specific — "review my code" is too vague.
CONSTRAINT
Boundaries and rules. Use only synthesizable constructs. Non-blocking assignments only. Do not use any Xilinx-specific primitives. Prevents Claude from giving valid but wrong answers.
FORMAT
How you want the answer. Return a numbered list of issues, each with file:line reference and a proposed fix. Without this, Claude picks its own format which may not match your workflow.
EXAMPLE
One example of what good looks like. Paste a sample output format, a reference module in your style, or a correct version of a similar problem. One example beats 200 words of description.

02 Technique 1 — Chain-of-Thought Reasoning

CoT
Chain-of-Thought Prompting
Force Claude to reason step-by-step before answering

When you ask Claude a complex question directly, it can jump to a plausible-sounding answer. Chain-of-thought forces it to decompose the problem first, significantly improving accuracy for anything involving logic tracing, timing paths, or multi-step debugging.

The magic phrase: "Think step by step before answering" or "First, trace through the logic of..."

❌ Without CoT
Why does my FIFO show empty flag glitches on the read side after a write burst?
✓ With Chain-of-Thought
I have a Gray-coded dual-clock FIFO. After a write burst of 4 entries, the read-side empty flag glitches high for 1 cycle before settling low. Think step by step: (1) trace how the write pointer crosses clock domains, (2) analyze the Gray-to-binary conversion timing, (3) identify where the glitch originates, (4) propose a fix.

VLSI Chain-of-Thought Examples

prompt
# Timing path debug — chain of thought
I have a setup violation on path: FF_A/Q → combo_logic → FF_B/D
Slack = -0.34 ns at 1GHz. Think step by step:
1. Identify the likely root cause (long logic depth / high fanout / routing)
2. Calculate how much improvement each fix would give
3. Rank the fixes by effort vs. gain
4. Give me the exact Tcl command for the highest-ROI fix in DC

# FSM completeness check — chain of thought
Here is my Verilog FSM. Before telling me if it's correct:
Step 1: List all states and transitions you can see
Step 2: Check if every state has a transition for every input combination
Step 3: Check for any unreachable states
Step 4: Identify any latch inference risks
Then give me the final verdict with specific line numbers.

03 Technique 2 — Role Priming

ROLE
Role Priming
Tell Claude exactly who it is — changes vocabulary, depth, and assumptions

The role you assign Claude fundamentally changes how it responds. "Act as a senior DV engineer" produces assertions with proper disable conditions. "Act as a student" produces simplifications. "Act as an adversarial reviewer" produces the harshest possible critique.

For RTL Design

"Act as a senior RTL design engineer specializing in synthesizable Verilog for ASIC design at advanced nodes. You know Synopsys DC synthesis constraints intimately."

For Verification

"Act as a lead verification engineer who has taped out 10 chips using UVM. You think in terms of coverage holes and failure modes, not just passing tests."

For Adversarial Review

"Act as the most critical code reviewer on the team — someone who has seen every class of chip bug and is specifically looking for what will fail at silicon."

For Learning

"Act as a patient VLSI instructor explaining to a 3rd year ECE student. Use analogies, avoid jargon, and build intuition before formulas."

Power Move: Stack Multiple Roles

prompt
# Role stacking — get multiple expert perspectives in one shot
Review this AXI4 slave RTL from THREE perspectives:

1. As a senior RTL designer: check synthesizability and coding style
2. As a DV engineer: identify what test cases would break this
3. As an STA engineer: flag any timing concerns from the logic structure

Provide each perspective as a separate section.

[paste your RTL here]

04 Technique 3 — Few-Shot Examples

FEW
Few-Shot Prompting
Show one example of what good output looks like — Claude will match it exactly

The single most underused technique. Instead of describing the format you want in words, show Claude one or two examples. It will precisely match the style, naming convention, comment density, and structure of your example.

❌ No Example
Write a Verilog module for a 4-bit counter with synchronous reset. Use my team's coding style.
✓ With Few-Shot Example
Here is a module in our coding style: module clk_div #( parameter DIV = 4 ) ( input wire clk, input wire rst_n, output reg clk_out ); reg [2:0] cnt_q; always @(posedge clk) begin if (!rst_n) cnt_q <= '0; else cnt_q <= cnt_q + 1'b1; end assign clk_out = cnt_q[DIV-1]; endmodule Now write a 4-bit synchronous counter with enable and load, matching this exact style.

Few-Shot for Code Review Output Format

prompt
# Tell Claude to format issues like your lint tool
When you find issues in my RTL, report them in this exact format:

[SEVERITY] FILE:LINE — RULE — Description of issue
  Suggested fix: <one line fix>

Example:
[ERROR] fifo.sv:47 — NB-ASSIGN — Blocking assignment in clocked always block
  Suggested fix: Change `=` to `<=`

[WARN] fifo.sv:112 — RESET-INCOMPLETE — Signal rd_ptr not reset
  Suggested fix: Add `rd_ptr <= '0;` in reset block

Now review this module and report all issues in the above format:
[paste RTL]

05 Technique 4 — Iterative Refinement

ITER
Iterative Refinement
Build complex designs step-by-step — each step builds on the last

The biggest mistake engineers make is asking for everything in one prompt: "Write me a complete RISC-V pipeline with caches, branch prediction, and out-of-order execution." Even Claude will produce mediocre results for over-specified single-shot requests. The pro approach: decompose and iterate.

Iterative Design Workflow — FIFO Example

conversation-flow
Prompt 1: Outline
"Outline the key design decisions for a 512-depth, 32-bit wide synchronous
FIFO with full/empty flags. List: (1) address tracking approach,
(2) full/empty generation logic, (3) any timing risks."

Prompt 2: Skeleton
"Good. Now write the module skeleton — just the port list, parameters,
and internal signal declarations. No logic yet."

Prompt 3: Core Logic
"Now fill in the write and read pointer logic with non-blocking assignments.
Full/empty generation only — no output assignments yet."

Prompt 4: Edge Cases
"Now add handling for: simultaneous read+write when nearly full,
and the condition where rd_ptr wraps around past wr_ptr."

Prompt 5: Assertions
"Add 3 SVA assertions checking: (1) no write when full,
(2) no read when empty, (3) pointer separation never exceeds DEPTH."

Prompt 6: Review
"Now act as an adversarial reviewer. What could go wrong with this FIFO
under corner-case inputs? Focus on metastability and overflow."
Why Iteration Works Better

Each step gives Claude a clear, bounded task. Claude's quality degrades on open-ended mega-prompts because it must simultaneously optimize for structure, correctness, style, and completeness. Iterating on smaller steps keeps each response focused and high-quality.

06 Technique 5 — Adversarial Review

ADV
Adversarial Review
Ask Claude to attack your design — finds bugs that normal review misses

After Claude writes or reviews code, flip its perspective. Ask it to play the role of someone specifically trying to break the design. This adversarial frame forces Claude to think about failure modes, not just correctness — the same mental model experienced verification engineers use.

prompt
# After getting Claude to write/review code, follow with:

You just reviewed this RTL and said it looks correct. Now switch roles.
Act as an adversarial verification engineer whose job is to find a bug
that slips through the review.

Ask yourself:
- What happens at reset edge cases?
- What if two signals change simultaneously?
- What is the behavior at power-of-2 boundaries?
- What if the input violates the protocol spec by 1 cycle?

Report any vulnerabilities you find, even theoretical ones.

07 Technique 6 — Constraint Control

Use explicit constraints to prevent Claude from giving technically correct but useless answers. Without constraints, Claude will pick the most general solution — which is often wrong for your specific tool, node, or standard.

Synthesis Constraints

"Only use synthesizable Verilog. No #delays, no initial blocks, no fork-join."

Tool Constraints

"Target Synopsys DC 2024. Use only DC-compatible pragmas. Do not use Cadence-specific attributes."

Output Length

"Give me a maximum 10-line fix. Do not rewrite the entire module — patch only the lines that change."

Style Constraints

"Do not add any comments unless I ask. Use 2-space indent. Registers end in _q, next-state logic ends in _d."

08 Technique 7 — Force Structured Output

When you need to feed Claude's output into another tool (a script, a CI system, a tracking spreadsheet), ask for JSON, CSV, or a precise table format. Claude follows format instructions reliably.

prompt
# Force JSON output for automated processing
Analyze this timing report and return ONLY a JSON array.
No prose, no explanation — just the JSON.

Format:
[
  {
    "path_id": "string",
    "startpoint": "string",
    "endpoint": "string",
    "slack_ns": float,
    "root_cause": "logic_depth|fanout|routing|sdc",
    "fix_priority": 1-5,
    "recommended_fix": "string"
  }
]

[paste timing report here]
prompt
# Force table output for review spreadsheet
Review this RTL and output a markdown table with columns:
| Line | Severity | Rule | Issue | Fix |

Severity levels: CRITICAL / WARNING / INFO
One row per issue found.

09 The 5 Biggest Claude Prompting Mistakes

Mistake 1: Asking for too much at once

Fix: Break into 3–6 sequential prompts. The first ask should never produce the final artifact.

Mistake 2: No context — "write me a FIFO"

Fix: Always specify depth, width, clock type (sync/async), full/empty behavior, and target tool. Context = quality.

Mistake 3: Accepting the first answer

Fix: Always follow with "What could go wrong?" or "What did you not consider?" Claude's second pass often catches what the first missed.

Mistake 4: Not specifying the tool version

Fix: Always say "Synopsys DC 2024", "VCS 2023.06", "PrimeTime 2024.03" — Claude knows version differences and will tailor advice.

Mistake 5: Copying output without simulation

Fix: Claude's RTL is ~90% correct but always simulate. Ask Claude to generate the testbench at the same time, and use the simulation results to refine.

10 Copy-Ready Master Prompt Templates

Universal VLSI Review Prompt

master-prompt
Act as a senior VLSI design and verification engineer with 15 years of ASIC experience.

CONTEXT: I am designing [MODULE NAME] for [PROJECT/CHIP] targeting [TECHNOLOGY NODE].
Tool flow: [list your tools]. Target clock: [frequency]. RTL standard: [Verilog 2001 / SystemVerilog 2012].

TASK: [Your specific ask]

CONSTRAINTS:
- Synthesizable only (no simulation-only constructs)
- Non-blocking assignments in all clocked always blocks
- Named begin/end blocks for readability
- [Any other style rules]

OUTPUT FORMAT:
1. Summary of what you found/did (3 sentences max)
2. Code/fixes (if applicable)
3. List of remaining concerns or edge cases I should verify

Think step by step before answering.

[PASTE YOUR CODE/REPORT HERE]

Rapid Bug Hunt Prompt

master-prompt
Act as a silicon-experienced debug engineer.

SYMPTOM: [Exact description of the failure — waveform behavior, assertion, sim error]
EXPECTED: [What should happen]
ACTUAL: [What is happening]

Step 1: Identify the top 3 most likely root causes ranked by probability
Step 2: For each cause, describe what signal/line in the RTL to check
Step 3: Suggest the minimum-diff fix that addresses the most likely cause
Step 4: List one test vector that would confirm your hypothesis

Here is the relevant RTL:
[paste RTL]

FAQ Advanced Prompting Questions

What is chain-of-thought prompting? +

Chain-of-thought prompting asks Claude to reason step-by-step before giving an answer. For VLSI, this means asking Claude to trace the logic path, identify intermediate signals, and explain each decision before writing code or suggesting a fix. It dramatically improves accuracy for complex timing and FSM problems.

What is few-shot prompting and when should I use it? +

Few-shot prompting means showing Claude 1–3 examples of the exact format you want before asking your real question. For VLSI, use it when you want RTL in a specific coding style, lint reports in a custom format, or Tcl scripts that match your team's conventions. One good example tells Claude more than paragraphs of description.

How do I make Claude write RTL in my team's exact style? +

Use a system prompt + few-shot example together. In the system prompt, specify your coding standards (non-blocking assignments, naming conventions, 2-space indent). Then show one example module in your style before asking Claude to write a new one. Claude will match the format precisely.

What is iterative refinement and how does it work? +

Instead of asking for everything in one prompt, break work into steps and build on each response. Ask Claude to outline the design first, then generate the skeleton, then fill in one function at a time, then add assertions, then review for edge cases. Each step produces better results than a single monolithic request.

How do I get Claude to find bugs it missed the first time? +

Use adversarial prompting: after Claude reviews your code, say "Play the role of a verification engineer trying to break this design — what edge cases would you test to find a bug?" This forces Claude to approach the problem from a completely different angle and often surfaces issues the initial review missed.