gem5  v20.1.0.0
sc_fxcast_switch.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 /*****************************************************************************
21 
22  sc_fxcast_switch.h -
23 
24  Original Author: Martin Janssen, Synopsys, Inc.
25 
26  *****************************************************************************/
27 
28 /*****************************************************************************
29 
30  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
31  changes you are making here.
32 
33  Name, Affiliation, Date:
34  Description of Modification:
35 
36  *****************************************************************************/
37 
38 // $Log: sc_fxcast_switch.h,v $
39 // Revision 1.2 2011/08/24 22:05:43 acg
40 // Torsten Maehne: initialization changes to remove warnings.
41 //
42 // Revision 1.1.1.1 2006/12/15 20:20:04 acg
43 // SystemC 2.3
44 //
45 // Revision 1.3 2006/01/13 18:53:57 acg
46 // Andy Goodrich: added $Log command so that CVS comments are reproduced in
47 // the source.
48 //
49 
50 #ifndef __SYSTEMC_EXT_DT_FX_SC_FXCAST_SWITCH_HH__
51 #define __SYSTEMC_EXT_DT_FX_SC_FXCAST_SWITCH_HH__
52 
53 #include <iostream>
54 
55 #include "sc_context.hh"
56 #include "sc_fxdefs.hh"
57 
58 namespace sc_dt
59 {
60 
61 // classes defined in this module
62 class sc_fxcast_switch;
63 
64 
65 // ----------------------------------------------------------------------------
66 // CLASS : sc_fxcast_switch
67 //
68 // Fixed-point cast switch class.
69 // ----------------------------------------------------------------------------
70 
71 class sc_fxcast_switch
72 {
73  public:
77  explicit sc_fxcast_switch(sc_without_context);
78 
80 
81  friend bool operator == (const sc_fxcast_switch &,
82  const sc_fxcast_switch &);
83  friend bool operator != (const sc_fxcast_switch &,
84  const sc_fxcast_switch &);
85 
86  const std::string to_string() const;
87 
88  void print(::std::ostream & =::std::cout) const;
89  void dump(::std::ostream & =::std::cout) const;
90 
91  private:
93 };
94 
95 } // namespace sc_dt
96 
97 // ----------------------------------------------------------------------------
98 // TYPEDEF : sc_fxcast_context
99 //
100 // Context type for the fixed-point cast switch parameter.
101 // ----------------------------------------------------------------------------
102 
103 namespace sc_dt
104 {
105 
106 extern template class sc_global<sc_fxcast_switch>;
107 extern template class sc_context<sc_fxcast_switch>;
108 
110 
111 
112 // IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
113 
115 {
117 }
118 
119 inline sc_fxcast_switch::sc_fxcast_switch(sc_switch sw_) : m_sw( sw_ ) {}
120 
122  m_sw(a.m_sw)
123 {}
124 
127 {}
128 
129 inline sc_fxcast_switch &
131 {
132  if (&a != this) {
133  m_sw = a.m_sw;
134  }
135  return *this;
136 }
137 
138 inline bool
140 {
141  return (a.m_sw == b.m_sw);
142 }
143 
144 inline bool
146 {
147  return (a.m_sw != b.m_sw);
148 }
149 
150 inline ::std::ostream &
151 operator << (::std::ostream &os, const sc_fxcast_switch &a)
152 {
153  a.print(os);
154  return os;
155 }
156 
157 } // namespace sc_dt
158 
159 #endif // __SYSTEMC_EXT_DT_FX_SC_FXCAST_SWITCH_HH__
X86ISA::os
Bitfield< 17 > os
Definition: misc.hh:803
sc_dt::sc_fxcast_switch::operator==
friend bool operator==(const sc_fxcast_switch &, const sc_fxcast_switch &)
Definition: sc_fxcast_switch.hh:139
sc_dt::sc_fxcast_switch::m_sw
sc_switch m_sw
Definition: sc_fxcast_switch.hh:123
sc_dt
Definition: sc_bit.cc:67
sc_dt::operator<<
sc_signed operator<<(const sc_signed &u, const sc_int_base &v)
Definition: sc_signed.cc:853
sc_dt::sc_fxcast_switch::operator!=
friend bool operator!=(const sc_fxcast_switch &, const sc_fxcast_switch &)
Definition: sc_fxcast_switch.hh:145
sc_dt::sc_global
Definition: sc_context.hh:104
sc_dt::sc_without_context
Definition: sc_context.hh:115
sc_dt::operator==
bool operator==(const sc_signed &u, const sc_int_base &v)
Definition: sc_signed.cc:879
sc_dt::sc_fxcast_switch::to_string
const std::string to_string() const
Definition: sc_fxcast_switch.cc:100
sc_fxdefs.hh
ArmISA::a
Bitfield< 8 > a
Definition: miscregs_types.hh:62
sc_dt::operator!=
bool operator!=(const sc_signed &u, const sc_int_base &v)
Definition: sc_signed.cc:892
sc_dt::sc_fxcast_switch
Definition: sc_fxcast_switch.hh:102
sc_dt::sc_fxcast_switch::sc_fxcast_switch
sc_fxcast_switch()
Definition: sc_fxcast_switch.hh:114
sc_dt::sc_fxcast_switch::dump
void dump(::std::ostream &=::std::cout) const
Definition: sc_fxcast_switch.cc:112
ArmISA::b
Bitfield< 7 > b
Definition: miscregs_types.hh:376
sc_dt::sc_switch
sc_switch
Definition: sc_fxdefs.hh:143
sc_dt::sc_context::default_value
static const T & default_value()
Definition: sc_context.hh:299
sc_dt::sc_fxcast_switch::operator=
sc_fxcast_switch & operator=(const sc_fxcast_switch &)
Definition: sc_fxcast_switch.hh:130
sc_context.hh
sc_dt::sc_fxcast_switch::print
void print(::std::ostream &=::std::cout) const
Definition: sc_fxcast_switch.cc:106
sc_dt::SC_DEFAULT_CAST_SWITCH_
const sc_switch SC_DEFAULT_CAST_SWITCH_
Definition: sc_fxdefs.hh:201
sc_dt::sc_context
Definition: sc_context.hh:106
sc_dt::sc_fxcast_context
sc_context< sc_fxcast_switch > sc_fxcast_context
Definition: sc_fxcast_switch.hh:109

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