How to define Driver Component and drive transcation using UVM
UVM has a built in library "uvm_driver" used to define the Driver component
// driver points to the item as tx_item defined using sequence item
class tx_driver extends uvm_driver #(tx_item);
// UVM component macro registers this with the factory definition
`uvm_component_utils(tx_driver)
function new (string name, uvm_component parent);
super.new(new,parent);
endfunction
virtual task run_phase(uvm_phase phase);
tx_item tx; // pointing to sequence item definition
forever begin
seq_item_port.get_next_item(tx);
drive_to_dut(tx);
seq_item_port.item_done();
end
endtask
virtual task drive_to_dut (tx_item tr);
`uvm_info("TRANSFER", $sformatf("tr.data = %4d", tr.data), UVM_LOW);
endtask
endclass
**** UVM_LOW points to Message logger with verbosity level LOW
**** component definition have the string and parent definition
**** For object definition have only string definition
Comments
Post a Comment