Hi All,
I am facing issue, when I was trying to send i2c_transaction items (Here, i2c_data & i2c_addr are dynamic arrays) from monitor to reg predictor for write/read transaction. But the transaction items especially i2c_data & i2c_addr are not reaching to reg predictor.
I am using the following lines of code to send transaction items from monitor to reg predictor.
uvm_analysis_port #(REQ) i2c_data_to_export;
virtual function void build_phase(uvm_phase phase);
i2c_data_to_export = new(“analysis_port”,this);
endfunction : build_phase
virtual function void send_transaction_to_analysis_export(REQ send_tran);
i2c_data_to_export.write(send_tran);
`uvm_info(this.get_name(),$psprintf(“Transaction Sent \n%s”,send_tran.sprint()), m_drv_verb_imp_msg_e)
endfunction : send_transaction_to_analysis_export
if (rsp.m_i2c_trans_type == READ || rsp.m_i2c_trans_type == RD_WITH_RE_START) begin
for (int idx = 0; idx < (m_i2c_data.size()); idx++) begin
{rsp.m_i2c_data[idx],rsp.m_i2c_data[idx+1]} = {m_i2c_data[idx],m_i2c_data[idx+1]};
end
end
`uvm_info(this.get_name(),$psprintf(“Transaction before Sent_gen \n%s”,rsp.sprint()), m_drv_verb_imp_msg_e) //1st display statement
//Send transaction out on analysis port.
send_transaction_to_analysis_export(rsp);
`uvm_info(this.get_name(),$psprintf(“Transaction Sent_gen \n%s”,rsp.sprint()), m_drv_verb_imp_msg_e) //2nd display statement
As shown in the above code, I have put two display statements, one is before sending the transaction items to analysis port and other one is after sending the transaction items.
In the 1st display statement, it displays all the transaction items. But in the second display statement, the values of transaction items are zero.
1st display statement ouput:
UVM_INFO /accts/smopidev/projects/fomax_branch_apr13_r219/dv/verif/common/uvc/i2c/i2c_driver.sv(915) @ 125.625000us: uvm_test_top.TB.env.walleye_i2c_agent.m_driver [m_driver] Transaction before Sent_gen
--------------------------------------------------------
Name Type Size Value
--------------------------------------------------------
req i2c_transaction - @4186
m_i2c_addr da(integral) 1 -
[0] integral 8 'h2
m_i2c_data da(integral) 4 -
[0] integral 8 'h43
[1] integral 8 'h50
m_trans_data_len integral 32 'h2
m_i2c_trans_type i2c_trans_type_e 3 READ
m_i2c_err_type i2c_err_config_e 4 NO_ERROR
m_no_of_acks integral 32 'h4
m_no_of_nacks integral 32 'h1
m_trans_start_time integral 64 'h33f38f8
m_trans_end_time integral 64 'h77ce2a8
m_i2c_tr_verb_e uvm_verbosity 32 UVM_DEBUG
begin_time time 64 1.500000us
2nd display statement output:
UVM_INFO /accts/smopidev/projects/fomax_branch_apr13_r219/dv/verif/common/uvc/i2c/i2c_driver.sv(919) @ 125.625000us: uvm_test_top.TB.env.walleye_i2c_agent.m_driver [m_driver] Transaction Sent_gen
--------------------------------------------------------
Name Type Size Value
--------------------------------------------------------
req i2c_transaction - @4186
m_i2c_addr da(integral) 1 -
[0] integral 8 'h0
m_i2c_data da(integral) 2 -
[0] integral 8 'h0
[1] integral 8 'h0
m_trans_data_len integral 32 'h2
m_i2c_trans_type i2c_trans_type_e 3 READ
m_i2c_err_type i2c_err_config_e 4 NO_ERROR
m_no_of_acks integral 32 'h4
m_no_of_nacks integral 32 'h1
m_trans_start_time integral 64 'h33f38f8
m_trans_end_time integral 64 'h77ce2a8
m_i2c_tr_verb_e uvm_verbosity 32 UVM_DEBUG
begin_time time 64 1.500000us
Would you please help me to fix this issue.