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

  • RTL Foundations36
  • Combinational Design25
  • Sequential Design27
  • FSM & Control27
  • Timing & Clocking39
  • Reset & CDC34
  • Memory & Buses57
  • Advanced RTL28
    • Parameterization and Generate Hub
      • Parameters vs localparams
      • Generate loops and conditionals
      • Avoid defparam overrides
    • Top-Level Integration Hub
    • Synthesis Intent Hub
    • Style and Static Checks Hub
    • Assertions in RTL Hub
    • Formal Verification Basics Hub
    • Reusable SystemVerilog for RTL
  • Senior & Interview76
  • Glossary and Notation
Loading lesson

‹Advanced RTL
  1. Topics
  2. RTL Design
  3. Advanced RTL
  4. Parameterization and Generate Hub

Part 8 · Advanced · Advanced

Parameterization and Generate Hub

One module for every width and depth: parameters, generate blocks, and safe overrides.

  • 3topics
  • 3lessons
On this page

    Advanced teams avoid copy-paste modules. Parameters define configurable interfaces, while generate duplicates structure safely.

    The parent instance sets LANES to 4 and WIDTH to 8 by name. These parameters feed a localparam SW equal to 2, the select width for four lanes, and a for-generate that builds four named lanes of 8-bit logic.
    How the three mechanisms divide the work: the parent sets parameters, localparams derive from them, and generate turns them into replicated hardware

    Read the picture from the top: only the first box is chosen by the caller. Everything below it follows by formula or by elaboration.

    • Parameter: the one value the parent writes, at the instance, by name.

    • Localparam: a width computed from it once, such as 2 select bits for 4 lanes.

    • Generate: the copies of hardware, each with a block name you will see in the netlist.

    The benches in this topic are finite digital checks, not physical signoff results.

    Lessons in this topic

    3 lessons, about 9 min

    1. 1Parameters vs localparamsYou can split a module's inputs into parameters and derived localparams, override them by name, and guard the N equal to 1 case.3 min
    2. 2Generate loops and conditionalsYou can choose between a generate loop, an if generate and a case generate, and explain how each differs from a procedural loop.3 min
    3. 3Avoid defparam overridesYou can override parameters by name at the instantiation, pass them down each level, and show that each override took effect.3 min

    Lesson

    Idea

    Parameters vs localparams

    One source for every width, with math that survives N equal to 1.

    Generate loops and conditionals

    Lane replication with for, structural choice with if and case.

    Avoid defparam overrides

    Named overrides checked with fill/drain and walking-bit stimulus.

    Check yourself One source module serves an 8-bit lane block and a 16-bit lane block. What differs between the two builds?

    Only the elaborated widths and replicated logic. The source stays single, so a fix lands in both builds at once.

    Interview

    Be ready to sort any value into parameter, localparam, or generate: caller-configured, derived, or structural. Interviewers probe exactly that split.

    Revision sheet

    The whole topic on one page, taken from each lesson's Remember box. Read it before an interview, or print it.

    Parameters vs localparams

    • A parameter is an input to elaboration; a localparam derives from it and cannot be overridden.

    • Compute each dependent width once, in one localparam formula.

    • Guard $clog2 for N equal to 1, and require N and WIDTH to be positive.

    Rule of thumb: if a value follows from another, make it a localparam, never a second parameter.

    Generate loops and conditionals

    • A generate loop builds N copies of hardware, each under its own block name.

    • If and case generate pick a structure from an elaboration constant, never from a signal.

    • Keep the count parameter strictly positive.

    Rule of thumb: structure replication is generate; value computation is a procedural loop.

    Avoid defparam overrides

    • Named overrides keep order irrelevant and keep the value at the instance.

    • defparam sets a value by hierarchical path after instantiation, so the instance site hides it. This course bans it.

    • Prove an override with behaviour: fill each instance and check that full rises after exactly DEPTH writes.

    Rule of thumb: if the value is not visible at the instantiation, a reviewer will not find it.

    Practise it

    • Mini project: a reusable FIFO IP with package, interface, assertions and a formal check

    • Code lab: Parameters and localparams

    • Practice question: Generate-for versus generate-if in a parameterised design

    • Code lab: Generate loop

    • Interview: run a mock interview on this topic

    PreviousNext: Parameters vs localparams

    Up next

    Up nextParameters vs localparams

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Top-Level Integration Hub
    • Synthesis Intent Hub
    • Style and Static Checks Hub