TLM-2.0
2.0.4
Accellera TLM-2.0 proof-of-concept library
tlm_global_quantum.h
Go to the documentation of this file.
1
/*****************************************************************************
2
3
Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
4
more contributor license agreements. See the NOTICE file distributed
5
with this work for additional information regarding copyright ownership.
6
Accellera licenses this file to you under the Apache License, Version 2.0
7
(the "License"); you may not use this file except in compliance with the
8
License. You may obtain a copy of the License at
9
10
http://www.apache.org/licenses/LICENSE-2.0
11
12
Unless required by applicable law or agreed to in writing, software
13
distributed under the License is distributed on an "AS IS" BASIS,
14
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15
implied. See the License for the specific language governing
16
permissions and limitations under the License.
17
18
*****************************************************************************/
19
20
#ifndef TLM_CORE_TLM2_TLM_GLOBAL_QUANTUM_H_INCLUDED_
21
#define TLM_CORE_TLM2_TLM_GLOBAL_QUANTUM_H_INCLUDED_
22
23
#include "
sysc/kernel/sc_time.h
"
24
25
namespace
tlm
{
26
27
//
28
// tlm_global_quantum class
29
//
30
// The global quantum is the maximum time an initiator can run ahead of
31
// SystemC time. All initiators should synchronize on timingpoints that
32
// are multiples of the global quantum value.
33
//
34
// sc_set_time_resolution can only be called before the first
35
// sc_time object is created. This means that after setting the
36
// global quantum it will not be possible to call sc_set_time_resolution.
37
// If sc_set_time_resolution must be called this must be done before
38
// the global quantum is set.
39
//
40
41
class
SC_API
tlm_global_quantum
42
{
43
public
:
44
//
45
// Returns a reference to the tlm_global_quantum singleton
46
//
47
static
tlm_global_quantum
& instance();
48
49
public
:
50
51
//
52
// Setter/getter for the global quantum
53
//
54
void
set
(
const
sc_core::sc_time
& t)
55
{
56
m_global_quantum = t;
57
}
58
59
const
sc_core::sc_time
&
get
()
const
60
{
61
return
m_global_quantum;
62
}
63
64
//
65
// This function will calculate the maximum value for the next local
66
// quantum for an initiator. All initiators should synchronize on
67
// integer multiples of the global quantum value. The value for the
68
// local quantum of an initiator can be smaller, but should never be
69
// greater than the value returned by this method.
70
//
71
sc_core::sc_time
compute_local_quantum();
72
73
protected
:
74
tlm_global_quantum
();
75
76
protected
:
77
sc_core::sc_time
m_global_quantum
;
78
};
79
80
}
// namespace tlm
81
82
#endif // TLM_CORE_TLM2_TLM_GLOBAL_QUANTUM_H_INCLUDED_
sc_time.h
sc_core::sc_time
tlm
Definition:
tlm_analysis_fifo.h:27
tlm::tlm_global_quantum
Definition:
tlm_global_quantum.h:41
SC_API
#define SC_API
tlm::tlm_global_quantum::m_global_quantum
sc_core::sc_time m_global_quantum
Definition:
tlm_global_quantum.h:77
tlm_core
tlm_2
tlm_quantum
tlm_global_quantum.h
Generated on Sun Oct 28 2018 23:12:14 for TLM-2.0 by
1.8.13