DV-Gym | Stage 1: AI-Era Design Verification Foundations

Lecture 1: Introduction to LLMs

Building intuition for Large Language Models before we apply them to Design Verification

Instructor: Ramdas Mozhikunnath
Course: Stage 1 — AI-Era Design Verification Foundations (DV-Gym)
Prerequisites: Curiosity about AI tools; no ML math required for this lecture

www.verificationexcellence.in
DV-Gym | Stage 1: AI-Era Design Verification Foundations

What Are Large Language Models (LLMs)?

  • Definition: LLMs are AI systems trained on vast amounts of text and code to predict the most likely next token (word/piece of a word) in a sequence.
  • What that enables: Given a prompt, they can draft text, explain concepts, summarize documents, translate, and generate or refactor code.
  • How they are useful for engineers (generic):
    • Accelerate boilerplate — scripts, templates, and first-draft documentation.
    • Act as a tireless tutor for unfamiliar APIs, error messages, and standards language.
    • Help brainstorm ideas, edge cases, and structured checklists from a written spec.
    • Compress review and debug loops — propose hypotheses, diffs, and next experiments when you are stuck.
  • Remember: An accelerator and thinking partner — not a replacement for tools, tests, or engineering judgment.
www.verificationexcellence.in
DV-Gym | Stage 1: AI-Era Design Verification Foundations

Practical DV Applications: Architecture & Planning

📋 Phase 1: Planning & Specs

  • Specification Ingestion: Interrogate dense PRDs, protocol chapters, and legacy docs into structured summaries.
  • Testplan Drafting: Extract features, scenarios, corner-cases, checks, coverage etc directly from spec text.
  • Coverage Modeling: Propose cross-coverage scenarios, covergroup structures, and transition bins from requirement tables.

🏗️ Phase 2: Testbench Architecture

  • UVM Scaffolding: Draft boilerplate drivers, monitors, sequences, and virtual sequencers without manual typing.
  • Scoreboard Logic: Generate golden reference transaction predictors and comparison logic skeletons.
  • Assertions: Draft synthesizable concurrent SVA properties from plain-English interface rules.
www.verificationexcellence.in
DV-Gym | Stage 1: AI-Era Design Verification Foundations

Practical DV Applications: Debug & Automation

🔍 Phase 3: Debug & Root-Cause

  • Log Parsing & Triage: Identify root failure signatures from simulation runs without scanning 50k lines manually.
  • Objection & Hang Analysis: Isolate dropped phase objections, unconsumed events, or infinite loop triggers.
  • Error Interpretation: Decipher cryptic simulator/UVM compile errors and suggest minimal reproduction test cases.

⚙️ Phase 4: Environment & CI Glue

  • Tooling Scripts: Refactor Makefiles, filelists, python build wrappers, and regression run configurations.
  • Diff-Style Reviews: Run first-pass audits on AI- or peer-authored TB code for race conditions and missing resets.
  • Golden Rule: Treat every artifact as a hypothesis until confirmed by a simulator, formal tool, or reference check.
www.verificationexcellence.in
DV-Gym | Stage 1: AI-Era Design Verification Foundations

Prominent LLMs You Will Encounter

Chat-style products

  • ChatGPT (OpenAI) — widely used general assistant for writing, coding help, and Q&A
  • Claude (Anthropic) — strong at long-context reading, careful reasoning, and structured drafting
  • Gemini (Google) — multimodal assistant tied into Google’s ecosystem
  • Microsoft Copilot — ChatGPT-class assistance embedded in Windows / Office / GitHub workflows

Also common in engineering workflows

  • GitHub Copilot — inline code suggestions inside the IDE
  • Cursor / similar AI IDEs — chat + edit loops over a whole project
  • Open-weight models (e.g. Llama, Mistral families) — self-host or run via cloud APIs when privacy/cost matter
  • Specialized coding models — often power “agent” features under the hood of tools above
  • Key takeaway: Product names change quickly; the skill is learning how to prompt, verify, and audit outputs—especially for Design Verification.
www.verificationexcellence.in
DV-Gym | Stage 1: AI-Era Design Verification Foundations

Prompt vs. Context: The Prompt

The Prompt (The Steering Wheel)

  • What it is: The explicit instruction, query, or task given to the model for this turn.
  • Role: Sets the operational stance, deliverables, format constraints, and immediate action verb.
  • Next-token driver: Serves as the active vector directing what the model should compute next.
  • Analogy: The command-line invocation and runtime switches passed to a tool.

 

www.verificationexcellence.in
DV-Gym | Stage 1: AI-Era Design Verification Foundations

Prompt vs. Context: The Context

The Context (The Sandbox Memory)

  • What it is: Everything in the active window—chat history, attached files, specs, and system rules.
  • Role: Ground truth evidence; the model has no project memory outside this boundary.
  • Attention target: The pool of tokens the model reads and attends over to ground its answer.
  • Analogy: The filelist (-f), include directories, and waveform data loaded into the simulator.

 

www.verificationexcellence.in
DV-Gym | Stage 1: AI-Era Design Verification Foundations

Good Prompting Practices

  • Be clear: state the DUT/block, language (SV/UVM/SVA), and the deliverable (property, RCA note, sequence, review comments).
  • State intent: what success looks like — e.g. “find why run_phase never ends,” not “fix my testbench.”
  • Name the action: one primary verb — explain, draft, audit, triage, compare — so the model does not mix authoring with approving.
  • Be detailed: include clock/reset polarity, 4-state vs 2-state, relevant file excerpts, and constraints (“do not dump a full rewritten env”).
  • Add structure: numbered steps, required output format, and “unknowns / assumptions” the model must list.
  • Iterate: if the first answer is vague, paste the log line or spec sentence and ask a narrower follow-up.

 

www.verificationexcellence.in
DV-Gym | Stage 1: AI-Era Design Verification Foundations

Prompt vs. Context: Weak Practice

  • Vague prompt: "Fix my testbench hang" or "Write an assertion for AXI."
  • Bloated context: Pasting an unfiltered 50k-line log or an entire 200-page spec chapter.
  • Missing boundaries: No clock/reset polarity, language dialect, or scope limits.
  • Result: Hallucinated register maps, missing resets, and generic software-style code.

 

www.verificationexcellence.in
DV-Gym | Stage 1: AI-Era Design Verification Foundations

Prompt vs. Context: Good DV Practice

  • Precise prompt: Explicit action ("Audit run_phase", "Draft concurrent SVA"), with output shape requirements.
  • Surgical context: 30 lines around the objection drop, timing diagram rules, and exact signal declarations.
  • Explicit constraints: Active-low reset, 4-state types, non-blocking requirements.
  • Result: Synthesizable, compilable artifacts grounded directly in your DUT.

 

How LLMs Process Prompts: Under the Hood

⚙️ Tokenize & Predict Loop

  • Tokens Over Words: Text and code are split into sub-word tokens (e.g., logic [31:0] is multiple tokens).
  • Next-Token Engine: The model predicts one token at a time based on statistical likelihood—not simulator logic.
  • Attention Over Context: Every generated token attends back across the prompt, system rules, and attached files.
  • Context Competition: Project rules, chat history, and prompt text all compete for the same attention pool.

⚠️ Attention Limits & Decay

  • Position Sensitivity: Tokens near the top and bottom of the context hold higher weight than the middle.
  • "Lost in the Middle": Dumping a 200-page AMBA/PCIe spec causes the model to miss rules buried in the center.
  • Precision Over Volume: A targeted 20-line excerpt with signal declarations yields higher accuracy than whole chapters.
  • Takeaway: You are steering a probabilistic sequence predictor—give it a clean, uncluttered runway.

The Hardware Analogy: Context is like your simulator's active sensitivity list—cluttering it with irrelevant signals causes sluggish execution and unpredictable side effects.

www.verificationexcellence.in
DV-Gym | Stage 1: AI-Era Design Verification Foundations

Token Usage, Costs, and Control

  • Tokens ≈ pieces of words/code. Input (prompt + files + history) and output (the answer) are both billed.
  • What burns tokens: huge logs, whole repos, long chats, agent loops that re-read files and re-run tools.
  • What to be aware of:
    • Pasting a 50k-line sim log is expensive and noisy — send the failing window + objection trace instead.
    • Repeating the same 20-turn thread costs more than a fresh prompt with a tight excerpt.
    • Agent “Run simulation / hint” loops multiply cost; cap retries and prefer a smaller model for triage.
  • Control habits: trim context, one bug per thread, Haiku/small model for lookup, stronger model for hard audits.
  • IP: tokens also leave your machine — do not paste proprietary RTL into unapproved public chats.

 

www.verificationexcellence.in