Types of Coverage Metrics: Code Coverage vs Functional Coverage, With a Real VCS Run
Line, branch, condition, toggle and FSM coverage next to a covergroup, all measured on one small design in VCS. See where each one finds holes the other misses.
Line, branch, condition, toggle and FSM coverage next to a covergroup, all measured on one small design in VCS. See where each one finds holes the other misses.
In short: Plusargs are switches you add to the simulator’s run command, each starting with +, like +DEBUG or +SEED=42. Your code reads them at run time, so you can change a test’s behaviour without recompiling. $test$plusargs(“DEBUG”) tells you whether a switch is there. $value$plusargs(“SEED=%d”, seed) reads the value after it. Always set a default…
ifdef is decided at compile time, plusargs at run time. A simple example plus an 8-check UVM bench with $value$plusargs, the prefix trap and uvm_cmdline_processor, tested on VCS.
In short: A constraint override happens when a child class declares a constraint with the same name as one in its parent. The child version replaces the parent version, so the solver uses only the child rule. If instead the child uses a different name, both constraints stay active and must be satisfied together, and…
randomize() works on a class object; std::randomize() works on plain variables. One tested UVM file, real VCS output, and the traps: with, local::, overflow, failures.
Every covergroup option that changes your number: per_instance, at_least, weight, auto_bin_max, goal and more, each measured in one UVM bench on VCS.
Three ways to get randc-style no-repeat values from a rand variable, run on VCS: a history list, a pool with a rand index, and shuffle. Which is fastest.
Immediate assertions check a value right now. Concurrent assertions check a pattern over clock edges. One tested file, five runs, and what VCS prints for each.
In short: To fill an array with values that never repeat, mark the array rand and add one line: constraint c { unique {arr}; }. The solver then gives every element a different value. On an old simulator that doesn’t know unique, use a nested foreach with !=. And if you don’t need the solver…
Make an array of unique values without randomize(): fill and shuffle, formulas, pick until unused and a shuffled pool. A simple example plus an 8-check UVM bench, tested on VCS.