gem5  v22.1.0.0
sc_biguint.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_biguint.h -- Template version of sc_unsigned. This class
23  enables compile-time bit widths for sc_unsigned numbers.
24 
25  Original Author: Ali Dasdan, Synopsys, Inc.
26 
27  *****************************************************************************/
28 
29 /*****************************************************************************
30 
31  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
32  changes you are making here.
33 
34  Name, Affiliation, Date: Gene Bushayev, Synopsys, Inc.
35  Description of Modification: - Interface between sc_bigint and sc_bv/sc_lv.
36 
37  Name, Affiliation, Date:
38  Description of Modification:
39 
40  *****************************************************************************/
41 
42 // $Log: sc_biguint.h,v $
43 // Revision 1.2 2011/02/18 20:19:14 acg
44 // Andy Goodrich: updating Copyright notice.
45 //
46 // Revision 1.1.1.1 2006/12/15 20:20:05 acg
47 // SystemC 2.3
48 //
49 // Revision 1.3 2006/01/13 18:49:31 acg
50 // Added $Log command so that CVS check in comments are reproduced in the
51 // source.
52 //
53 
54 #ifndef __SYSTEMC_EXT_DT_INT_SC_BIGUINT_HH__
55 #define __SYSTEMC_EXT_DT_INT_SC_BIGUINT_HH__
56 
57 #include "sc_signed.hh"
58 #include "sc_unsigned.hh"
59 
60 namespace sc_dt
61 {
62 
63 // classes defined in this module
64 template <int W>
65 class sc_biguint;
66 
67 // forward class declarations
68 class sc_bv_base;
69 class sc_lv_base;
70 class sc_fxval;
71 class sc_fxval_fast;
72 class sc_fxnum;
73 class sc_fxnum_fast;
74 
75 
76 // ----------------------------------------------------------------------------
77 // CLASS TEMPLATE : sc_biguint<W>
78 //
79 // Arbitrary size unsigned integer type.
80 // ----------------------------------------------------------------------------
81 
82 #ifdef SC_MAX_NBITS
83 template<int W=SC_MAX_NBITS>
84 #else
85 template<int W>
86 #endif
87 class sc_biguint : public sc_unsigned
88 {
89  public:
90  // constructors
92  sc_biguint(const sc_biguint<W> &v) : sc_unsigned(W) { *this = v; }
93  sc_biguint(const sc_unsigned &v) : sc_unsigned(W) { *this = v; }
94  sc_biguint(const sc_unsigned_subref &v) : sc_unsigned(W) { *this = v; }
95 
96  template<class T>
98  {
99  a->to_sc_unsigned(*this);
100  }
101 
102  sc_biguint(const sc_signed &v) : sc_unsigned(W) { *this = v; }
103  sc_biguint(const sc_signed_subref &v) : sc_unsigned(W) { *this = v; }
104  sc_biguint(const char* v) : sc_unsigned(W) { *this = v; }
105  sc_biguint(int64 v) : sc_unsigned(W) { *this = v; }
106  sc_biguint(uint64 v) : sc_unsigned(W) { *this = v; }
107  sc_biguint(long v) : sc_unsigned(W) { *this = v; }
108  sc_biguint(unsigned long v) : sc_unsigned(W) { *this = v; }
109  sc_biguint(int v) : sc_unsigned(W) { *this = v; }
110  sc_biguint(unsigned int v) : sc_unsigned(W) { *this = v; }
111  sc_biguint(double v) : sc_unsigned(W) { *this = v; }
112  sc_biguint(const sc_bv_base &v) : sc_unsigned(W) { *this = v; }
113  sc_biguint(const sc_lv_base &v) : sc_unsigned(W) { *this = v; }
114 
115  explicit sc_biguint(const sc_fxval &v) : sc_unsigned(W) { *this = v; }
116  explicit sc_biguint(const sc_fxval_fast &v) : sc_unsigned(W) { *this = v; }
117  explicit sc_biguint(const sc_fxnum &v) : sc_unsigned(W) { *this = v; }
118  explicit sc_biguint(const sc_fxnum_fast &v) : sc_unsigned(W) { *this = v; }
119 
120 #ifndef SC_MAX_NBITS
121  // destructor
123 #endif
124 
125  // assignment operators
126  sc_biguint<W> &
128  {
130  return *this;
131  }
132 
133  sc_biguint<W> &
135  {
137  return *this;
138  }
139 
140  sc_biguint<W> &
142  {
144  return *this;
145  }
146 
147  template< class T >
148  sc_biguint<W> &
150  { a->to_sc_unsigned(*this);
151  return *this;
152  }
153 
154  sc_biguint<W> &
156  {
158  return *this;
159  }
160 
161  sc_biguint<W> &
163  {
165  return *this;
166  }
167 
168  sc_biguint<W> &
169  operator = (const char* v)
170  {
172  return *this;
173  }
174 
175  sc_biguint<W> &
177  {
179  return *this;
180  }
181 
182  sc_biguint<W> &
184  {
186  return *this;
187  }
188 
189  sc_biguint<W> &
191  {
193  return *this;
194  }
195 
196  sc_biguint<W> &
197  operator = (unsigned long v)
198  {
200  return *this;
201  }
202 
203  sc_biguint<W> &
205  {
207  return *this;
208  }
209 
210  sc_biguint<W> &
211  operator = (unsigned int v)
212  {
214  return *this;
215  }
216 
217  sc_biguint<W> &
218  operator = (double v)
219  {
221  return *this;
222  }
223 
224 
225  sc_biguint<W> &
227  {
229  return *this;
230  }
231 
232  sc_biguint<W> &
234  {
236  return *this;
237  }
238 
239  sc_biguint<W> &
241  {
243  return *this;
244  }
245 
246  sc_biguint<W> &
248  {
250  return *this;
251  }
252 
253  sc_biguint<W> &
255  {
257  return *this;
258  }
259 
260  sc_biguint<W> &
262  {
264  return *this;
265  }
266 
267  sc_biguint<W> &
269  {
271  return *this;
272  }
273 
274  sc_biguint<W> &
276  {
278  return *this;
279  }
280 };
281 
282 } // namespace sc_dt
283 
284 #endif // __SYSTEMC_EXT_DT_INT_SC_BIGUINT_HH__
sc_biguint(const sc_generic_base< T > &a)
Definition: sc_biguint.hh:97
sc_biguint(const char *v)
Definition: sc_biguint.hh:104
sc_biguint(const sc_fxnum_fast &v)
Definition: sc_biguint.hh:118
sc_biguint(const sc_signed &v)
Definition: sc_biguint.hh:102
sc_biguint(int64 v)
Definition: sc_biguint.hh:105
sc_biguint(double v)
Definition: sc_biguint.hh:111
sc_biguint(const sc_fxval_fast &v)
Definition: sc_biguint.hh:116
sc_biguint(uint64 v)
Definition: sc_biguint.hh:106
sc_biguint(const sc_unsigned_subref &v)
Definition: sc_biguint.hh:94
sc_biguint(unsigned long v)
Definition: sc_biguint.hh:108
sc_biguint(unsigned int v)
Definition: sc_biguint.hh:110
sc_biguint(const sc_unsigned &v)
Definition: sc_biguint.hh:93
sc_biguint(const sc_lv_base &v)
Definition: sc_biguint.hh:113
sc_biguint(const sc_signed_subref &v)
Definition: sc_biguint.hh:103
sc_biguint(const sc_bv_base &v)
Definition: sc_biguint.hh:112
sc_biguint< W > & operator=(const sc_biguint< W > &v)
Definition: sc_biguint.hh:127
sc_biguint(const sc_biguint< W > &v)
Definition: sc_biguint.hh:92
sc_biguint(const sc_fxval &v)
Definition: sc_biguint.hh:115
sc_biguint(const sc_fxnum &v)
Definition: sc_biguint.hh:117
const sc_unsigned & operator=(const sc_unsigned &v)
#define sc_fxval
Bitfield< 8 > a
Definition: misc_types.hh:66
Bitfield< 0 > v
Definition: pagetable.hh:65
Definition: sc_bit.cc:68
uint64_t uint64
Definition: sc_nbdefs.hh:172
int64_t int64
Definition: sc_nbdefs.hh:171

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