How design configuration libraries work, the SV extension that adds interfaces, programs, and packages as first-class library cells, and how configurations fit into the larger SV compilation and elaboration model.
Large designs often have multiple versions of the same module — a behavioural model and a gate-level netlist both named alu, for example. Without a way to specify which version to use where, the simulator simply uses whichever it finds first. Configuration libraries solve this by making the binding explicit and controllable per-instance.
Three constructs work together:
config...endconfig) specifies which library cell to bind to which instance in the design hierarchy, with optional instance-level and cell-level overrides.alu from rtl_lib everywhere, except use the gate-level version from gates_lib at exactly top.cpu.alu.” This is how mixed-level simulations, verification IP injection, and regression variants are assembled cleanly — without touching the source files of the design itself.SystemVerilog extends the definition of a cell to include the new SV constructs. In Verilog-2001, only modules, macromodules, primitives, and configurations were valid cells. SystemVerilog adds:
interface — can now be stored in a library and bound through a configuration.program — can now be stored in a library and bound through a configuration.package — can now be stored in a library and bound through a configuration.All existing configuration syntax and semantics are unchanged. The config/endconfig keywords, design, default liblist, instance override, and cell override work exactly as before — the only extension is that more things can appear as cells.
Green = new cell types added by SystemVerilog
A configuration declaration names the top-level design unit, sets a default library search order, and can then override that default for specific instances or for all uses of a specific cell name.
// Library map file (passed to the tool as an invocation option): // library rtl_lib ./rtl/*.sv; // library gates_lib ./netlist/*.v; // library tb_lib ./tb/*.sv; config cfg_sim; design rtl_lib.top; // top-level design unit from rtl_lib default liblist rtl_lib; // all instances default to rtl_lib // Instance override: use gate-level alu at this specific path instance top.cpu.alu liblist gates_lib; // Cell override: all uses of 'mem' use gates_lib (regardless of path) cell mem liblist gates_lib; endconfig // With SV, tb_lib can contain interfaces and programs as cells config cfg_full; design rtl_lib.top; default liblist rtl_lib tb_lib; cell bus_ifc liblist tb_lib; // interface cell from the testbench library cell test liblist tb_lib; // program block cell from the testbench library endconfig
In SV’s compilation model, constructs visible across all compilation units include modules, macromodules, primitives, programs, interfaces, and packages. Configurations build on top of this: they choose which version of any of these constructs to bind during elaboration.
The tool uses whatever version of a named unit it finds first, according to its own file-search order. Works for small single-library designs but breaks down when multiple library versions or mixed-level simulation is needed.
The tool follows explicit binding rules. Every version of every cell used at every hierarchy level is precisely specified. Enables gate-level substitution, testbench IP injection, and regression variants without touching design source files.
| Term | Definition |
|---|---|
| Library | A named collection of cells. Source files are mapped to libraries via a library map file passed to the tool. |
| Cell | A named design unit: module, macromodule, primitive, configuration, interface (SV), program (SV), or package (SV). |
| Configuration | A config...endconfig block that explicitly binds cell names to specific library versions for a given design hierarchy. |
| Library map file | A file (passed as a tool option) that lists which source files belong to which library. |
| SV addition | Interfaces, programs, and packages are now valid cell types in addition to the original Verilog types. No syntax changes. |
$typeof and $typename, $bits for bit-stream sizing, array dimension query functions, assertion severity and control tasks, random number functions, and enhancements to file read/write tasks.