gem5 v24.0.0.0
Loading...
Searching...
No Matches
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
58namespace sc_dt
59{
60
61// classes defined in this module
62class sc_fxcast_switch;
63
64
65// ----------------------------------------------------------------------------
66// CLASS : sc_fxcast_switch
67//
68// Fixed-point cast switch class.
69// ----------------------------------------------------------------------------
70
72{
73 public:
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
103namespace sc_dt
104{
105
106extern template class sc_global<sc_fxcast_switch>;
107extern template class sc_context<sc_fxcast_switch>;
108
110
111
112// IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
113
118
120
122 m_sw(a.m_sw)
123{}
124
128
129inline sc_fxcast_switch &
131{
132 if (&a != this) {
133 m_sw = a.m_sw;
134 }
135 return *this;
136}
137
138inline bool
140{
141 return (a.m_sw == b.m_sw);
142}
143
144inline bool
146{
147 return (a.m_sw != b.m_sw);
148}
149
150inline ::std::ostream &
151operator << (::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__
static const T & default_value()
friend bool operator==(const sc_fxcast_switch &, const sc_fxcast_switch &)
friend bool operator!=(const sc_fxcast_switch &, const sc_fxcast_switch &)
sc_fxcast_switch & operator=(const sc_fxcast_switch &)
const std::string to_string() const
void print(::std::ostream &=::std::cout) const
void dump(::std::ostream &=::std::cout) const
SwitchingFiber b
SwitchingFiber a
sc_context< sc_fxcast_switch > sc_fxcast_context
const sc_switch SC_DEFAULT_CAST_SWITCH_
Definition sc_fxdefs.hh:201
bool operator==(const sc_signed &u, const sc_int_base &v)
Definition sc_signed.cc:879
bool operator!=(const sc_signed &u, const sc_int_base &v)
Definition sc_signed.cc:892
sc_signed operator<<(const sc_signed &u, const sc_int_base &v)
Definition sc_signed.cc:853

Generated on Tue Jun 18 2024 16:24:06 for gem5 by doxygen 1.11.0