|
scc 2026.07
SystemC components library
|
the global time keeper, a singleton More...
#include <global_time_keeper.h>

Public Member Functions | |
| uint64_t | get_client_min_time_ticks () |
| Get the minimum time ticks of all client threads (not SystemC). | |
| uint64_t | get_client_max_time_ticks (size_t idx) |
| Get the maximum time ticks a client thread is allowed to advance. | |
| void | update_client_time_ticks (size_t idx, uint64_t tick) |
| updates the global time keeper with the local time ticks of a clinet thread | |
| void | schedule_task (size_t idx, std::packaged_task< sc_core::sc_time(void)> &&task, uint64_t when) |
| updates the global time keeper with the local time ticks of a clinet thread and schedules a task at this new time point | |
| uint64_t | get_sc_time_ticks () |
| Get the maximum sc time ticks a client thread is allowed to advance. | |
| void | update_sc_time_ticks (uint64_t tick) |
| updates the global time keeper with the local time ticks of the SystemC thread | |
Static Public Member Functions | |
| static global_time_keeper & | get () |
| the singleton getter | |
Public Attributes | |
| const sc_core::sc_time | sc_time_step = 1_ms |
| the maximum timestep the simulator is allowed to do if there are no future events | |
Protected Member Functions | |
| global_time_keeper (global_time_keeper const &)=delete | |
| global_time_keeper (global_time_keeper &&)=delete | |
| void | start () |
| size_t | get_channel_index () |
| void | sync_local_times () |
Protected Attributes | |
| std::atomic< bool > | stop_it {false} |
| std::atomic< bool > | update_it {false} |
| std::atomic_uint64_t | client_min_time |
| std::atomic_uint64_t | client_max_time |
| std::atomic_uint64_t | sc_kernel_time |
| std::mutex | upd_mtx |
| std::condition_variable | update |
| thread_comms_channel | sc_coms_channel {-1ULL} |
| std::deque< thread_comms_channel > | client_coms_channels |
| rigtorp::SPSCQueue< std::tuple< size_t, uint64_t, callback_task > > | pending_tasks {1024} |
| bool | started = false |
Friends | |
| class | sc_time_syncronizer |
the global time keeper, a singleton
The global time keeper receives actual time stamps of all client threads and calculates the max time they are alloed to advance beyond systemc. All calculations are done based on ticks which is the minimal time step a simulator can do. The SystemC thread is special in that it is time wise always the last/slowest thread.
Definition at line 22 of file global_time_keeper.h.
|
protected |
Definition at line 13 of file global_time_keeper.cpp.
|
inlinestatic |
|
protected |
Definition at line 25 of file global_time_keeper.cpp.
|
inline |
Get the maximum time ticks a client thread is allowed to advance.
| idx | the id of the client thread, to be obtained using get_channel_index() |
Definition at line 50 of file global_time_keeper.h.
|
inline |
Get the minimum time ticks of all client threads (not SystemC).
Definition at line 43 of file global_time_keeper.h.
|
inline |
Get the maximum sc time ticks a client thread is allowed to advance.
Definition at line 81 of file global_time_keeper.h.
|
inline |
updates the global time keeper with the local time ticks of a clinet thread and schedules a task at this new time point
| idx | the id of the client thread, to be obtained using get_channel_index() |
| tick | the absolute number of actual ticks |
| task | the task to be executed in the SystemC kernel. It shall return the time it used for execution |
Definition at line 70 of file global_time_keeper.h.
|
protected |
Definition at line 19 of file global_time_keeper.cpp.
|
protected |
Definition at line 34 of file global_time_keeper.cpp.
|
inline |
updates the global time keeper with the local time ticks of a clinet thread
| idx | the id of the client thread, to be obtained using get_channel_index() |
| tick | the absolute number of actual ticks |
Definition at line 57 of file global_time_keeper.h.
|
inline |
updates the global time keeper with the local time ticks of the SystemC thread
| tick | the absolute number of actual SystemC ticks |
Definition at line 87 of file global_time_keeper.h.
|
friend |
Definition at line 23 of file global_time_keeper.h.
|
protected |
Definition at line 117 of file global_time_keeper.h.
|
protected |
Definition at line 112 of file global_time_keeper.h.
|
protected |
Definition at line 111 of file global_time_keeper.h.
|
protected |
Definition at line 118 of file global_time_keeper.h.
|
protected |
Definition at line 116 of file global_time_keeper.h.
|
protected |
Definition at line 113 of file global_time_keeper.h.
| const sc_core::sc_time tlm::scc::qk::global_time_keeper::sc_time_step = 1_ms |
the maximum timestep the simulator is allowed to do if there are no future events
Definition at line 28 of file global_time_keeper.h.
|
protected |
Definition at line 119 of file global_time_keeper.h.
|
protected |
Definition at line 109 of file global_time_keeper.h.
|
protected |
Definition at line 114 of file global_time_keeper.h.
|
protected |
Definition at line 115 of file global_time_keeper.h.
|
protected |
Definition at line 110 of file global_time_keeper.h.