Reference
One construct per page: the rule, a checked example, the common mistake, and the lessons that teach it.
RTL
always_ffA procedure for flip-flops. It runs on a clock edge and must use nonblocking assignments.always_combA procedure for combinational logic. The simulator works out the sensitivity list for you.- Blocking
=and Nonblocking<=A blocking assignment updates at once. A nonblocking assignment reads now and updates at the end of the time step. unique caseandpriority caseThese keywords state what you promise about acase. The simulator checks the promise and synthesis relies on it.generateLoops and Parameters A generate loop repeats hardware at elaboration time. A parameter sets how many copies you get.
SystemVerilog
logic,wireandreglogicis a four-state variable that replacesreg. Awireis a net, the only kind that resolves several drivers.forkwithjoin,join_anyandjoin_noneAforkstarts its statements as parallel processes. The closing keyword says how long the parent waits.- Queue Methods A queue is a variable-size list. It grows and shrinks at both ends in constant time.
insideanddistin Constraintsinsidelimits a random variable to a set of values.distalso gives each value a weight.typedef enumand Its Methods An enum gives names to a set of values. Its methods step through the names and print them.- Associative Arrays An associative array stores values under keys. It holds only the entries you write.
mailboxA mailbox is a FIFO between processes.putadds a message andgetwaits for one.virtualMethods A virtual method is chosen by the object, not by the handle. This is what makes overriding work.interfaceandmodportAn interface bundles the signals of a connection. A modport gives each side its directions.- Clocking Blocks A clocking block fixes when a testbench samples and drives signals, relative to a clock edge.
Assertions
- Implication
|->and|=>An implication checks its right side only when its left side matches.|->starts the check in the same cycle,|=>one cycle later. $rose,$fell,$stableand$pastThese functions compare the sampled value at this clock edge with the one at the edge before.
Coverage
- Coverpoint
binsA coverpoint samples one expression. Its bins name the values you want to have seen.
UVM
uvm_config_dbA typed lookup table. A higher component stores a value under a path and a name; a lower one fetches it.- UVM Factory Overrides The factory builds objects by type. An override makes it build a child class instead, with no change to the environment.