Jump to content

TLM extensions


Recommended Posts

Hi Guys

 

Is there a way to know in target side how many extensions are being set of generic payload .

In my initiator, I am calling trans->set_extension() several times with different extensions.

On target side I need to check how many extensions initiator set and accordingly take few of them and ignore others.

 

In addition to this, in target side do I need to know the extension objects used by initiator ?

 

Thanks

 

Link to comment
Share on other sites

For each type (extension class), there can only be one attached object on the extensions. So I suspect you are confused about how extensions work in general. If you want to "count" attached extension objects, then you might be needed a base extension to contain your counted objects. If you are adding extensions based on the instance, then you may consider using the utility class for instance-specific extensions. There is a good presentation for this on the Doulos website under http://www.doulos.com/knowhow/systemc/tlm2/ (examples using bus locking/snooping).

Link to comment
Share on other sites

I agree with David.

 

Having said that, you can simply attempt to retrieve the type of extension you expect. If it's there, you'll get a non-null pointer, if it's not there you'll get a null pointer.

 

Regarding your second question, an extension can be ignorable or mandatory. If it's ignorable, then the target doesn't need to know if the initiator set it. If it's mandatory, then it must exist at the target.

 

regards

Alan

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.

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