Hello,
I have an UVM environment , where i am trying to connect driver and monitor via interface pins intf.data_in = seq and intf.data_out= intf.data_in (in driver class) and getting the intf in monitor via config_db , in driver class int.data_in and intf.data_out printing value but in monitor when i try to print intf.data_out then it gives “xxx” ,please suggest,thnks
driver part:
task run_phase(uvm_phase phase);
forever @(posedge intf.clk)
begin
// reset();
seq_item_port.get_next_item(req);
drive_pin(req);
seq_item_port.item_done();
end
endtask
task drive_pin(stimulus req);
@(posedge intf.clk) begin
intf.data_in = req.data;
`uvm_info("DRIVER",$sformatf("PIN DRIVE %h", intf.data_in),UVM_LOW)
intf.valid = 1'b1;
end
intf.data_out = intf.data_in;
`uvm_info("DRIVER",$sformatf("PIN DRIVE %h", intf.data_out),UVM_LOW)
endtask
monitor class:
function void axi_monitor::build_phase(uvm_phase phase);
begin
if(!uvm_config_db#(virtual axi_intf )::get(this,"","intf",intf))
`uvm_error(" ERROR MONITOR",$sformatf("%s ",this.get_type_name()))
m_seq = stimulus::type_id::create("m_seq",this);
end
endfunction
endfunction
task axi_monitor::run_phase(uvm_phase phase);
begin
collect_data(m_seq);
aport.write(m_seq);
end
endtask
task axi_monitor::collect_data(stimulus m_seq);
begin
forever
begin
@(posedge intf.clk)
m_seq.data = intf.data_out;
`uvm_info("MONITOR",$sformatf("MONITOR %h",intf.data_out),UVM_LOW);
end
end
endtask
thnks