Jump to content

Bus width of socket

Recommended Posts

Hi all, I dont know what is mean using Bus width when declare a socket.


model A has an initiator socket : tlm::tlm_initiator_socket<32,tlm::tlm_base_protocol_types,0> iSocket; //BUSWIDTH = 32

model B has a target socket : tlm::tlm_target_socket<32,tlm::tlm_base_protocol_types,0> tSocket; //BUSWIDTH = 32

iSocket will bind with tSocket.

when I issue a transaction from model A to model B with trans.set_data_length(128); // 128 > BUSWIDTH

I received 128 byte data, 

What is mean BUSWIDTH when I declare a socket?

Link to comment
Share on other sites

Well, as the name says it is the data transfer with of the bus you are using. So in your case sending 128byte of data across bus having 32bits means you model a burst access having 32beats. Having said this you should notice that the bus width determines mainly the timing of a transaction. Unless you use timing for your transaction and rely on it (e.g. for performance modeling) it should not bother you.

Best regrads

Link to comment
Share on other sites

In my case: I bind directly initiator and target 


when target receive transaction, it will copy data to payload

unsigned char data[1024];
for (unsigned int i = 0; i < NUM_MAX; i++) {
    data[i] = i ;
memcpy(trans.get_data_ptr(), &data, length);

with length = 128, 

Initiator read 128 byte from "trans", and I get 0, 1, 2, 3, 4,...127

I think if BUSWIDTH = 32 then I only get 0 ,1 ,2, 3, 0, 0, 0, 0....

It is mean, Initiator can get 128 bytes, in spite of BUSWIDTH= 32,

So, I'm not clarify about BUSWIDTH

Link to comment
Share on other sites

Again, in your case you model a burst read which means in reality data gets transfered in several beats (32 in your case). Since your model does not deal with timing you wont notice that, all you see is that your data gets transfered.

Look, TLM2.0 implements a generic bus protocol. Most of the real-world protocols have a so called burst transfer (e.g. checkout the AMBA specs). So the way to model this in an abstract way is to have a bust with and the amount of bytes being transfered in on bus transaction not in one beat. This way it is also possible to describe byte and half-word transfers.


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