-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: add method triggered() to class sc_event_queue #91
Comments
Thanks for submitting this. Could you please share a use case including source code to illustrate the need? The Language WG will explore further what could be done. |
@lmailletcontoz Sure, thanks for getting back. This request is a step to make the event interface consistent across sc_event and sc_event_queue. Given this might get considered by the Language WG, first it is worth exploring this question: is there value in making the event interface (i.e the interface of sc_event and sc_event_queue) consistent? Because if it isn't, then there is no value in exploring this further. From model development perspective, the event interface has two sides: one facing producer of events and consumer of events (and maybe a 3rd for canceling...). The two types that support the event interface are sc_event and sc_event_queue (not sure if there is a 3rd one yet or in the making). While sc_event and sc_event_queue are implemented in a different manner, the way they are used in the models for producing/consuming events is similar. While their interface is similar on producer side, it is dissimilar on consumer and canceler side. From modeling perspective, the difference is artificial and just adds to the tedium.
While I don't know why that interface design choice was made, one can infer what could have gone in the mind of the developers. From modeling perspective sc_event_queue and sc_event are both types of some abstract event facility: one collapses events in time, the other doesn't. From OOP software implementation perspective, sc_event_queue was not seen as a type of sc_event (for the underlying queueing feature). It appears that the interface design decision got based on implementation detail, and it has remained that way. Not sure if the performance penalty of virtual inheritance is the reason they made the choice of not implementing an interface. There is that implementation (performance) detail to explore too if they decide to make the interface consistent, whether to inherit from an abstract base class or not. Afaik, there isn't a downside of maintaining a consistent interface while not using virtual inheritance there. Though I am not sure if I am missing something. If you think the Language WG would want to explore this issue further, it would make sense to change the title of the issue to something like: "Enhancement: make the event interface design consistent". |
Thanks for your contribution. The LWG might consider this for a future standard, as this causes an API change. |
Just like class sc_event has the method triggered(), it would be worth adding triggered() to class sc_event_queue. That would make it possible to write a process body where sensitivity list has both sc_event and sc_event_queue, and a user wishes to find which one triggered. Thanks!
The text was updated successfully, but these errors were encountered: