Jump to content

Simulation ends after b_transport: why?

Recommended Posts



I used b_transport in of my TL models to exchange data from a transactor to a memory. It was a read/write/reset operation kinda thing. Data from memory is transferred to another module attached to the transactor.


What I noticed was at the end of my b_transport call, the simulation ends directly, without returning to the transactor thread in order to affect the obtained data from memory (in case of a read operation, for example) to the port connecting the transactor and the other module.


Why is this?


Code for reference:



// TLM-2 blocking transport method
virtual void b_transport(tlm::tlm_generic_payload& trans, sc_time& delay) {

/** Code here to transfer data **/

// Realize wait delay to advance simulation time

// After wait, the simulator goes directly back to sc_main



void thread_process() {

/** Code here **/

 while(true) {

 wait(CLK->posedge_event());               // Wait on CLK posedge event

/** More code here **/

 payload_setup(trans, cmd, data_ref, addr);

 rtt2a_socket->b_transport(*trans, delay); // Blocking transport call. Trans is a generic payload

 // I expected the program to return here, but it didn't 

 // Initiator obliged to check response status and delay
 if (trans->is_response_error())
  SC_REPORT_ERROR("TLM-2", "Response error from b_transport");

 if(cmd == tlm::TLM_READ_COMMAND)
  DATA->write(d_word_t(data));   // Write data back to port. So far, this does not work properly 


Thank you,

Link to comment
Share on other sites

I did set it previously.


I found out the problem by the way. I set simulation duration to be exactly the same as that of the b_transport, therefore somehow the simulation ends after the call to wait.



Maybe I need more training in writing adaptor-type transactors? Kinda getting tedious trying to interface RTL and TLM  :wacko:

Link to comment
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.

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...