gem5
v24.0.0.0
Loading...
Searching...
No Matches
systemc
ext
dt
fx
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
:
74
sc_fxcast_switch
();
75
sc_fxcast_switch
(
sc_switch
);
76
sc_fxcast_switch
(
const
sc_fxcast_switch
&);
77
explicit
sc_fxcast_switch
(
sc_without_context
);
78
79
sc_fxcast_switch
&
operator =
(
const
sc_fxcast_switch
&);
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
:
92
sc_switch
m_sw
;
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
109
typedef
sc_context<sc_fxcast_switch>
sc_fxcast_context
;
110
111
112
// IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
113
114
inline
sc_fxcast_switch::sc_fxcast_switch
() : m_sw()
115
{
116
*
this
=
sc_fxcast_context::default_value
();
117
}
118
119
inline
sc_fxcast_switch::sc_fxcast_switch
(
sc_switch
sw_) : m_sw( sw_ ) {}
120
121
inline
sc_fxcast_switch::sc_fxcast_switch
(
const
sc_fxcast_switch
&
a
) :
122
m_sw(
a
.m_sw)
123
{}
124
125
inline
sc_fxcast_switch::sc_fxcast_switch
(
sc_without_context
) :
126
m_sw(
SC_DEFAULT_CAST_SWITCH_
)
127
{}
128
129
inline
sc_fxcast_switch
&
130
sc_fxcast_switch::operator =
(
const
sc_fxcast_switch
&
a
)
131
{
132
if
(&
a
!=
this
) {
133
m_sw
=
a
.m_sw;
134
}
135
return
*
this
;
136
}
137
138
inline
bool
139
operator ==
(
const
sc_fxcast_switch
&
a
,
const
sc_fxcast_switch
&
b
)
140
{
141
return
(
a
.m_sw ==
b
.m_sw);
142
}
143
144
inline
bool
145
operator !=
(
const
sc_fxcast_switch
&
a
,
const
sc_fxcast_switch
&
b
)
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__
sc_dt::sc_context
Definition
sc_context.hh:133
sc_dt::sc_context::default_value
static const T & default_value()
Definition
sc_context.hh:268
sc_dt::sc_fxcast_switch
Definition
sc_fxcast_switch.hh:72
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::operator!=
friend bool operator!=(const sc_fxcast_switch &, const sc_fxcast_switch &)
Definition
sc_fxcast_switch.hh:145
sc_dt::sc_fxcast_switch::sc_fxcast_switch
sc_fxcast_switch()
Definition
sc_fxcast_switch.hh:114
sc_dt::sc_fxcast_switch::operator=
sc_fxcast_switch & operator=(const sc_fxcast_switch &)
Definition
sc_fxcast_switch.hh:130
sc_dt::sc_fxcast_switch::to_string
const std::string to_string() const
Definition
sc_fxcast_switch.cc:66
sc_dt::sc_fxcast_switch::print
void print(::std::ostream &=::std::cout) const
Definition
sc_fxcast_switch.cc:72
sc_dt::sc_fxcast_switch::dump
void dump(::std::ostream &=::std::cout) const
Definition
sc_fxcast_switch.cc:78
sc_dt::sc_fxcast_switch::m_sw
sc_switch m_sw
Definition
sc_fxcast_switch.hh:92
sc_dt::sc_without_context
Definition
sc_context.hh:84
b
SwitchingFiber b
a
SwitchingFiber a
sc_dt
Definition
sc_bit.cc:68
sc_dt::sc_fxcast_context
sc_context< sc_fxcast_switch > sc_fxcast_context
Definition
sc_fxcast_switch.hh:109
sc_dt::SC_DEFAULT_CAST_SWITCH_
const sc_switch SC_DEFAULT_CAST_SWITCH_
Definition
sc_fxdefs.hh:201
sc_dt::operator==
bool operator==(const sc_signed &u, const sc_int_base &v)
Definition
sc_signed.cc:879
sc_dt::operator!=
bool operator!=(const sc_signed &u, const sc_int_base &v)
Definition
sc_signed.cc:892
sc_dt::operator<<
sc_signed operator<<(const sc_signed &u, const sc_int_base &v)
Definition
sc_signed.cc:853
sc_dt::sc_switch
sc_switch
Definition
sc_fxdefs.hh:144
sc_context.hh
sc_fxdefs.hh
Generated on Tue Jun 18 2024 16:24:06 for gem5 by
doxygen
1.11.0