Quantcast
Channel: UVM Forums RSS Feed
Viewing all articles
Browse latest Browse all 756

register a register call back to a reg_block model

$
0
0

Hello All,

 

I am trying to register my call back class to the register block model for the test bench.

 

Here is my register call back class.

class aiop_register_call_back extends uvm_reg_cbs;
    
  `uvm_object_utils(aiop_register_call_back);
 
  // Set the Function Name
  function new(string name = "aiop_register_call_back");
     super.new(name);
     //this.set_response_queue_error_report_disabled(1'b1);
  endfunction 
 
  uvm_elem_kind_e element_kind;
  uvm_object element; 
  uvm_access_e kind; 
  uvm_reg_data_t value[]; 
  uvm_reg_addr_t offset;
  uvm_status_e status;
  uvm_path_e path;
  uvm_sequence_base parent;
 
  virtual task post_write(uvm_reg_item rw);
    element_kind = rw.element_kind;
    element      = rw.element;
    value        = rw.value;
    offset       = rw.offset;
    status       = rw.status;
    path         = rw.path;
    parent       = rw.parent;
    `uvm_info("AIOP REGISTER CALL BACK", $sformatf("%0s,%0s,%0h,%0h,%0s,%0s,%0s",element_kind,element,value,offset,status,path,parent), UVM_NONE);
  endtask
 
endclass : aiop_register_call_back
 
My question is how would I associate this call back to the reg_block model in the test bench. I have been searching for a while and have not been able to find a clear example or answer to this.
 
I have tried using:
uvm_callbacks::add(reg_block object handle, callback object)
`uvm_register_cb(reg_block,callback)
 
Any help appreciated.
 
 
 

Viewing all articles
Browse latest Browse all 756

Trending Articles