Jump to content

Chnages in paylod in UVM b_transport not reflected on TLM side


Recommended Posts

Hello Guys

I have a scenario where I have an initiator module on SystemC side and target module on UVL side. From initiator side, I call b_transport with some payload and in target side the data field is modified. What I am seeing that when b_transport returns on initiator module, the changes in data field is not reflected.

On SystemC side, I have a thread with following function

 void run(){
    int i = 4;
    while(i--){
    cout<<" in run........"<<endl;
    tlm::tlm_generic_payload* trans = new tlm::tlm_generic_payload;
    sc_time delay = sc_time(100, SC_NS);
    trans->set_command(tlm::TLM_WRITE_COMMAND);
    uint64_t addr = 0x0;
    uint8_t data = 0xa5;
    uint32_t length = 1;
    trans->set_address(addr);
    trans->set_data_ptr( reinterpret_cast<unsigned char*>(&data));
    trans->set_data_length(length);
    trans->set_streaming_width(length);
    trans->set_response_status(tlm::TLM_INCOMPLETE_RESPONSE);
    initiator_socket->b_transport(*trans,delay);
    cout<<"Result : 0xa5 vs 0x"<<hex<<+data<<endl;
    wait(delay);
    }
 }

On UVM target side, my b_transport implementation is as follows

   task b_transport(uvm_tlm_generic_payload gp, uvm_tlm_time delay);
       byte unsigned data[];
       gp.get_data(data);
       `uvm_info("INFO", $sformatf("entering b_transport with data[0] : 0x%x",gp.m_data[0]), UVM_LOW);
       data[0] = ~data[0];
       gp.set_data(data);
       `uvm_info("INFO", $sformatf("exiting b_transport with data[0] : 0x%x",gp.m_data[0]), UVM_LOW);
   endtask

and the output I am getting is

UVM_INFO @ 0: reporter [RNTST] Running test SV:sv_top set by +UVM_TESTNAME...
 in run........
UVM_INFO sv_target.sv(31) @ 0: uvm_test_top.targ [INFO] entering b_transport with data[0] : 0xa5
UVM_INFO sv_target.sv(34) @ 0: uvm_test_top.targ [INFO] exiting b_transport with data[0] : 0x5a
Result : 0xa5 vs 0xa5
 in run........
UVM_INFO sv_target.sv(31) @ 100000: uvm_test_top.targ [INFO] entering b_transport with data[0] : 0xa5
UVM_INFO sv_target.sv(34) @ 100000: uvm_test_top.targ [INFO] exiting b_transport with data[0] : 0x5a
Result : 0xa5 vs 0xa5
 in run........
UVM_INFO sv_target.sv(31) @ 200000: uvm_test_top.targ [INFO] entering b_transport with data[0] : 0xa5
UVM_INFO sv_target.sv(34) @ 200000: uvm_test_top.targ [INFO] exiting b_transport with data[0] : 0x5a
Result : 0xa5 vs 0xa5
 in run........
UVM_INFO sv_target.sv(31) @ 300000: uvm_test_top.targ [INFO] entering b_transport with data[0] : 0xa5
UVM_INFO sv_target.sv(34) @ 300000: uvm_test_top.targ [INFO] exiting b_transport with data[0] : 0x5a
Result : 0xa5 vs 0xa5

It seems that on UVM side the data field is updated well but on TLM side it is not reflected.

Can you help me to understand what is going wrong here ?

Thanks

Khushi

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...