gem5  v22.1.0.0
scfx_params.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  scfx_params.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: scfx_params.h,v $
39 // Revision 1.1.1.1 2006/12/15 20:20:04 acg
40 // SystemC 2.3
41 //
42 // Revision 1.3 2006/01/13 18:53:58 acg
43 // Andy Goodrich: added $Log command so that CVS comments are reproduced in
44 // the source.
45 //
46 
47 #ifndef __SYSTEMC_EXT_DT_FX_SCFX_PARAMS_HH__
48 #define __SYSTEMC_EXT_DT_FX_SCFX_PARAMS_HH__
49 
50 #include "messages.hh"
51 #include "sc_fxcast_switch.hh"
52 #include "sc_fxtype_params.hh"
53 
54 namespace sc_dt
55 {
56 
57 // classes defined in this module
58 class scfx_params;
59 
60 
61 // ----------------------------------------------------------------------------
62 // CLASS : scfx_params
63 //
64 // ...
65 // ----------------------------------------------------------------------------
66 
68 {
69  public:
70  // constructor
72 
73  // query functions
74  const sc_fxtype_params &type_params() const;
75  sc_enc enc() const;
76  const sc_fxcast_switch &cast_switch() const;
77 
78  // shortcuts
79  int wl() const;
80  int iwl() const;
81  int fwl() const;
82  sc_q_mode q_mode() const;
83  sc_o_mode o_mode() const;
84  int n_bits() const;
85 
86  // dump content
87  void dump(::std::ostream &) const;
88 
89  private:
93 };
94 
95 
96 // IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
97 
98 // constructor
99 inline scfx_params::scfx_params(const sc_fxtype_params &type_params_,
100  sc_enc enc_,
101  const sc_fxcast_switch &cast_sw) :
102  m_type_params(type_params_), m_enc(enc_), m_cast_switch(cast_sw)
103 {
104  if (m_enc == SC_US_ && m_type_params.o_mode() == SC_WRAP_SM) {
107  // may continue, if suppressed
108  }
109 }
110 
111 // query functions
112 inline const sc_fxtype_params &
114 {
115  return m_type_params;
116 }
117 
118 inline sc_enc
120 {
121  return m_enc;
122 }
123 
124 inline const sc_fxcast_switch &
126 {
127  return m_cast_switch;
128 }
129 
130 // shortcuts
131 inline int
133 {
134  return m_type_params.wl();
135 }
136 
137 inline int
139 {
140  return m_type_params.iwl();
141 }
142 
143 inline int
145 {
146  return (m_type_params.wl() - m_type_params.iwl());
147 }
148 
149 inline sc_q_mode
151 {
152  return m_type_params.q_mode();
153 }
154 
155 inline sc_o_mode
157 {
158  return m_type_params.o_mode();
159 }
160 
161 inline int
163 {
164  return m_type_params.n_bits();
165 }
166 
167 // dump content
168 inline void
169 scfx_params::dump(::std::ostream &os) const
170 {
171  os << "scfx_params" << ::std::endl;
172  os << "(" << ::std::endl;
173  os << "type_params = ";
174  m_type_params.dump( os );
175  os << "enc = " << m_enc << ::std::endl;
176  os << "cast_switch = ";
177  m_cast_switch.dump( os );
178  os << ")" << ::std::endl;
179 }
180 
181 } // namespace sc_dt
182 
183 #endif // __SYSTEMC_EXT_DT_FX_SCFX_PARAMS_HH__
void dump(::std::ostream &=::std::cout) const
void dump(::std::ostream &=::std::cout) const
sc_o_mode o_mode() const
sc_q_mode q_mode() const
const sc_fxcast_switch & cast_switch() const
Definition: scfx_params.hh:125
sc_enc enc() const
Definition: scfx_params.hh:119
sc_o_mode o_mode() const
Definition: scfx_params.hh:156
sc_q_mode q_mode() const
Definition: scfx_params.hh:150
sc_fxcast_switch m_cast_switch
Definition: scfx_params.hh:92
void dump(::std::ostream &) const
Definition: scfx_params.hh:169
const sc_fxtype_params & type_params() const
Definition: scfx_params.hh:113
int n_bits() const
Definition: scfx_params.hh:162
sc_fxtype_params m_type_params
Definition: scfx_params.hh:90
scfx_params(const sc_fxtype_params &, sc_enc, const sc_fxcast_switch &)
Definition: scfx_params.hh:99
Bitfield< 17 > os
Definition: misc.hh:810
const char SC_ID_INVALID_O_MODE_[]
Definition: messages.cc:41
const char SC_ID_WRAP_SM_NOT_DEFINED_[]
Definition: messages.cc:45
Definition: sc_bit.cc:68
@ SC_US_
Definition: sc_fxdefs.hh:73
sc_q_mode
Definition: sc_fxdefs.hh:92
@ SC_WRAP_SM
Definition: sc_fxdefs.hh:123
#define SC_REPORT_ERROR(msg_type, msg)

Generated on Wed Dec 21 2022 10:22:41 for gem5 by doxygen 1.9.1