Reference

One construct per page: the rule, a checked example, the common mistake, and the lessons that teach it.

RTL

  • always_ff A procedure for flip-flops. It runs on a clock edge and must use nonblocking assignments.
  • always_comb A 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 case and priority case These keywords state what you promise about a case. The simulator checks the promise and synthesis relies on it.
  • generate Loops and Parameters A generate loop repeats hardware at elaboration time. A parameter sets how many copies you get.

SystemVerilog

  • logic, wire and reg logic is a four-state variable that replaces reg. A wire is a net, the only kind that resolves several drivers.
  • fork with join, join_any and join_none A fork starts 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.
  • inside and dist in Constraints inside limits a random variable to a set of values. dist also gives each value a weight.
  • typedef enum and 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.
  • mailbox A mailbox is a FIFO between processes. put adds a message and get waits for one.
  • virtual Methods A virtual method is chosen by the object, not by the handle. This is what makes overriding work.
  • interface and modport An 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, $stable and $past These functions compare the sampled value at this clock edge with the one at the edge before.

Coverage

  • Coverpoint bins A coverpoint samples one expression. Its bins name the values you want to have seen.

UVM

  • uvm_config_db A 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.