SystemC  2.3.2
Accellera SystemC proof-of-concept library
sc_biguint.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_biguint.h -- Template version of sc_unsigned. This class
23 */
33 /*****************************************************************************
34 
35  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
36  changes you are making here.
37 
38  Name, Affiliation, Date: Gene Bushayev, Synopsys, Inc.
39  Description of Modification: - Interface between sc_bigint and sc_bv/sc_lv.
40 
41  Name, Affiliation, Date:
42  Description of Modification:
43 
44  *****************************************************************************/
45 
46 // $Log: sc_biguint.h,v $
47 // Revision 1.2 2011/02/18 20:19:14 acg
48 // Andy Goodrich: updating Copyright notice.
49 //
50 // Revision 1.1.1.1 2006/12/15 20:20:05 acg
51 // SystemC 2.3
52 //
53 // Revision 1.3 2006/01/13 18:49:31 acg
54 // Added $Log command so that CVS check in comments are reproduced in the
55 // source.
56 //
57 
58 #ifndef SC_BIGUINT_H
59 #define SC_BIGUINT_H
60 
61 
64 
65 namespace sc_dt
66 {
67 
68 // classes defined in this module
69 template <int W> class sc_biguint;
70 
71 // forward class declarations
72 class sc_bv_base;
73 class sc_lv_base;
74 class sc_fxval;
75 class sc_fxval_fast;
76 class sc_fxnum;
77 class sc_fxnum_fast;
78 
79 
86 #ifdef SC_MAX_NBITS
87 template< int W = SC_MAX_NBITS >
88 #else
89 template< int W >
90 #endif
91 class sc_biguint
92  : public sc_unsigned
93 {
94 public:
95 
96  // constructors
97 
99  : sc_unsigned( W )
100  {}
101 
103  : sc_unsigned( W )
104  { *this = v; }
105 
107  : sc_unsigned( W )
108  { *this = v; }
109 
111  : sc_unsigned( W )
112  { *this = v; }
113 
114  template< class T >
116  : sc_unsigned( W )
117  { a->to_sc_unsigned(*this); }
118 
119  sc_biguint( const sc_signed& v )
120  : sc_unsigned( W )
121  { *this = v; }
122 
124  : sc_unsigned( W )
125  { *this = v; }
126 
127  sc_biguint( const char* v )
128  : sc_unsigned( W )
129  { *this = v; }
130 
132  : sc_unsigned( W )
133  { *this = v; }
134 
136  : sc_unsigned( W )
137  { *this = v; }
138 
139  sc_biguint( long v )
140  : sc_unsigned( W )
141  { *this = v; }
142 
143  sc_biguint( unsigned long v )
144  : sc_unsigned( W )
145  { *this = v; }
146 
147  sc_biguint( int v )
148  : sc_unsigned( W )
149  { *this = v; }
150 
151  sc_biguint( unsigned int v )
152  : sc_unsigned( W )
153  { *this = v; }
154 
155  sc_biguint( double v )
156  : sc_unsigned( W )
157  { *this = v; }
158 
159  sc_biguint( const sc_bv_base& v )
160  : sc_unsigned( W )
161  { *this = v; }
162 
163  sc_biguint( const sc_lv_base& v )
164  : sc_unsigned( W )
165  { *this = v; }
166 
167 #ifdef SC_INCLUDE_FX
168 
169  explicit sc_biguint( const sc_fxval& v )
170  : sc_unsigned( W )
171  { *this = v; }
172 
173  explicit sc_biguint( const sc_fxval_fast& v )
174  : sc_unsigned( W )
175  { *this = v; }
176 
177  explicit sc_biguint( const sc_fxnum& v )
178  : sc_unsigned( W )
179  { *this = v; }
180 
181  explicit sc_biguint( const sc_fxnum_fast& v )
182  : sc_unsigned( W )
183  { *this = v; }
184 
185 #endif
186 
187 
188 #ifndef SC_MAX_NBITS
189 
190  // destructor
191 
193  {}
194 
195 #endif
196 
197 
198  // assignment operators
199 
201  { sc_unsigned::operator = ( v ); return *this; }
202 
204  { sc_unsigned::operator = ( v ); return *this; }
205 
207  { sc_unsigned::operator = ( v ); return *this; }
208 
209  template< class T >
211  { a->to_sc_unsigned(*this); return *this; }
212 
214  { sc_unsigned::operator = ( v ); return *this; }
215 
217  { sc_unsigned::operator = ( v ); return *this; }
218 
219  sc_biguint<W>& operator = ( const char* v )
220  { sc_unsigned::operator = ( v ); return *this; }
221 
223  { sc_unsigned::operator = ( v ); return *this; }
224 
226  { sc_unsigned::operator = ( v ); return *this; }
227 
229  { sc_unsigned::operator = ( v ); return *this; }
230 
231  sc_biguint<W>& operator = ( unsigned long v )
232  { sc_unsigned::operator = ( v ); return *this; }
233 
235  { sc_unsigned::operator = ( v ); return *this; }
236 
237  sc_biguint<W>& operator = ( unsigned int v )
238  { sc_unsigned::operator = ( v ); return *this; }
239 
241  { sc_unsigned::operator = ( v ); return *this; }
242 
243 
245  { sc_unsigned::operator = ( v ); return *this; }
246 
248  { sc_unsigned::operator = ( v ); return *this; }
249 
251  { sc_unsigned::operator = ( v ); return *this; }
252 
254  { sc_unsigned::operator = ( v ); return *this; }
255 
256 #ifdef SC_INCLUDE_FX
257 
258  sc_biguint<W>& operator = ( const sc_fxval& v )
259  { sc_unsigned::operator = ( v ); return *this; }
260 
262  { sc_unsigned::operator = ( v ); return *this; }
263 
264  sc_biguint<W>& operator = ( const sc_fxnum& v )
265  { sc_unsigned::operator = ( v ); return *this; }
266 
268  { sc_unsigned::operator = ( v ); return *this; }
269 
270 #endif
271 };
272 
273 } // namespace sc_dt
274 
275 
276 #endif
Base class for the fixed-point types; limited precision.
Definition: sc_fxnum.h:991
sc_biguint(const sc_biguint< W > &v)
Definition: sc_biguint.h:102
Fixed-point value types; limited precision.
Definition: sc_fxval.h:439
Arbitrary precision signed arithmetic.
int64_t int64
Definition: sc_nbdefs.h:188
Arbitrary size unsigned integer type.
Definition: sc_biguint.h:77
Base class for sc_uint.
Definition: sc_uint_base.h:534
sc_biguint(unsigned int v)
Definition: sc_biguint.h:151
Arbitrary precision signed number.
Definition: sc_signed.h:1099
sc_biguint< W > & operator=(const sc_biguint< W > &v)
Definition: sc_biguint.h:200
sc_biguint(const sc_signed &v)
Definition: sc_biguint.h:119
uint64_t uint64
Definition: sc_nbdefs.h:189
Arbitrary precision unsigned number.
Definition: sc_unsigned.h:1001
sc_biguint(uint64 v)
Definition: sc_biguint.h:135
Base class for the fixed-point types; arbitrary precision.
Definition: sc_fxnum.h:564
sc_biguint(const sc_unsigned_subref &v)
Definition: sc_biguint.h:110
Base class for sc_int.
Definition: sc_int_base.h:548
Fixed-point value type; arbitrary precision.
Definition: sc_fxval.h:95
Arbitrary size logic vector base class.
Definition: sc_lv_base.h:91
Proxy class for sc_unsigned part selection (r-value and l-value).
Definition: sc_unsigned.h:925
Arbitrary precision unsigned arithmetic.
sc_biguint(const sc_unsigned &v)
Definition: sc_biguint.h:106
Proxy class for sc_signed part selection (r-value and l-value).
Definition: sc_signed.h:1018
sc_unsigned(int nb=sc_length_param().len())
sc_biguint(const sc_generic_base< T > &a)
Definition: sc_biguint.h:115
Proxy class for user-defined value classes and other classes that.
sc_biguint(const char *v)
Definition: sc_biguint.h:127
sc_biguint(long v)
Definition: sc_biguint.h:139
sc_biguint(unsigned long v)
Definition: sc_biguint.h:143
sc_biguint(const sc_lv_base &v)
Definition: sc_biguint.h:163
sc_biguint(double v)
Definition: sc_biguint.h:155
sc_biguint(const sc_signed_subref &v)
Definition: sc_biguint.h:123
Arbitrary size bit vector base class.
Definition: sc_bv_base.h:80
sc_biguint(int64 v)
Definition: sc_biguint.h:131
const sc_unsigned & operator=(const sc_unsigned &v)
sc_biguint(const sc_bv_base &v)
Definition: sc_biguint.h:159