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. Nightly Regression and Thresholds

Part 8 · Flows and Debugging · Intermediate

Nightly Regression and Thresholds

Compare EXAMPLE QoR tables against thresholds with a runnable comparator.

On this page

    Baseline, current, thresholds

    A regression keeps one baseline record per case and compares each nightly run against it. Thresholds decide the verdict before any human looks.

    All numbers below are EXAMPLE parameters in teaching units. Area is in course.lib units, slack in EXAMPLE picoseconds, power in EXAMPLE microwatts.

    Case

    Baseline area

    Baseline WNS (ps)

    Baseline power

    w4

    52

    120

    31

    w8

    104

    90

    62

    w16

    208

    40

    124

    w32

    416

    10

    248

    Case

    Current area

    Current WNS (ps)

    Current power

    w4

    53

    118

    31

    w8

    112

    88

    63

    w16

    207

    12

    125

    w32

    418

    9

    262

    Metric

    Regression rule

    Boundary

    Area

    Current x 100 above baseline x 105

    Exactly plus 5% is noise.

    Power

    Current x 100 above baseline x 105

    Exactly plus 5% is noise.

    Timing

    Baseline WNS minus current WNS above 20 ps

    Exactly 20 ps is noise.

    Worked verdicts

    Each verdict substitutes the EXAMPLE numbers into its rule. Integer products keep the comparison exact.

    Diagram
    w4 area: 53 x 100 = 5300 vs 52 x 105 = 5460 -> 5300 < 5460, noise (+1.92%)
    w8 area: 112 x 100 = 11200 vs 104 x 105 = 10920 -> 11200 > 10920, regression (+7.69%)
    w16 timing: 40 - 12 = 28 ps drop vs 20 ps band -> 28 > 20, regression
    w32 power: 262 x 100 = 26200 vs 248 x 105 = 26040 -> 26200 > 26040, regression (+5.65%)
    w4 timing: 120 - 118 = 2 ps drop, noise; w8 power: up 1 on 62 = 1.61%, noise

    The runnable comparator

    The program below encodes both EXAMPLE tables and the three rules. Its nine self-checks pin every verdict plus the boundary behaviour.

    example.py
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    import sys
    
    BASE_AREA = {"w4": 52, "w8": 104, "w16": 208, "w32": 416}
    BASE_WNS = {"w4": 120, "w8": 90, "w16": 40, "w32": 10}
    BASE_POWER = {"w4": 31, "w8": 62, "w16": 124, "w32": 248}
    CURR_AREA = {"w4": 53, "w8": 112, "w16": 207, "w32": 418}
    CURR_WNS = {"w4": 118, "w8": 88, "w16": 12, "w32": 9}
    CURR_POWER = {"w4": 31, "w8": 63, "w16": 125, "w32": 262}
    
    def area_regressed(base, curr):
        return curr * 100 > base * 105
    
    def power_regressed(base, curr):
        return curr * 100 > base * 105
    
    def timing_regressed(base_wns, curr_wns):
        return base_wns - curr_wns > 20
    
    def flags_for(case):
        flags = []
        if area_regressed(BASE_AREA[case], CURR_AREA[case]):
            flags.append("area")
        if timing_regressed(BASE_WNS[case], CURR_WNS[case]):
            flags.append("timing")
        if power_regressed(BASE_POWER[case], CURR_POWER[case]):
            flags.append("power")
        return flags
    
    def check(cond, label):
        if not cond:
            print("FAIL: " + label)
            sys.exit(1)
    
    flags = {}
    for case in ["w4", "w8", "w16", "w32"]:
        flags[case] = flags_for(case)
    
    check(flags["w4"] == [], "w4 within band stays clean")
    check(flags["w8"] == ["area"], "w8 flags area only")
    check(flags["w16"] == ["timing"], "w16 flags timing only")
    check(flags["w32"] == ["power"], "w32 flags power only")
    check(area_regressed(100, 105) is False, "exact plus 5 percent is noise")
    check(area_regressed(100, 106) is True, "above 5 percent is regression")
    check(timing_regressed(100, 80) is False, "exact 20 ps drop is noise")
    check(timing_regressed(100, 79) is True, "21 ps drop is regression")
    check(len(flags["w4"]) + len(flags["w8"]) + len(flags["w16"]) + len(flags["w32"]) == 3, "three flags in total")
    
    print("PASS: comparator flags area on w8 timing on w16 power on w32")

    Common mistakes

    Common pitfall

    A zero threshold pages on every wiggle, and then nobody reads the mail. Bands absorb noise so that each alert names a metric worth debugging.

    Interview

    Likely probes: reading one verdict, and why the rules use strict greater-than.

    • w8 flags area only: 11200 beats 10920 while timing and power stay in band.

    • Strict greater-than keeps exact plus-5% and exact 20 ps moves as noise.

    • Nine self-checks pin four verdicts, four boundaries and the flag total.

    Check yourself The comparator flags w8 area and w16 timing but clears w4. What makes w4 different?

    Every w4 move sits inside its band: area 5300 below 5460, a 2 ps timing drop, power unchanged. Inside the band is noise by policy.

    Check yourself Why do the boundary checks use strict greater-than?

    So an exact plus-5% or exact 20 ps move stays noise. The policy pages on exceeded bands, not touched ones.

    Related topics

    • Noise versus real change

    • Area, power and timing trade-offs

    Previous

    117 / 139

    Next: Noise Versus Real Change

    Up next

    Up nextNoise Versus Real Change

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Flows as Code
    • Parameterised Runs in Yosys