quic/qbox
Loading...
Searching...
No Matches
systemc-components
common
include
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
13
namespace
gs
{
14
class
tlm_quantumkeeper_multi_quantum
:
public
tlm_quantumkeeper_multithread
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();
23
if
(
next_quantum_boundary
>=
now
) {
24
return
next_quantum_boundary
-
now
;
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
QemuTargetSocket
Definition
target.h:160
gs::tlm_quantumkeeper_multi_quantum
Definition
qkmulti-quantum.h:15
gs::tlm_quantumkeeper_multithread
Definition
qkmultithread.h:24
gs
Tool which reads a Lua configuration file and sets parameters.
Definition
biflow.cc:10
Generated by
1.9.8