rahuljn Posted July 28, 2014 Report Share Posted July 28, 2014 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 Quote Link to comment Share on other sites More sharing options...
David Black Posted July 28, 2014 Report Share Posted July 28, 2014 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). Quote Link to comment Share on other sites More sharing options...
apfitch Posted July 28, 2014 Report Share Posted July 28, 2014 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.