Jump to content

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_data_ptr((unsigned char*)&test);

socket->b_transport(trans, delay);

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

Do I miss something at the initiator?

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

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


Link to comment
Share on other sites

  • 4 weeks later...

Well, without lnowing the implementation it is hard to tell. I suppose your initiator sockets are connected to target sockets at he bus and the initiator sockets of the bus are connected to the target sockets of your target components. All these sockets need to be bound to each other (by calling bind() or the operator() function). There is no concept of bind-by-name in SystemC. Maybe you should have a look here: https://www.doulos.com/knowhow/systemc/tlm2/tutorial__3/

Sockets need to be bound except they are declared with the appropriate binding policy (the 4th template of the sockets). If this is not the case you need to create dummy targets.

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