Jump to content

lisakb1963

Members
  • Content Count

    39
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by lisakb1963

  1. First, let me apologize -- markups does not seem to work anymore.

    Callbacks in the register model are really meant to extend the functionality of register if doesn't match one of the pre-defined registers already defined in UVM_REG. Also you can extend one of the pre-defined registers with unique behavior.

    If you are performing certain functions, say waiting for an interrupt -- you should use wait_for_change. Unfortunately, it needs backdoor access and isn't implemented in the model -- so you need to provide an implementation (and there really aren't UVM_REG specific guidelines for this). This involves DPI code if you want to wait based on a string name. Your simulator vendor may have something already. This is how it is defined:

    is_auto_updated
    
    virtual function bit is_auto_updated(	uvm_reg_field 	field	)
    Indicates if wait_for_change() method is implemented
    Implement to return TRUE if and only if wait_for_change() is implemented to watch for changes in the HDL implementation of the specified field
    [B]wait_for_change
    [/B]
    virtual local task wait_for_change(	uvm_object 	element	)
    Wait for a change in the value of the register or memory element in the DUT.
    When this method returns, the mirror value for the register corresponding to this instance of the backdoor class will be updated via a backdoor read operation.
    

    Section 5.6.6 Active Monitoring of the UVM User's Guide

    explains how to use this.

    If you don't mind having hard paths like the one in the example (this is a partial example):

    virtual task wait_for_change();

    @($root.tb_top.dut.rf.f1 or $root.tb_top.dut.rf.f2);

    endtask

    Then you can implement it quite easily without the DPI. I've done this and it works. Hard paths don't work in packages. This is one reason you need the DPI. Also you can't wait_for_change on a string name. I found some free DPI code by goggling:

    wait_for_change + UVM_REG

    1. There are white papers that explain it.

    2. There are some free tools that give you the SV and C code you need.

    3. Ask you vendor if they already have this code. I'd still look at some of the white papers.

    Hope that helps:

    LKB

×
×
  • Create New...