Jump to content
Sign in to follow this  
rahuljn

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

 

Share this post


Link to post
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).

Share this post


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

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
Sign in to follow this  

×