quic/qbox
Loading...
Searching...
No Matches
qkmulti-quantum.h
1/*
2 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All Rights Reserved.
3 * Author: GreenSocs 2022
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8#ifndef QKMULTI_MULTI_QUANTUM_H
9#define QKMULTI_MULTI_QUANTUM_H
10
11#include <qkmultithread.h>
12
13namespace gs {
15{
16 // Only allow up to one quantum from the current sc_time
17 // In accordance with TLM-2
18 virtual sc_core::sc_time time_to_sync() override
19 {
20 sc_core::sc_time quantum = tlm_utils::tlm_quantumkeeper::get_global_quantum();
21 sc_core::sc_time next_quantum_boundary = sc_core::sc_time_stamp() + quantum;
22 sc_core::sc_time now = get_current_time();
25 } else {
26 return sc_core::SC_ZERO_TIME;
27 }
28 }
29
30 // Don't sync until we are on the quantum boundry (as expected by TLM-2)
31 virtual bool need_sync() override { return time_to_sync() == sc_core::SC_ZERO_TIME; }
32};
33} // namespace gs
34#endif
Definition target.h:160
Definition qkmulti-quantum.h:15
Definition qkmultithread.h:24
Tool which reads a Lua configuration file and sets parameters.
Definition biflow.cc:10