newbie
newbie

Reputation: 4789

How to monitor DUT outputs from a test/sequence?

I am a beginner in UVM. So far I was able to create the following environment for my DUT.

Agents with monitors, drivers and sequences for all of the input-output interfaces from my DUT. A top level UVM env. Sequences to send valid data to DUT. I yet to implement scoreboard.

I'm having some trouble to understand how to handle scenarios like following:

For a tb-dut interface, TB needs to wait for an event (or transaction) from DUT. Once it receives the transaction, TB needs to send back a response. What is the best way to implement this? How can I monitor DUT transaction from sequence? My agents have monitors which will monitor any new output signals from DUT. So, do I need to somehow bring this data from agent's monitor to my test/sequence class? I know that monitor has an analysis port and it can be used to send received data to scoreboard for checking. So, do I need to use the same port to read DUT output data, create valid response and send it to DUT?

Thanks!

Upvotes: 0

Views: 3897

Answers (2)

AldoT
AldoT

Reputation: 943

This can be done using uvm_object.

  1. Create uvm_object base class. Define your virtual method, for example wait_state, but leave it empty.
  2. Extend that class and implement the virtual method. Include the class inside the testbench and instantiate an object. Say the object is "my_tb"
  3. Use uvm_config_db#(uvm_object)::set ... to pass it to sequencer
  4. Grab the object inside the sequencer usign uvm_config_db#(uvm_object)::get ...
  5. From inside your sequence: any where any time you can access it: p_sequencer.my_tb.wait_state().

Upvotes: 0

dave_59
dave_59

Reputation: 42698

This is know as a slave sequence or responder. The protocol is as follows

  1. Slave sequence sends a request to the driver - "Tell me what to do"
  2. Driver detects a bus level request and returns the information back to the sequence - "This is what you should do"
  3. Slave sequence does what it needs to do to prepare a response and then sends a response item to the driver - "Here you go"
  4. Driver completes the bus level response with the contents of the response item, completes handshake back to the sequence - "Thank you"

This is explained in more detail in the Verification Academy UVM Cookbook.

Upvotes: 6

Related Questions