SystemC 3.0.0
Accellera SystemC proof-of-concept library
sc_fxcast_switch.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/*****************************************************************************
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 SC_FXCAST_SWITCH_H
51#define SC_FXCAST_SWITCH_H
52
53
55
56
57namespace sc_dt
58{
59
60// classes defined in this module
61class sc_fxcast_switch;
62
63
64// ----------------------------------------------------------------------------
65// CLASS : sc_fxcast_switch
66//
67// Fixed-point cast switch class.
68// ----------------------------------------------------------------------------
69
71{
72
73public:
74
79
80 sc_fxcast_switch& operator = ( const sc_fxcast_switch& );
81
82 friend bool operator == ( const sc_fxcast_switch&,
83 const sc_fxcast_switch& );
84 friend bool operator != ( const sc_fxcast_switch&,
85 const sc_fxcast_switch& );
86
87 std::string to_string() const;
88
89 void print( ::std::ostream& = ::std::cout ) const;
90 void dump( ::std::ostream& = ::std::cout ) const;
91
92private:
93
94 sc_switch m_sw;
95
96};
97
98} // namespace sc_dt
99
100// ----------------------------------------------------------------------------
101// TYPEDEF : sc_fxcast_context
102//
103// Context type for the fixed-point cast switch parameter.
104// ----------------------------------------------------------------------------
105
106// extern template instantiations
107namespace sc_core {
108SC_API_TEMPLATE_DECL_ sc_phash<void*, const sc_dt::sc_fxcast_switch*>;
109} // namespace sc_core
110
111namespace sc_dt {
112
116
117
118// IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
119
120inline
122: m_sw()
123{
125}
126
127inline
129: m_sw( sw_ )
130{}
131
132inline
134: m_sw( a.m_sw )
135{}
136
137inline
140{}
141
142
143inline
146{
147 if( &a != this )
148 {
149 m_sw = a.m_sw;
150 }
151 return *this;
152}
153
154
155inline
156bool
158{
159 return ( a.m_sw == b.m_sw );
160}
161
162
163inline
164bool
166{
167 return ( a.m_sw != b.m_sw );
168}
169
170
171inline
172::std::ostream&
173operator << ( ::std::ostream& os, const sc_fxcast_switch& a )
174{
175 a.print( os );
176 return os;
177}
178
179} // namespace sc_dt
180
181
182#endif
183
184// Taf!
#define SC_API_TEMPLATE_DECL_
Definition: sc_cmnhdr.h:157
#define SC_API
Definition: sc_cmnhdr.h:148
sc_context< sc_fxcast_switch > sc_fxcast_context
const sc_switch SC_DEFAULT_CAST_SWITCH_
Definition: sc_fxdefs.h:215
template class SC_API sc_context< sc_fxcast_switch >
bool operator==(const sc_bit &a, const sc_bit &b)
Definition: sc_bit.h:285
template class SC_API sc_global< sc_fxcast_switch >
sc_switch
Definition: sc_fxdefs.h:149
bool operator!=(const sc_bit &a, const sc_bit &b)
Definition: sc_bit.h:288
inline::std::ostream & operator<<(::std::ostream &os, const sc_bit &a)
Definition: sc_bit.h:388
uint64 const sc_uint_base int b
Definition: sc_fxval.h:955
static const T & default_value()
Definition: sc_context.h:300
sc_fxcast_switch & operator=(const sc_fxcast_switch &)
void print(::std::ostream &=::std::cout) const
void dump(::std::ostream &=::std::cout) const
std::string to_string() const