Jump to content
g_as

Send one byte over tlm 2.0

Recommended Posts

I set the following in the constructor  

char test = 'X';

 uint32_t t_add  = 0;

and in the run()

sc_core::sc_time delay = sc_core::SC_ZERO_TIME;

tlm::tlm_generic_payload trans;
trans.set_command(tlm::TLM_WRITE_COMMAND);
trans.set_address(t_add);
trans.set_data_ptr((unsigned char*)&test);
trans.set_data_length(1);

socket->b_transport(trans, delay);

I didn't receive the 'X' at the target?

Do I miss something at the initiator?

Share this post


Link to post
Share on other sites

Well, I don't know how your infrastructure looks like, but in general your setup is ok. What is missing is to set the streaming width which should be one in your case.

So a bit more context would be allow to help you better. Context means:

  • how are the sockets connected (is there a direct connection initiator->target or do you use some bus system)
  • how do you read the value out of the payload?

Best regards

Share this post


Link to post
Share on other sites

Thanks Eyck

I set the streaming width to 1; Still the same issue

The initiator is connected to a bus.

I expect this data to be directed to a memory connected on the same bus. When I read this memory I find a garbage value.

Could you please give me a hint how can I debug that the bus routed the data correctly?

If I have "m" targets and "n" initiators connected to a bus:

1. Are their arrangement mandatory? or they are connected using names?

2. Do I need to arrange this connection according to the addresses I assign to them?

3. If I have a bus with 8 ports and I would like to connect only 6 is there a way to terminate the left 2?

Regards,

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×