Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • Logic Synthesis Glossary
  • Logic Synthesis Cheatsheet
  • Synthesis Foundations14
  • Logic Optimisation and Mapping20
  • Constraints and Timing15
  • Sequential, FSM and Memory19
  • Datapath Synthesis14
  • Area, Power and Test14
  • Verification, ECO and Handoff15
  • Flows and Debugging15
    • Scripted Flows and Regression
      • Flows as Code
      • Parameterised Runs in Yosys
      • Logging and QoR Extraction
      • Nightly Regression and Thresholds
      • Noise Versus Real Change
    • Debugging QoR
    • Simulation-Synthesis Mismatch
  • Interview and Judgment11
Loading lesson

‹Scripted Flows and Regression
  1. Topics
  2. Logic Synthesis
  3. Flows and Debugging
  4. Scripted Flows and Regression
  5. Parameterised Runs in Yosys

Part 8 · Flows and Debugging · Intermediate

Parameterised Runs in Yosys

One width-parameterised adder run at widths 4 and 8 with asserted cell counts.

On this page

    One module, several widths

    A width parameter turns one adder into a family of adders. The flow elaborates the same source at each width and checks each result.

    Each run below holds a single top module with one addition. The generic netlist of each run therefore holds exactly one $add cell.

    Width

    Ports

    Generic netlist

    4

    Two 4-bit inputs, one 5-bit sum

    Exactly one $add cell.

    8

    Two 8-bit inputs, one 9-bit sum

    Exactly one $add cell.

    The runnable flow

    The script reads the parameterised adder inline, runs generic synthesis, and asserts the adder count at each width. It ends with one log PASS line.

    yosys
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    read_verilog <<EOV
    module top #(parameter W = 4) (input [W-1:0] a, b, output [W:0] s);
      assign s = a + b;
    endmodule
    EOV
    hierarchy -top top
    proc
    opt_clean
    check
    select -assert-count 1 t:$add
    stat
    design -reset
    read_verilog <<EOV
    module top #(parameter W = 8) (input [W-1:0] a, b, output [W:0] s);
      assign s = a + b;
    endmodule
    EOV
    hierarchy -top top
    proc
    opt_clean
    check
    select -assert-count 1 t:$add
    stat
    log PASS: width-parameterised adder gives one adder cell at widths 4 and 8

    Assertions are the proof

    stat prints the generic census into the log for human readers. select -assert-count pins the counts, so a wrong claim fails the run instead of the review.

    Assertion

    What it pins

    select -assert-count 1 t:$add at width 4

    The 4-bit run holds exactly one generic adder.

    select -assert-count 1 t:$add at width 8

    The 8-bit run holds exactly one generic adder.

    check in each run

    The netlist is structurally sound before counting.

    Common mistakes

    Common pitfall

    Asserting exact mapped cell areas from ABC output makes the flow brittle, because tool versions, options, libraries or machine parallelism can move them. Assert generic counts and relative comparisons, and treat mapped areas as measured data with a tolerance band.

    Interview

    Likely probes: what the assertions prove, and why the script avoids mapped areas.

    • Each width elaborates to exactly one generic adder; the count is pinned, not eyeballed.

    • Generic counts are stable across widths here; treat mapped areas as measured data with a tolerance band, because tool versions, options, libraries or machine parallelism can move them. Identical pinned reruns should reproduce.

    • One log PASS line marks a fully asserted run.

    Check yourself The width grows from 8 to 64. Which assertion changes?

    Neither. Each run still holds exactly one $add cell, so the proof is width-independent.

    Check yourself Why does the script keep stat if select carries the proof?

    stat writes the census into the log for humans. select turns the key counts into failures when they are wrong.

    Related topics

    • Logging and QoR extraction

    • Cell libraries and Liberty

    Previous

    115 / 139

    Next: Logging and QoR Extraction

    Up next

    Up nextLogging and QoR Extraction

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Nightly Regression and Thresholds
    • Noise Versus Real Change