gem5  v20.1.0.0
global_quantum.hh
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 __SYSTEMC_EXT_TLM_CORE_2_QUANTUM_GLOBAL_QUANTUM_HH__
21 #define __SYSTEMC_EXT_TLM_CORE_2_QUANTUM_GLOBAL_QUANTUM_HH__
22 
23 #include "../../../core/sc_time.hh"
24 
25 namespace tlm
26 {
27 
28 //
29 // tlm_global_quantum class
30 //
31 // The global quantum is the maximum time an initiator can run ahead of
32 // SystemC time. All initiators should synchronize on timingpoints that
33 // are multiples of the global quantum value.
34 //
35 // sc_set_time_resolution can only be called before the first
36 // sc_time object is created. This means that after setting the
37 // global quantum it will not be possible to call sc_set_time_resolution.
38 // If sc_set_time_resolution must be called this must be done before
39 // the global quantum is set.
40 //
41 
42 class tlm_global_quantum
43 {
44  public:
45  //
46  // Returns a reference to the tlm_global_quantum singleton
47  //
48  static tlm_global_quantum &instance();
49 
50  public:
51 
52  //
53  // Setter/getter for the global quantum
54  //
55  void set(const sc_core::sc_time &t) { m_global_quantum = t; }
56  const sc_core::sc_time &get() const { return m_global_quantum; }
57 
58  //
59  // This function will calculate the maximum value for the next local
60  // quantum for an initiator. All initiators should synchronize on
61  // integer multiples of the global quantum value. The value for the
62  // local quantum of an initiator can be smaller, but should never be
63  // greater than the value returned by this method.
64  //
66 
67  protected:
69 
70  protected:
72 };
73 
74 } // namespace tlm
75 
76 #endif /* __SYSTEMC_EXT_TLM_CORE_2_QUANTUM_GLOBAL_QUANTUM_HH__ */
tlm::tlm_global_quantum::tlm_global_quantum
tlm_global_quantum()
Definition: global_quantum.cc:44
tlm::tlm_global_quantum::get
const sc_core::sc_time & get() const
Definition: global_quantum.hh:90
sc_core::sc_time
Definition: sc_time.hh:49
tlm::tlm_global_quantum::m_global_quantum
sc_core::sc_time m_global_quantum
Definition: global_quantum.hh:105
tlm
Definition: analysis_fifo.hh:27
tlm::tlm_global_quantum::instance
static tlm_global_quantum & instance()
Definition: global_quantum.cc:49
tlm::tlm_global_quantum::set
void set(const sc_core::sc_time &t)
Definition: global_quantum.hh:89
ArmISA::t
Bitfield< 5 > t
Definition: miscregs_types.hh:67
tlm::tlm_global_quantum::compute_local_quantum
sc_core::sc_time compute_local_quantum()
Definition: global_quantum.cc:56

Generated on Wed Sep 30 2020 14:02:16 for gem5 by doxygen 1.8.17