Skip to content

Timed event optimization#142

Open
junweiguo33 wants to merge 2 commits intoaccellera-official:mainfrom
junweiguo33:timed_event_optimization
Open

Timed event optimization#142
junweiguo33 wants to merge 2 commits intoaccellera-official:mainfrom
junweiguo33:timed_event_optimization

Conversation

@junweiguo33
Copy link
Copy Markdown

merge timed events that have the same future simulation time inside timed event queue,
decrease heapify operations and saves around 9% to 15% time in my use case where there are lots of timed events with the same time. The time saved may vary due to different production environment.

@junweiguo33
Copy link
Copy Markdown
Author

junweiguo33 commented Jan 19, 2026

TLM case at_1_phase failed because of unmatched run.log, but the result seems ok
image

run_trimmed.log
expected_trimmed.log

Copy link
Copy Markdown
Contributor

@maehne maehne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR modifies the public interface of sc_event by adding member function sc_event::cancel_timed() and member variable sc_event::m_event_with_the_same_stamp of raw pointer type sc_event*. It also modifies the signature of sc_simcontext::add_timed_event() and adds sc_ppq_base::operator[](). These modifications expose implementation details of the SystemC PoC library and change its public interface and therefore risk to break other libraries relying on SystemC.

Did you run at least the regression test suites of SystemC and its companion libraries maintained by the Accellera working groups to check what impact have your changes? If the performance gains are worthwhile without breaking the semantics defined in the SystemC LRM, it should be checked how to implement this optimisation without changing the public interface of the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants