Chapter 1 – The DUT

This training guide will focus on showing how we can build a basic UVM environment, so the device under test was kept very simple in order to emphasize the explanation of UVM itself.

The DUT used is a simple ALU, limited to a single operation: the add operation. The inputs and outputs are represented in Figure 1.1.

Representation of the DUT

Figure 1.1: Representation of the DUT’s inputs/outputs

This DUT takes two values of 2 bits each, ina and inb, sums them and sends the result to the output out. The inputs are sampled to the signal of en_i and the output is sent at the same time en_o is signalled.

The operation of the DUT is represented as a timing diagram and as a state machine in Figure 1.2.

DUT Timing DiagramDUT State Machine








Figure 1.2: Operation of the DUT

The code for this DUT can be found here:

23 thoughts to “Chapter 1 – The DUT”

  1. Hello Pedro,
    Your blog has been really helpful for me as I could not find a much simpler explanation of UVM on the net. Currently, I am working on creating a UVM Environment for DDR3 and facing a lot of issues. Can you please get in touch with me via email?

  2. Pedro

    Can you please explain me why you are doing shift operation on temporary variables.

    And in Verilog design module there is never an initial block.

    Initial blocks are part of TestBench.

    Kindly reply..

    1. The initial block will initialize the signals to a certain known state. The same can be achieved with an initialization statement, see

      IMO, modules should have a reset signal and their internal registers should reset to a known state. Had the module a reset signal, I bet it’s registers would be assigned the values in the initial block. This case, maybe for simplicity, it has been omitted.

      Kind regards.

    2. The DUT has 2 bit inputs that arrive serially. In most examples, the 2 bits are available in the same cycle as the enable but in this particular case you get one bit of the input in the same clock cycle as the enable bit. The other input bit is received in the subsequent clock cycle. The shift operation is required to accommodate this DUT functionality.

  3. Hello pedro,

    i was struggling to understand UVM concept , this is proper and structured
    and other thing i am not able to access the codes
    the link you gave posts the error

  4. Hello! This is my first visit to your blog!
    We are a team of volunteers and starting a new initiative in a community
    in the same niche. Your blog provided us beneficial information to work on. You have done a extraordinary job!

Leave a Reply

Your email address will not be published. Required fields are marked *