# Can we use interface in object in uvm?

**URL:** <https://verificationacademy.com/forums/t/can-we-use-interface-in-object-in-uvm/33843>\
**Category:** UVM\
**Tags:** UVM\
**Created:** [December 19, 2017, 5:40pm UTC](https://verificationacademy.com/forums/t/can-we-use-interface-in-object-in-uvm/33843 "2017-12-19T17:40:32Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![arjun.p.rajagopalan.intel.com](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/a/90ced4/32.png) [@arjun.p.rajagopalan.intel.com](https://verificationacademy.com/forums/u/arjun.p.rajagopalan.intel.com)\
**Post date:** [February 14, 2019, 5:28pm UTC](https://verificationacademy.com/forums/t/can-we-use-interface-in-object-in-uvm/33843/5 "2019-02-14T17:28:43Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/can-we-use-interface-in-object-in-uvm/33843/4):_

This is my driver run task code

```verilog

    task get_and_drive();
        basic_seq_item req;
	drv_vif.intf_a = 0;drv_vif.intf_b = 0;drv_vif.intf_c = 0;drv_vif.intf_start = 0;
        forever begin
	    @(posedge drv_vif.intf_clk);
	    seq_item_port.get_next_item(req);
	    drv_vif.intf_a = req.seq_item_a;
	    drv_vif.intf_b = req.seq_item_b;
	    drv_vif.intf_start = req.seq_item_start;
            `uvm_do_callbacks(alu_driver, alu_drv_cb, corrupt_data())
	    drv_ap.write(req);
	    //`uvm_info(get_type_name, $sformatf("Driver transaction %s", req.sprint()), UVM_LOW)
	    seq_item_port.item_done();
	end 
    endtask : get_and_drive

```

Here is the callback I want to implement, the idea is the callback generates junk output values which would be caught in the scoreboard.

```verilog

class alu_drv_cb extends uvm_callback;

    function new(string name = "alu_drv_cb");
        super.new(name);
    endfunction : new

    virtual task corrupt_data();
    // Drive random data on interface output, something along the lines of
    // intf_handle.intf_c = 'h1234_5678;
    endtask : corrupt_data

endclass : alu_drv_cb

```

---

_[View the full topic](https://verificationacademy.com/forums/t/can-we-use-interface-in-object-in-uvm/33843)._
