SystemC  2.3.1
Accellera SystemC proof-of-concept library
sc_ufix.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  The following code is derived, directly or indirectly, from the SystemC
4  source code Copyright (c) 1996-2014 by all Contributors.
5  All Rights reserved.
6 
7  The contents of this file are subject to the restrictions and limitations
8  set forth in the SystemC Open Source License (the "License");
9  You may not use this file except in compliance with such restrictions and
10  limitations. You may obtain instructions on how to receive a copy of the
11  License at http://www.accellera.org/. Software distributed by Contributors
12  under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
13  ANY KIND, either express or implied. See the License for the specific
14  language governing rights and limitations under the License.
15 
16  *****************************************************************************/
17 
18 /*****************************************************************************
19 
20  sc_ufix.h -
21 
22  Original Author: Martin Janssen, Synopsys, Inc.
23 
24  *****************************************************************************/
25 
26 /*****************************************************************************
27 
28  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
29  changes you are making here.
30 
31  Name, Affiliation, Date:
32  Description of Modification:
33 
34  *****************************************************************************/
35 
36 // $Log: sc_ufix.h,v $
37 // Revision 1.2 2011/01/20 22:52:30 acg
38 // Andy Goodrich: Add float constructors.
39 //
40 // Revision 1.1.1.1 2006/12/15 20:20:04 acg
41 // SystemC 2.3
42 //
43 // Revision 1.3 2006/01/13 18:53:58 acg
44 // Andy Goodrich: added $Log command so that CVS comments are reproduced in
45 // the source.
46 //
47 
48 #ifndef SC_UFIX_H
49 #define SC_UFIX_H
50 
51 
53 
54 
55 namespace sc_dt
56 {
57 
58 // classes defined in this module
59 class sc_ufix;
60 class sc_ufix_fast;
61 
62 
63 // ----------------------------------------------------------------------------
64 // CLASS : sc_ufix
65 //
66 // "Unconstrained" unsigned fixed-point class; arbitrary precision.
67 // ----------------------------------------------------------------------------
68 
69 class sc_ufix : public sc_fxnum
70 {
71 
72 public:
73 
74  // constructors
75 
76  explicit sc_ufix( sc_fxnum_observer* = 0 );
77  sc_ufix( int, int,
78  sc_fxnum_observer* = 0 );
80  sc_fxnum_observer* = 0 );
82  sc_fxnum_observer* = 0 );
83  sc_ufix( int, int, sc_q_mode, sc_o_mode,
84  sc_fxnum_observer* = 0 );
85  sc_ufix( int, int, sc_q_mode, sc_o_mode, int,
86  sc_fxnum_observer* = 0 );
87  explicit sc_ufix( const sc_fxcast_switch&,
88  sc_fxnum_observer* = 0 );
89  sc_ufix( int, int,
90  const sc_fxcast_switch&,
91  sc_fxnum_observer* = 0 );
93  const sc_fxcast_switch&,
94  sc_fxnum_observer* = 0 );
96  const sc_fxcast_switch&,
97  sc_fxnum_observer* = 0 );
98  sc_ufix( int, int, sc_q_mode, sc_o_mode,
99  const sc_fxcast_switch&,
100  sc_fxnum_observer* = 0 );
101  sc_ufix( int, int, sc_q_mode, sc_o_mode, int,
102  const sc_fxcast_switch&,
103  sc_fxnum_observer* = 0 );
104  explicit sc_ufix( const sc_fxtype_params&,
105  sc_fxnum_observer* = 0 );
106  sc_ufix( const sc_fxtype_params&,
107  const sc_fxcast_switch&,
108  sc_fxnum_observer* = 0 );
109 
110 #define DECL_CTORS_T(tp) \
111  sc_ufix( tp, \
112  int, int, \
113  sc_fxnum_observer* = 0 ); \
114  sc_ufix( tp, \
115  sc_q_mode, sc_o_mode, \
116  sc_fxnum_observer* = 0 ); \
117  sc_ufix( tp, \
118  sc_q_mode, sc_o_mode, int, \
119  sc_fxnum_observer* = 0 ); \
120  sc_ufix( tp, \
121  int, int, sc_q_mode, sc_o_mode, \
122  sc_fxnum_observer* = 0 ); \
123  sc_ufix( tp, \
124  int, int, sc_q_mode, sc_o_mode, int, \
125  sc_fxnum_observer* = 0 ); \
126  sc_ufix( tp, \
127  const sc_fxcast_switch&, \
128  sc_fxnum_observer* = 0 ); \
129  sc_ufix( tp, \
130  int, int, \
131  const sc_fxcast_switch&, \
132  sc_fxnum_observer* = 0 ); \
133  sc_ufix( tp, \
134  sc_q_mode, sc_o_mode, \
135  const sc_fxcast_switch&, \
136  sc_fxnum_observer* = 0 ); \
137  sc_ufix( tp, \
138  sc_q_mode, sc_o_mode, int, \
139  const sc_fxcast_switch&, \
140  sc_fxnum_observer* = 0 ); \
141  sc_ufix( tp, \
142  int, int, sc_q_mode, sc_o_mode, \
143  const sc_fxcast_switch&, \
144  sc_fxnum_observer* = 0 ); \
145  sc_ufix( tp, \
146  int, int, sc_q_mode, sc_o_mode, int, \
147  const sc_fxcast_switch&, \
148  sc_fxnum_observer* = 0 ); \
149  sc_ufix( tp, \
150  const sc_fxtype_params&, \
151  sc_fxnum_observer* = 0 ); \
152  sc_ufix( tp, \
153  const sc_fxtype_params&, \
154  const sc_fxcast_switch&, \
155  sc_fxnum_observer* = 0 );
156 
157 #define DECL_CTORS_T_A(tp) \
158  sc_ufix( tp, \
159  sc_fxnum_observer* = 0 ); \
160  DECL_CTORS_T(tp)
161 
162 #define DECL_CTORS_T_B(tp) \
163  explicit sc_ufix( tp, \
164  sc_fxnum_observer* = 0 ); \
165  DECL_CTORS_T(tp)
166 
167  DECL_CTORS_T_A(int)
168  DECL_CTORS_T_A(unsigned int)
169  DECL_CTORS_T_A(long)
170  DECL_CTORS_T_A(unsigned long)
171  DECL_CTORS_T_A(float)
172  DECL_CTORS_T_A(double)
173  DECL_CTORS_T_A(const char*)
174  DECL_CTORS_T_A(const sc_fxval&)
176  DECL_CTORS_T_A(const sc_fxnum&)
178 #ifndef SC_FX_EXCLUDE_OTHER
183  DECL_CTORS_T_B(const sc_signed&)
185 #endif
186 
187 #undef DECL_CTORS_T
188 #undef DECL_CTORS_T_A
189 #undef DECL_CTORS_T_B
190 
191  // copy constructor
192 
193  sc_ufix( const sc_ufix& );
194 
195 
196  // unary bitwise operators
197 
198  const sc_ufix operator ~ () const;
199 
200 
201  // unary bitwise functions
202 
203  friend void b_not( sc_ufix&, const sc_ufix& );
204 
205 
206  // binary bitwise operators
207 
208  friend const sc_ufix operator & ( const sc_ufix&, const sc_ufix& );
209  friend const sc_ufix operator & ( const sc_ufix&, const sc_ufix_fast& );
210  friend const sc_ufix operator & ( const sc_ufix_fast&, const sc_ufix& );
211  friend const sc_ufix operator | ( const sc_ufix&, const sc_ufix& );
212  friend const sc_ufix operator | ( const sc_ufix&, const sc_ufix_fast& );
213  friend const sc_ufix operator | ( const sc_ufix_fast&, const sc_ufix& );
214  friend const sc_ufix operator ^ ( const sc_ufix&, const sc_ufix& );
215  friend const sc_ufix operator ^ ( const sc_ufix&, const sc_ufix_fast& );
216  friend const sc_ufix operator ^ ( const sc_ufix_fast&, const sc_ufix& );
217 
218 
219  // binary bitwise functions
220 
221  friend void b_and( sc_ufix&, const sc_ufix&, const sc_ufix& );
222  friend void b_and( sc_ufix&, const sc_ufix&, const sc_ufix_fast& );
223  friend void b_and( sc_ufix&, const sc_ufix_fast&, const sc_ufix& );
224  friend void b_or ( sc_ufix&, const sc_ufix&, const sc_ufix& );
225  friend void b_or ( sc_ufix&, const sc_ufix&, const sc_ufix_fast& );
226  friend void b_or ( sc_ufix&, const sc_ufix_fast&, const sc_ufix& );
227  friend void b_xor( sc_ufix&, const sc_ufix&, const sc_ufix& );
228  friend void b_xor( sc_ufix&, const sc_ufix&, const sc_ufix_fast& );
229  friend void b_xor( sc_ufix&, const sc_ufix_fast&, const sc_ufix& );
230 
231 
232  // assignment operators
233 
234  sc_ufix& operator = ( const sc_ufix& );
235 
236 #define DECL_ASN_OP_T(op,tp) \
237  sc_ufix& operator op ( tp );
238 
239 #ifndef SC_FX_EXCLUDE_OTHER
240 #define DECL_ASN_OP_OTHER(op) \
241  DECL_ASN_OP_T(op,int64) \
242  DECL_ASN_OP_T(op,uint64) \
243  DECL_ASN_OP_T(op,const sc_int_base&) \
244  DECL_ASN_OP_T(op,const sc_uint_base&) \
245  DECL_ASN_OP_T(op,const sc_signed&) \
246  DECL_ASN_OP_T(op,const sc_unsigned&)
247 #else
248 #define DECL_ASN_OP_OTHER(op)
249 #endif
250 
251 #define DECL_ASN_OP(op) \
252  DECL_ASN_OP_T(op,int) \
253  DECL_ASN_OP_T(op,unsigned int) \
254  DECL_ASN_OP_T(op,long) \
255  DECL_ASN_OP_T(op,unsigned long) \
256  DECL_ASN_OP_T(op,float) \
257  DECL_ASN_OP_T(op,double) \
258  DECL_ASN_OP_T(op,const char*) \
259  DECL_ASN_OP_T(op,const sc_fxval&) \
260  DECL_ASN_OP_T(op,const sc_fxval_fast&) \
261  DECL_ASN_OP_T(op,const sc_fxnum&) \
262  DECL_ASN_OP_T(op,const sc_fxnum_fast&) \
263  DECL_ASN_OP_OTHER(op)
264 
265  DECL_ASN_OP(=)
266 
267  DECL_ASN_OP(*=)
268  DECL_ASN_OP(/=)
269  DECL_ASN_OP(+=)
270  DECL_ASN_OP(-=)
271 
272  DECL_ASN_OP_T(<<=,int)
273  DECL_ASN_OP_T(>>=,int)
274 
275  DECL_ASN_OP_T(&=,const sc_ufix&)
276  DECL_ASN_OP_T(&=,const sc_ufix_fast&)
277  DECL_ASN_OP_T(|=,const sc_ufix&)
278  DECL_ASN_OP_T(|=,const sc_ufix_fast&)
279  DECL_ASN_OP_T(^=,const sc_ufix&)
280  DECL_ASN_OP_T(^=,const sc_ufix_fast&)
281 
282 #undef DECL_ASN_OP_T
283 #undef DECL_ASN_OP_OTHER
284 #undef DECL_ASN_OP
285 
286 
287  // auto-increment and auto-decrement
288 
289  const sc_fxval operator ++ ( int );
290  const sc_fxval operator -- ( int );
291 
292  sc_ufix& operator ++ ();
293  sc_ufix& operator -- ();
294 
295 };
296 
297 
298 // ----------------------------------------------------------------------------
299 // CLASS : sc_ufix_fast
300 //
301 // "Unconstrained" unsigned fixed-point class; limited precision.
302 // ----------------------------------------------------------------------------
303 
305 {
306 
307 public:
308 
309  // constructors
310 
311  explicit sc_ufix_fast( sc_fxnum_fast_observer* = 0 );
312  sc_ufix_fast( int, int,
313  sc_fxnum_fast_observer* = 0 );
315  sc_fxnum_fast_observer* = 0 );
317  sc_fxnum_fast_observer* = 0 );
318  sc_ufix_fast( int, int, sc_q_mode, sc_o_mode,
319  sc_fxnum_fast_observer* = 0 );
320  sc_ufix_fast( int, int, sc_q_mode, sc_o_mode, int,
321  sc_fxnum_fast_observer* = 0 );
322  explicit sc_ufix_fast( const sc_fxcast_switch&,
323  sc_fxnum_fast_observer* = 0 );
324  sc_ufix_fast( int, int,
325  const sc_fxcast_switch&,
326  sc_fxnum_fast_observer* = 0 );
328  const sc_fxcast_switch&,
329  sc_fxnum_fast_observer* = 0 );
331  const sc_fxcast_switch&,
332  sc_fxnum_fast_observer* = 0 );
333  sc_ufix_fast( int, int, sc_q_mode, sc_o_mode,
334  const sc_fxcast_switch&,
335  sc_fxnum_fast_observer* = 0 );
336  sc_ufix_fast( int, int, sc_q_mode, sc_o_mode, int,
337  const sc_fxcast_switch&,
338  sc_fxnum_fast_observer* = 0 );
339  explicit sc_ufix_fast( const sc_fxtype_params&,
340  sc_fxnum_fast_observer* = 0 );
342  const sc_fxcast_switch&,
343  sc_fxnum_fast_observer* = 0 );
344 
345 #define DECL_CTORS_T(tp) \
346  sc_ufix_fast( tp, \
347  int, int, \
348  sc_fxnum_fast_observer* = 0 ); \
349  sc_ufix_fast( tp, \
350  sc_q_mode, sc_o_mode, \
351  sc_fxnum_fast_observer* = 0 ); \
352  sc_ufix_fast( tp, \
353  sc_q_mode, sc_o_mode, int, \
354  sc_fxnum_fast_observer* = 0 ); \
355  sc_ufix_fast( tp, \
356  int, int, sc_q_mode, sc_o_mode, \
357  sc_fxnum_fast_observer* = 0 ); \
358  sc_ufix_fast( tp, \
359  int, int, sc_q_mode, sc_o_mode, int, \
360  sc_fxnum_fast_observer* = 0 ); \
361  sc_ufix_fast( tp, \
362  const sc_fxcast_switch&, \
363  sc_fxnum_fast_observer* = 0 ); \
364  sc_ufix_fast( tp, \
365  int, int, \
366  const sc_fxcast_switch&, \
367  sc_fxnum_fast_observer* = 0 ); \
368  sc_ufix_fast( tp, \
369  sc_q_mode, sc_o_mode, \
370  const sc_fxcast_switch&, \
371  sc_fxnum_fast_observer* = 0 ); \
372  sc_ufix_fast( tp, \
373  sc_q_mode, sc_o_mode, int, \
374  const sc_fxcast_switch&, \
375  sc_fxnum_fast_observer* = 0 ); \
376  sc_ufix_fast( tp, \
377  int, int, sc_q_mode, sc_o_mode, \
378  const sc_fxcast_switch&, \
379  sc_fxnum_fast_observer* = 0 ); \
380  sc_ufix_fast( tp, \
381  int, int, sc_q_mode, sc_o_mode, int, \
382  const sc_fxcast_switch&, \
383  sc_fxnum_fast_observer* = 0 ); \
384  sc_ufix_fast( tp, \
385  const sc_fxtype_params&, \
386  sc_fxnum_fast_observer* = 0 ); \
387  sc_ufix_fast( tp, \
388  const sc_fxtype_params&, \
389  const sc_fxcast_switch&, \
390  sc_fxnum_fast_observer* = 0 );
391 
392 #define DECL_CTORS_T_A(tp) \
393  sc_ufix_fast( tp, \
394  sc_fxnum_fast_observer* = 0 ); \
395  DECL_CTORS_T(tp)
396 
397 #define DECL_CTORS_T_B(tp) \
398  explicit sc_ufix_fast( tp, \
399  sc_fxnum_fast_observer* = 0 ); \
400  DECL_CTORS_T(tp)
401 
402  DECL_CTORS_T_A(int)
403  DECL_CTORS_T_A(unsigned int)
404  DECL_CTORS_T_A(long)
405  DECL_CTORS_T_A(unsigned long)
406  DECL_CTORS_T_A(float)
407  DECL_CTORS_T_A(double)
408  DECL_CTORS_T_A(const char*)
409  DECL_CTORS_T_A(const sc_fxval&)
411  DECL_CTORS_T_A(const sc_fxnum&)
412  DECL_CTORS_T_A(const sc_fxnum_fast&)
413 #ifndef SC_FX_EXCLUDE_OTHER
416  DECL_CTORS_T_B(const sc_int_base&)
417  DECL_CTORS_T_B(const sc_uint_base&)
418  DECL_CTORS_T_B(const sc_signed&)
419  DECL_CTORS_T_B(const sc_unsigned&)
420 #endif
421 
422 #undef DECL_CTORS_T
423 #undef DECL_CTORS_T_A
424 #undef DECL_CTORS_T_B
425 
426  // copy constructor
427 
428  sc_ufix_fast( const sc_ufix_fast& );
429 
430 
431  // unary bitwise operators
432 
433  const sc_ufix_fast operator ~ () const;
434 
435 
436  // unary bitwise functions
437 
438  friend void b_not( sc_ufix_fast&, const sc_ufix_fast& );
439 
440 
441  // binary bitwise operators
442 
443  friend const sc_ufix_fast operator & ( const sc_ufix_fast&,
444  const sc_ufix_fast& );
445  friend const sc_ufix_fast operator ^ ( const sc_ufix_fast&,
446  const sc_ufix_fast& );
447  friend const sc_ufix_fast operator | ( const sc_ufix_fast&,
448  const sc_ufix_fast& );
449 
450 
451  // binary bitwise functions
452 
453  friend void b_and( sc_ufix_fast&, const sc_ufix_fast&,
454  const sc_ufix_fast& );
455  friend void b_or ( sc_ufix_fast&, const sc_ufix_fast&,
456  const sc_ufix_fast& );
457  friend void b_xor( sc_ufix_fast&, const sc_ufix_fast&,
458  const sc_ufix_fast& );
459 
460 
461  // assignment operators
462 
464 
465 #define DECL_ASN_OP_T(op,tp) \
466  sc_ufix_fast& operator op ( tp );
467 
468 #ifndef SC_FX_EXCLUDE_OTHER
469 #define DECL_ASN_OP_OTHER(op) \
470  DECL_ASN_OP_T(op,int64) \
471  DECL_ASN_OP_T(op,uint64) \
472  DECL_ASN_OP_T(op,const sc_int_base&) \
473  DECL_ASN_OP_T(op,const sc_uint_base&) \
474  DECL_ASN_OP_T(op,const sc_signed&) \
475  DECL_ASN_OP_T(op,const sc_unsigned&)
476 #else
477 #define DECL_ASN_OP_OTHER(op)
478 #endif
479 
480 #define DECL_ASN_OP(op) \
481  DECL_ASN_OP_T(op,int) \
482  DECL_ASN_OP_T(op,unsigned int) \
483  DECL_ASN_OP_T(op,long) \
484  DECL_ASN_OP_T(op,unsigned long) \
485  DECL_ASN_OP_T(op,float) \
486  DECL_ASN_OP_T(op,double) \
487  DECL_ASN_OP_T(op,const char*) \
488  DECL_ASN_OP_T(op,const sc_fxval&) \
489  DECL_ASN_OP_T(op,const sc_fxval_fast&) \
490  DECL_ASN_OP_T(op,const sc_fxnum&) \
491  DECL_ASN_OP_T(op,const sc_fxnum_fast&) \
492  DECL_ASN_OP_OTHER(op)
493 
494  DECL_ASN_OP(=)
495 
496  DECL_ASN_OP(*=)
497  DECL_ASN_OP(/=)
498  DECL_ASN_OP(+=)
499  DECL_ASN_OP(-=)
500 
501  DECL_ASN_OP_T(<<=,int)
502  DECL_ASN_OP_T(>>=,int)
503 
504  DECL_ASN_OP_T(&=,const sc_ufix&)
505  DECL_ASN_OP_T(&=,const sc_ufix_fast&)
506  DECL_ASN_OP_T(|=,const sc_ufix&)
507  DECL_ASN_OP_T(|=,const sc_ufix_fast&)
508  DECL_ASN_OP_T(^=,const sc_ufix&)
509  DECL_ASN_OP_T(^=,const sc_ufix_fast&)
510 
511 #undef DECL_ASN_OP_T
512 #undef DECL_ASN_OP_OTHER
513 #undef DECL_ASN_OP
514 
515 
516  // auto-increment and auto-decrement
517 
518  const sc_fxval_fast operator ++ ( int );
519  const sc_fxval_fast operator -- ( int );
520 
523 
524 };
525 
526 
527 // IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
528 
529 // ----------------------------------------------------------------------------
530 // CLASS : sc_ufix
531 //
532 // "Unconstrained" unsigned fixed-point class; arbitrary precision.
533 // ----------------------------------------------------------------------------
534 
535 // constructors
536 
537 inline
540  SC_US_,
542  observer_ )
543 {}
544 
545 inline
546 sc_ufix::sc_ufix( int wl_, int iwl_,
547  sc_fxnum_observer* observer_ )
548 : sc_fxnum( sc_fxtype_params( wl_, iwl_ ),
549  SC_US_,
551  observer_ )
552 {}
553 
554 inline
556  sc_fxnum_observer* observer_ )
557 : sc_fxnum( sc_fxtype_params( qm, om ),
558  SC_US_,
560  observer_ )
561 {}
562 
563 inline
565  sc_fxnum_observer* observer_ )
566 : sc_fxnum( sc_fxtype_params( qm, om, nb ),
567  SC_US_,
569  observer_ )
570 {}
571 
572 inline
573 sc_ufix::sc_ufix( int wl_, int iwl_, sc_q_mode qm, sc_o_mode om,
574  sc_fxnum_observer* observer_ )
575 : sc_fxnum( sc_fxtype_params( wl_, iwl_, qm, om ),
576  SC_US_,
578  observer_ )
579 {}
580 
581 inline
582 sc_ufix::sc_ufix( int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb,
583  sc_fxnum_observer* observer_ )
584 : sc_fxnum( sc_fxtype_params( wl_, iwl_, qm, om, nb ),
585  SC_US_,
587  observer_ )
588 {}
589 
590 inline
592  sc_fxnum_observer* observer_ )
594  SC_US_,
595  cast_sw,
596  observer_ )
597 {}
598 
599 inline
600 sc_ufix::sc_ufix( int wl_, int iwl_,
601  const sc_fxcast_switch& cast_sw,
602  sc_fxnum_observer* observer_ )
603 : sc_fxnum( sc_fxtype_params( wl_, iwl_ ),
604  SC_US_,
605  cast_sw,
606  observer_ )
607 {}
608 
609 inline
611  const sc_fxcast_switch& cast_sw,
612  sc_fxnum_observer* observer_ )
613 : sc_fxnum( sc_fxtype_params( qm, om ),
614  SC_US_,
615  cast_sw,
616  observer_ )
617 {}
618 
619 inline
621  const sc_fxcast_switch& cast_sw,
622  sc_fxnum_observer* observer_ )
623 : sc_fxnum( sc_fxtype_params( qm, om, nb ),
624  SC_US_,
625  cast_sw,
626  observer_ )
627 {}
628 
629 inline
630 sc_ufix::sc_ufix( int wl_, int iwl_, sc_q_mode qm, sc_o_mode om,
631  const sc_fxcast_switch& cast_sw,
632  sc_fxnum_observer* observer_ )
633 : sc_fxnum( sc_fxtype_params( wl_, iwl_, qm, om ),
634  SC_US_,
635  cast_sw,
636  observer_ )
637 {}
638 
639 inline
640 sc_ufix::sc_ufix( int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb,
641  const sc_fxcast_switch& cast_sw,
642  sc_fxnum_observer* observer_ )
643 : sc_fxnum( sc_fxtype_params( wl_, iwl_, qm, om, nb ),
644  SC_US_,
645  cast_sw,
646  observer_ )
647 {}
648 
649 inline
650 sc_ufix::sc_ufix( const sc_fxtype_params& type_params,
651  sc_fxnum_observer* observer_ )
652 : sc_fxnum( type_params,
653  SC_US_,
655  observer_ )
656 {}
657 
658 inline
659 sc_ufix::sc_ufix( const sc_fxtype_params& type_params,
660  const sc_fxcast_switch& cast_sw,
661  sc_fxnum_observer* observer_ )
662 : sc_fxnum( type_params,
663  SC_US_,
664  cast_sw,
665  observer_ )
666 {}
667 
668 #define DEFN_CTORS_T_A(tp) \
669 inline \
670 sc_ufix::sc_ufix( tp a, \
671  sc_fxnum_observer* observer_ ) \
672 : sc_fxnum( a, \
673  sc_fxtype_params(), \
674  SC_US_, \
675  sc_fxcast_switch(), \
676  observer_ ) \
677 {} \
678  \
679 inline \
680 sc_ufix::sc_ufix( tp a, \
681  int wl_, int iwl_, \
682  sc_fxnum_observer* observer_ ) \
683 : sc_fxnum( a, \
684  sc_fxtype_params( wl_, iwl_ ), \
685  SC_US_, \
686  sc_fxcast_switch(), \
687  observer_ ) \
688 {} \
689  \
690 inline \
691 sc_ufix::sc_ufix( tp a, \
692  sc_q_mode qm, sc_o_mode om, \
693  sc_fxnum_observer* observer_ ) \
694 : sc_fxnum( a, \
695  sc_fxtype_params( qm, om ), \
696  SC_US_, \
697  sc_fxcast_switch(), \
698  observer_ ) \
699 {} \
700  \
701 inline \
702 sc_ufix::sc_ufix( tp a, \
703  sc_q_mode qm, sc_o_mode om, int nb, \
704  sc_fxnum_observer* observer_ ) \
705 : sc_fxnum( a, \
706  sc_fxtype_params( qm, om, nb ), \
707  SC_US_, \
708  sc_fxcast_switch(), \
709  observer_ ) \
710 {} \
711  \
712 inline \
713 sc_ufix::sc_ufix( tp a, \
714  int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
715  sc_fxnum_observer* observer_ ) \
716 : sc_fxnum( a, \
717  sc_fxtype_params( wl_, iwl_, qm, om ), \
718  SC_US_, \
719  sc_fxcast_switch(), \
720  observer_ ) \
721 {} \
722  \
723 inline \
724 sc_ufix::sc_ufix( tp a, \
725  int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb, \
726  sc_fxnum_observer* observer_ ) \
727 : sc_fxnum( a, \
728  sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
729  SC_US_, \
730  sc_fxcast_switch(), \
731  observer_ ) \
732 {} \
733  \
734 inline \
735 sc_ufix::sc_ufix( tp a, \
736  const sc_fxcast_switch& cast_sw, \
737  sc_fxnum_observer* observer_ ) \
738 : sc_fxnum( a, \
739  sc_fxtype_params(), \
740  SC_US_, \
741  cast_sw, \
742  observer_ ) \
743 {} \
744  \
745 inline \
746 sc_ufix::sc_ufix( tp a, \
747  int wl_, int iwl_, \
748  const sc_fxcast_switch& cast_sw, \
749  sc_fxnum_observer* observer_ ) \
750 : sc_fxnum( a, \
751  sc_fxtype_params( wl_, iwl_ ), \
752  SC_US_, \
753  cast_sw, \
754  observer_ ) \
755 {} \
756  \
757 inline \
758 sc_ufix::sc_ufix( tp a, \
759  sc_q_mode qm, sc_o_mode om, \
760  const sc_fxcast_switch& cast_sw, \
761  sc_fxnum_observer* observer_ ) \
762 : sc_fxnum( a, \
763  sc_fxtype_params( qm, om ), \
764  SC_US_, \
765  cast_sw, \
766  observer_ ) \
767 {} \
768  \
769 inline \
770 sc_ufix::sc_ufix( tp a, \
771  sc_q_mode qm, sc_o_mode om, int nb, \
772  const sc_fxcast_switch& cast_sw, \
773  sc_fxnum_observer* observer_ ) \
774 : sc_fxnum( a, \
775  sc_fxtype_params( qm, om, nb ), \
776  SC_US_, \
777  cast_sw, \
778  observer_ ) \
779 {} \
780  \
781 inline \
782 sc_ufix::sc_ufix( tp a, \
783  int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
784  const sc_fxcast_switch& cast_sw, \
785  sc_fxnum_observer* observer_ ) \
786 : sc_fxnum( a, \
787  sc_fxtype_params( wl_, iwl_, qm, om ), \
788  SC_US_, \
789  cast_sw, \
790  observer_ ) \
791 {} \
792  \
793 inline \
794 sc_ufix::sc_ufix( tp a, \
795  int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb, \
796  const sc_fxcast_switch& cast_sw, \
797  sc_fxnum_observer* observer_ ) \
798 : sc_fxnum( a, \
799  sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
800  SC_US_, \
801  cast_sw, \
802  observer_ ) \
803 {} \
804  \
805 inline \
806 sc_ufix::sc_ufix( tp a, \
807  const sc_fxtype_params& type_params, \
808  sc_fxnum_observer* observer_ ) \
809 : sc_fxnum( a, \
810  type_params, \
811  SC_US_, \
812  sc_fxcast_switch(), \
813  observer_ ) \
814 {} \
815  \
816 inline \
817 sc_ufix::sc_ufix( tp a, \
818  const sc_fxtype_params& type_params, \
819  const sc_fxcast_switch& cast_sw, \
820  sc_fxnum_observer* observer_ ) \
821 : sc_fxnum( a, \
822  type_params, \
823  SC_US_, \
824  cast_sw, \
825  observer_ ) \
826 {}
827 
828 #define DEFN_CTORS_T_B(tp) \
829 inline \
830 sc_ufix::sc_ufix( tp a, \
831  sc_fxnum_observer* observer_ ) \
832 : sc_fxnum( a, \
833  a.type_params(), \
834  SC_US_, \
835  sc_fxcast_switch(), \
836  observer_ ) \
837 {} \
838  \
839 inline \
840 sc_ufix::sc_ufix( tp a, \
841  int wl_, int iwl_, \
842  sc_fxnum_observer* observer_ ) \
843 : sc_fxnum( a, \
844  sc_fxtype_params( a.type_params(), wl_, iwl_ ), \
845  SC_US_, \
846  sc_fxcast_switch(), \
847  observer_ ) \
848 {} \
849  \
850 inline \
851 sc_ufix::sc_ufix( tp a, \
852  sc_q_mode qm, sc_o_mode om, \
853  sc_fxnum_observer* observer_ ) \
854 : sc_fxnum( a, \
855  sc_fxtype_params( a.type_params(), qm, om ), \
856  SC_US_, \
857  sc_fxcast_switch(), \
858  observer_ ) \
859 {} \
860  \
861 inline \
862 sc_ufix::sc_ufix( tp a, \
863  sc_q_mode qm, sc_o_mode om, int nb, \
864  sc_fxnum_observer* observer_ ) \
865 : sc_fxnum( a, \
866  sc_fxtype_params( a.type_params(), qm, om, nb ), \
867  SC_US_, \
868  sc_fxcast_switch(), \
869  observer_ ) \
870 {} \
871  \
872 inline \
873 sc_ufix::sc_ufix( tp a, \
874  int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
875  sc_fxnum_observer* observer_ ) \
876 : sc_fxnum( a, \
877  sc_fxtype_params( wl_, iwl_, qm, om ), \
878  SC_US_, \
879  sc_fxcast_switch(), \
880  observer_ ) \
881 {} \
882  \
883 inline \
884 sc_ufix::sc_ufix( tp a, \
885  int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb, \
886  sc_fxnum_observer* observer_ ) \
887 : sc_fxnum( a, \
888  sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
889  SC_US_, \
890  sc_fxcast_switch(), \
891  observer_ ) \
892 {} \
893  \
894 inline \
895 sc_ufix::sc_ufix( tp a, \
896  const sc_fxcast_switch& cast_sw, \
897  sc_fxnum_observer* observer_ ) \
898 : sc_fxnum( a, \
899  a.type_params(), \
900  SC_US_, \
901  cast_sw, \
902  observer_ ) \
903 {} \
904  \
905 inline \
906 sc_ufix::sc_ufix( tp a, \
907  int wl_, int iwl_, \
908  const sc_fxcast_switch& cast_sw, \
909  sc_fxnum_observer* observer_ ) \
910 : sc_fxnum( a, \
911  sc_fxtype_params( a.type_params(), wl_, iwl_ ), \
912  SC_US_, \
913  cast_sw, \
914  observer_ ) \
915 {} \
916  \
917 inline \
918 sc_ufix::sc_ufix( tp a, \
919  sc_q_mode qm, sc_o_mode om, \
920  const sc_fxcast_switch& cast_sw, \
921  sc_fxnum_observer* observer_ ) \
922 : sc_fxnum( a, \
923  sc_fxtype_params( a.type_params(), qm, om ), \
924  SC_US_, \
925  cast_sw, \
926  observer_ ) \
927 {} \
928  \
929 inline \
930 sc_ufix::sc_ufix( tp a, \
931  sc_q_mode qm, sc_o_mode om, int nb, \
932  const sc_fxcast_switch& cast_sw, \
933  sc_fxnum_observer* observer_ ) \
934 : sc_fxnum( a, \
935  sc_fxtype_params( a.type_params(), qm, om, nb ), \
936  SC_US_, \
937  cast_sw, \
938  observer_ ) \
939 {} \
940  \
941 inline \
942 sc_ufix::sc_ufix( tp a, \
943  int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
944  const sc_fxcast_switch& cast_sw, \
945  sc_fxnum_observer* observer_ ) \
946 : sc_fxnum( a, \
947  sc_fxtype_params( wl_, iwl_, qm, om ), \
948  SC_US_, \
949  cast_sw, \
950  observer_ ) \
951 {} \
952  \
953 inline \
954 sc_ufix::sc_ufix( tp a, \
955  int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb, \
956  const sc_fxcast_switch& cast_sw, \
957  sc_fxnum_observer* observer_ ) \
958 : sc_fxnum( a, \
959  sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
960  SC_US_, \
961  cast_sw, \
962  observer_ ) \
963 {} \
964  \
965 inline \
966 sc_ufix::sc_ufix( tp a, \
967  const sc_fxtype_params& type_params, \
968  sc_fxnum_observer* observer_ ) \
969 : sc_fxnum( a, \
970  type_params, \
971  SC_US_, \
972  sc_fxcast_switch(), \
973  observer_ ) \
974 {} \
975  \
976 inline \
977 sc_ufix::sc_ufix( tp a, \
978  const sc_fxtype_params& type_params, \
979  const sc_fxcast_switch& cast_sw, \
980  sc_fxnum_observer* observer_ ) \
981 : sc_fxnum( a, \
982  type_params, \
983  SC_US_, \
984  cast_sw, \
985  observer_ ) \
986 {}
987 
988 DEFN_CTORS_T_A(int)
989 DEFN_CTORS_T_A(unsigned int)
990 DEFN_CTORS_T_A(long)
991 DEFN_CTORS_T_A(unsigned long)
992 DEFN_CTORS_T_A(float)
993 DEFN_CTORS_T_A(double)
994 DEFN_CTORS_T_A(const char*)
995 DEFN_CTORS_T_A(const sc_fxval&)
997 DEFN_CTORS_T_B(const sc_fxnum&)
999 #ifndef SC_FX_EXCLUDE_OTHER
1004 DEFN_CTORS_T_A(const sc_signed&)
1006 #endif
1007 
1008 #undef DEFN_CTORS_T_A
1009 #undef DEFN_CTORS_T_B
1010 
1011 // copy constructor
1012 
1013 inline
1015 : sc_fxnum( a,
1016  a.type_params(),
1017  SC_US_,
1018  sc_fxcast_switch(),
1019  0 )
1020 {}
1021 
1022 
1023 // unary bitwise operators
1024 
1025 inline
1026 const sc_ufix
1028 {
1029  SC_FXNUM_OBSERVER_READ_( *this )
1030  int iwl_c = iwl();
1031  int wl_c = wl();
1032  sc_ufix c( wl_c, iwl_c );
1033  for( int i = iwl_c - wl_c; i < iwl_c; ++ i )
1034  c.set_bit( i, ! get_bit( i ) );
1035  return sc_ufix( c, wl_c, iwl_c );
1036 }
1037 
1038 
1039 // unary bitwise functions
1040 
1041 inline
1042 void
1043 b_not( sc_ufix& c, const sc_ufix& a )
1044 {
1046  int iwl_c = c.iwl();
1047  for( int i = iwl_c - c.wl(); i < iwl_c; ++ i )
1048  c.set_bit( i, ! a.get_bit( i ) );
1049  c.cast();
1051 }
1052 
1053 
1054 // binary bitwise operators
1055 
1056 #define DEFN_BIN_OP_T(op,op2,tp1,tp2) \
1057 inline \
1058 const sc_ufix \
1059 operator op ( const tp1& a, const tp2& b ) \
1060 { \
1061  a.observer_read(); \
1062  b.observer_read(); \
1063  int iwl_a = a.iwl(); \
1064  int iwl_b = b.iwl(); \
1065  int iwl_c = sc_max( iwl_a, iwl_b ); \
1066  int fwl_c = sc_max( a.wl() - iwl_a, b.wl() - iwl_b ); \
1067  sc_ufix c( iwl_c + fwl_c, iwl_c ); \
1068  for( int i = -fwl_c; i < iwl_c; ++ i ) \
1069  c.set_bit( i, a.get_bit( i ) op2 b.get_bit( i ) ); \
1070  return sc_ufix( c, iwl_c + fwl_c, iwl_c ); \
1071 }
1072 
1073 DEFN_BIN_OP_T(&,&&,sc_ufix,sc_ufix)
1074 DEFN_BIN_OP_T(&,&&,sc_ufix,sc_ufix_fast)
1075 DEFN_BIN_OP_T(&,&&,sc_ufix_fast,sc_ufix)
1076 
1077 DEFN_BIN_OP_T(|,||,sc_ufix,sc_ufix)
1078 DEFN_BIN_OP_T(|,||,sc_ufix,sc_ufix_fast)
1079 DEFN_BIN_OP_T(|,||,sc_ufix_fast,sc_ufix)
1080 
1081 DEFN_BIN_OP_T(^,!=,sc_ufix,sc_ufix)
1082 DEFN_BIN_OP_T(^,!=,sc_ufix,sc_ufix_fast)
1083 DEFN_BIN_OP_T(^,!=,sc_ufix_fast,sc_ufix)
1084 
1085 #undef DEFN_BIN_OP_T
1086 
1087 
1088 // binary bitwise functions
1089 
1090 #define DEFN_BIN_FNC_T(fnc,op2,tp1,tp2) \
1091 inline \
1092 void \
1093 fnc ( sc_ufix& c, const tp1& a, const tp2& b ) \
1094 { \
1095  a.observer_read(); \
1096  b.observer_read(); \
1097  int iwl_c = c.iwl(); \
1098  for( int i = iwl_c - c.wl(); i < iwl_c; ++ i ) \
1099  c.set_bit( i, a.get_bit( i ) op2 b.get_bit( i ) ); \
1100  c.cast(); \
1101  SC_FXNUM_OBSERVER_WRITE_( c ) \
1102 }
1103 
1104 DEFN_BIN_FNC_T(b_and,&&,sc_ufix,sc_ufix)
1105 DEFN_BIN_FNC_T(b_and,&&,sc_ufix,sc_ufix_fast)
1106 DEFN_BIN_FNC_T(b_and,&&,sc_ufix_fast,sc_ufix)
1107 
1108 DEFN_BIN_FNC_T(b_or,||,sc_ufix,sc_ufix)
1109 DEFN_BIN_FNC_T(b_or,||,sc_ufix,sc_ufix_fast)
1110 DEFN_BIN_FNC_T(b_or,||,sc_ufix_fast,sc_ufix)
1111 
1112 DEFN_BIN_FNC_T(b_xor,!=,sc_ufix,sc_ufix)
1113 DEFN_BIN_FNC_T(b_xor,!=,sc_ufix,sc_ufix_fast)
1114 DEFN_BIN_FNC_T(b_xor,!=,sc_ufix_fast,sc_ufix)
1115 
1116 #undef DEFN_BIN_FNC_T
1117 
1118 
1119 // assignment operators
1120 
1121 inline
1122 sc_ufix&
1123 sc_ufix::operator = ( const sc_ufix& a )
1124 {
1125  sc_fxnum::operator = ( a );
1126  return *this;
1127 }
1128 
1129 #define DEFN_ASN_OP_T(op,tp) \
1130 inline \
1131 sc_ufix& \
1132 sc_ufix::operator op ( tp a ) \
1133 { \
1134  sc_fxnum::operator op( a ); \
1135  return *this; \
1136 }
1137 
1138 #ifndef SC_FX_EXCLUDE_OTHER
1139 #define DEFN_ASN_OP_OTHER(op) \
1140 DEFN_ASN_OP_T(op,int64) \
1141 DEFN_ASN_OP_T(op,uint64) \
1142 DEFN_ASN_OP_T(op,const sc_int_base&) \
1143 DEFN_ASN_OP_T(op,const sc_uint_base&) \
1144 DEFN_ASN_OP_T(op,const sc_signed&) \
1145 DEFN_ASN_OP_T(op,const sc_unsigned&)
1146 #else
1147 #define DEFN_ASN_OP_OTHER(op)
1148 #endif
1149 
1150 #define DEFN_ASN_OP(op) \
1151 DEFN_ASN_OP_T(op,int) \
1152 DEFN_ASN_OP_T(op,unsigned int) \
1153 DEFN_ASN_OP_T(op,long) \
1154 DEFN_ASN_OP_T(op,unsigned long) \
1155 DEFN_ASN_OP_T(op,float) \
1156 DEFN_ASN_OP_T(op,double) \
1157 DEFN_ASN_OP_T(op,const char*) \
1158 DEFN_ASN_OP_T(op,const sc_fxval&) \
1159 DEFN_ASN_OP_T(op,const sc_fxval_fast&) \
1160 DEFN_ASN_OP_T(op,const sc_fxnum&) \
1161 DEFN_ASN_OP_T(op,const sc_fxnum_fast&) \
1162 DEFN_ASN_OP_OTHER(op)
1163 
1164 DEFN_ASN_OP(=)
1165 
1166 DEFN_ASN_OP(*=)
1167 DEFN_ASN_OP(/=)
1168 DEFN_ASN_OP(+=)
1169 DEFN_ASN_OP(-=)
1170 
1171 DEFN_ASN_OP_T(<<=,int)
1172 DEFN_ASN_OP_T(>>=,int)
1173 
1174 #undef DEFN_ASN_OP_T
1175 #undef DEFN_ASN_OP_OTHER
1176 #undef DEFN_ASN_OP
1177 
1178 
1179 #define DEFN_ASN_OP_T(op,op2,tp) \
1180 inline \
1181 sc_ufix& \
1182 sc_ufix::operator op ( const tp& b ) \
1183 { \
1184  SC_FXNUM_OBSERVER_READ_( *this ) \
1185  b.observer_read(); \
1186  int iwl_c = iwl(); \
1187  for( int i = iwl_c - wl(); i < iwl_c; ++ i ) \
1188  set_bit( i, get_bit( i ) op2 b.get_bit( i ) ); \
1189  cast(); \
1190  SC_FXNUM_OBSERVER_WRITE_( *this ) \
1191  return *this; \
1192 }
1193 
1194 DEFN_ASN_OP_T(&=,&&,sc_ufix)
1195 DEFN_ASN_OP_T(&=,&&,sc_ufix_fast)
1196 DEFN_ASN_OP_T(|=,||,sc_ufix)
1197 DEFN_ASN_OP_T(|=,||,sc_ufix_fast)
1198 DEFN_ASN_OP_T(^=,!=,sc_ufix)
1199 DEFN_ASN_OP_T(^=,!=,sc_ufix_fast)
1200 
1201 #undef DEFN_ASN_OP_T
1202 
1203 
1204 // auto-increment and auto-decrement
1205 
1206 inline
1207 const sc_fxval
1209 {
1210  return sc_fxval( sc_fxnum::operator ++ ( 0 ) );
1211 }
1212 
1213 inline
1214 const sc_fxval
1216 {
1217  return sc_fxval( sc_fxnum::operator -- ( 0 ) );
1218 }
1219 
1220 inline
1221 sc_ufix&
1223 {
1225  return *this;
1226 }
1227 
1228 inline
1229 sc_ufix&
1231 {
1233  return *this;
1234 }
1235 
1236 
1237 // ----------------------------------------------------------------------------
1238 // CLASS : sc_ufix_fast
1239 //
1240 // "Unconstrained" unsigned fixed-point class; limited precision.
1241 // ----------------------------------------------------------------------------
1242 
1243 // constructors
1244 
1245 inline
1248  SC_US_,
1249  sc_fxcast_switch(),
1250  observer_ )
1251 {}
1252 
1253 inline
1254 sc_ufix_fast::sc_ufix_fast( int wl_, int iwl_,
1255  sc_fxnum_fast_observer* observer_ )
1256 : sc_fxnum_fast( sc_fxtype_params( wl_, iwl_ ),
1257  SC_US_,
1258  sc_fxcast_switch(),
1259  observer_ )
1260 {}
1261 
1262 inline
1264  sc_fxnum_fast_observer* observer_ )
1265 : sc_fxnum_fast( sc_fxtype_params( qm, om ),
1266  SC_US_,
1267  sc_fxcast_switch(),
1268  observer_ )
1269 {}
1270 
1271 inline
1273  sc_fxnum_fast_observer* observer_ )
1274 : sc_fxnum_fast( sc_fxtype_params( qm, om, nb ),
1275  SC_US_,
1276  sc_fxcast_switch(),
1277  observer_ )
1278 {}
1279 
1280 inline
1282  sc_fxnum_fast_observer* observer_ )
1283 : sc_fxnum_fast( sc_fxtype_params( wl_, iwl_, qm, om ),
1284  SC_US_,
1285  sc_fxcast_switch(),
1286  observer_ )
1287 {}
1288 
1289 inline
1290 sc_ufix_fast::sc_ufix_fast( int wl_, int iwl_,
1291  sc_q_mode qm, sc_o_mode om, int nb,
1292  sc_fxnum_fast_observer* observer_ )
1293 : sc_fxnum_fast( sc_fxtype_params( wl_, iwl_, qm, om, nb ),
1294  SC_US_,
1295  sc_fxcast_switch(),
1296  observer_ )
1297 {}
1298 
1299 inline
1301  sc_fxnum_fast_observer* observer_ )
1303  SC_US_,
1304  cast_sw,
1305  observer_ )
1306 {}
1307 
1308 inline
1309 sc_ufix_fast::sc_ufix_fast( int wl_, int iwl_,
1310  const sc_fxcast_switch& cast_sw,
1311  sc_fxnum_fast_observer* observer_ )
1312 : sc_fxnum_fast( sc_fxtype_params( wl_, iwl_ ),
1313  SC_US_,
1314  cast_sw,
1315  observer_ )
1316 {}
1317 
1318 inline
1320  const sc_fxcast_switch& cast_sw,
1321  sc_fxnum_fast_observer* observer_ )
1322 : sc_fxnum_fast( sc_fxtype_params( qm, om ),
1323  SC_US_,
1324  cast_sw,
1325  observer_ )
1326 {}
1327 
1328 inline
1330  const sc_fxcast_switch& cast_sw,
1331  sc_fxnum_fast_observer* observer_ )
1332 : sc_fxnum_fast( sc_fxtype_params( qm, om, nb ),
1333  SC_US_,
1334  cast_sw,
1335  observer_ )
1336 {}
1337 
1338 inline
1340  const sc_fxcast_switch& cast_sw,
1341  sc_fxnum_fast_observer* observer_ )
1342 : sc_fxnum_fast( sc_fxtype_params( wl_, iwl_, qm, om ),
1343  SC_US_,
1344  cast_sw,
1345  observer_ )
1346 {}
1347 
1348 inline
1349 sc_ufix_fast::sc_ufix_fast( int wl_, int iwl_,
1350  sc_q_mode qm, sc_o_mode om, int nb,
1351  const sc_fxcast_switch& cast_sw,
1352  sc_fxnum_fast_observer* observer_ )
1353 : sc_fxnum_fast( sc_fxtype_params( wl_, iwl_, qm, om, nb ),
1354  SC_US_,
1355  cast_sw,
1356  observer_ )
1357 {}
1358 
1359 inline
1361  sc_fxnum_fast_observer* observer_ )
1362 : sc_fxnum_fast( type_params,
1363  SC_US_,
1364  sc_fxcast_switch(),
1365  observer_ )
1366 {}
1367 
1368 inline
1370  const sc_fxcast_switch& cast_sw,
1371  sc_fxnum_fast_observer* observer_ )
1372 : sc_fxnum_fast( type_params,
1373  SC_US_,
1374  cast_sw,
1375  observer_ )
1376 {}
1377 
1378 #define DEFN_CTORS_T_A(tp) \
1379 inline \
1380 sc_ufix_fast::sc_ufix_fast( tp a, \
1381  sc_fxnum_fast_observer* observer_ ) \
1382 : sc_fxnum_fast( a, \
1383  sc_fxtype_params(), \
1384  SC_US_, \
1385  sc_fxcast_switch(), \
1386  observer_ ) \
1387 {} \
1388  \
1389 inline \
1390 sc_ufix_fast::sc_ufix_fast( tp a, \
1391  int wl_, int iwl_, \
1392  sc_fxnum_fast_observer* observer_ ) \
1393 : sc_fxnum_fast( a, \
1394  sc_fxtype_params( wl_, iwl_ ), \
1395  SC_US_, \
1396  sc_fxcast_switch(), \
1397  observer_ ) \
1398 {} \
1399  \
1400 inline \
1401 sc_ufix_fast::sc_ufix_fast( tp a, \
1402  sc_q_mode qm, sc_o_mode om, \
1403  sc_fxnum_fast_observer* observer_ ) \
1404 : sc_fxnum_fast( a, \
1405  sc_fxtype_params( qm, om ), \
1406  SC_US_, \
1407  sc_fxcast_switch(), \
1408  observer_ ) \
1409 {} \
1410  \
1411 inline \
1412 sc_ufix_fast::sc_ufix_fast( tp a, \
1413  sc_q_mode qm, sc_o_mode om, int nb, \
1414  sc_fxnum_fast_observer* observer_ ) \
1415 : sc_fxnum_fast( a, \
1416  sc_fxtype_params( qm, om, nb ), \
1417  SC_US_, \
1418  sc_fxcast_switch(), \
1419  observer_ ) \
1420 {} \
1421  \
1422 inline \
1423 sc_ufix_fast::sc_ufix_fast( tp a, \
1424  int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
1425  sc_fxnum_fast_observer* observer_ ) \
1426 : sc_fxnum_fast( a, \
1427  sc_fxtype_params( wl_, iwl_, qm, om ), \
1428  SC_US_, \
1429  sc_fxcast_switch(), \
1430  observer_ ) \
1431 {} \
1432  \
1433 inline \
1434 sc_ufix_fast::sc_ufix_fast( tp a, \
1435  int wl_, int iwl_, \
1436  sc_q_mode qm, sc_o_mode om, int nb, \
1437  sc_fxnum_fast_observer* observer_ ) \
1438 : sc_fxnum_fast( a, \
1439  sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
1440  SC_US_, \
1441  sc_fxcast_switch(), \
1442  observer_ ) \
1443 {} \
1444  \
1445 inline \
1446 sc_ufix_fast::sc_ufix_fast( tp a, \
1447  const sc_fxcast_switch& cast_sw, \
1448  sc_fxnum_fast_observer* observer_ ) \
1449 : sc_fxnum_fast( a, \
1450  sc_fxtype_params(), \
1451  SC_US_, \
1452  cast_sw, \
1453  observer_ ) \
1454 {} \
1455  \
1456 inline \
1457 sc_ufix_fast::sc_ufix_fast( tp a, \
1458  int wl_, int iwl_, \
1459  const sc_fxcast_switch& cast_sw, \
1460  sc_fxnum_fast_observer* observer_ ) \
1461 : sc_fxnum_fast( a, \
1462  sc_fxtype_params( wl_, iwl_ ), \
1463  SC_US_, \
1464  cast_sw, \
1465  observer_ ) \
1466 {} \
1467  \
1468 inline \
1469 sc_ufix_fast::sc_ufix_fast( tp a, \
1470  sc_q_mode qm, sc_o_mode om, \
1471  const sc_fxcast_switch& cast_sw, \
1472  sc_fxnum_fast_observer* observer_ ) \
1473 : sc_fxnum_fast( a, \
1474  sc_fxtype_params( qm, om ), \
1475  SC_US_, \
1476  cast_sw, \
1477  observer_ ) \
1478 {} \
1479  \
1480 inline \
1481 sc_ufix_fast::sc_ufix_fast( tp a, \
1482  sc_q_mode qm, sc_o_mode om, int nb, \
1483  const sc_fxcast_switch& cast_sw, \
1484  sc_fxnum_fast_observer* observer_ ) \
1485 : sc_fxnum_fast( a, \
1486  sc_fxtype_params( qm, om, nb ), \
1487  SC_US_, \
1488  cast_sw, \
1489  observer_ ) \
1490 {} \
1491  \
1492 inline \
1493 sc_ufix_fast::sc_ufix_fast( tp a, \
1494  int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
1495  const sc_fxcast_switch& cast_sw, \
1496  sc_fxnum_fast_observer* observer_ ) \
1497 : sc_fxnum_fast( a, \
1498  sc_fxtype_params( wl_, iwl_, qm, om ), \
1499  SC_US_, \
1500  cast_sw, \
1501  observer_ ) \
1502 {} \
1503  \
1504 inline \
1505 sc_ufix_fast::sc_ufix_fast( tp a, \
1506  int wl_, int iwl_, \
1507  sc_q_mode qm, sc_o_mode om, int nb, \
1508  const sc_fxcast_switch& cast_sw, \
1509  sc_fxnum_fast_observer* observer_ ) \
1510 : sc_fxnum_fast( a, \
1511  sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
1512  SC_US_, \
1513  cast_sw, \
1514  observer_ ) \
1515 {} \
1516  \
1517 inline \
1518 sc_ufix_fast::sc_ufix_fast( tp a, \
1519  const sc_fxtype_params& type_params, \
1520  sc_fxnum_fast_observer* observer_ ) \
1521 : sc_fxnum_fast( a, \
1522  type_params, \
1523  SC_US_, \
1524  sc_fxcast_switch(), \
1525  observer_ ) \
1526 {} \
1527  \
1528 inline \
1529 sc_ufix_fast::sc_ufix_fast( tp a, \
1530  const sc_fxtype_params& type_params, \
1531  const sc_fxcast_switch& cast_sw, \
1532  sc_fxnum_fast_observer* observer_ ) \
1533 : sc_fxnum_fast( a, \
1534  type_params, \
1535  SC_US_, \
1536  cast_sw, \
1537  observer_ ) \
1538 {}
1539 
1540 #define DEFN_CTORS_T_B(tp) \
1541 inline \
1542 sc_ufix_fast::sc_ufix_fast( tp a, \
1543  sc_fxnum_fast_observer* observer_ ) \
1544 : sc_fxnum_fast( a, \
1545  a.type_params(), \
1546  SC_US_, \
1547  sc_fxcast_switch(), \
1548  observer_ ) \
1549 {} \
1550  \
1551 inline \
1552 sc_ufix_fast::sc_ufix_fast( tp a, \
1553  int wl_, int iwl_, \
1554  sc_fxnum_fast_observer* observer_ ) \
1555 : sc_fxnum_fast( a, \
1556  sc_fxtype_params( a.type_params(), wl_, iwl_ ), \
1557  SC_US_, \
1558  sc_fxcast_switch(), \
1559  observer_ ) \
1560 {} \
1561  \
1562 inline \
1563 sc_ufix_fast::sc_ufix_fast( tp a, \
1564  sc_q_mode qm, sc_o_mode om, \
1565  sc_fxnum_fast_observer* observer_ ) \
1566 : sc_fxnum_fast( a, \
1567  sc_fxtype_params( a.type_params(), qm, om ), \
1568  SC_US_, \
1569  sc_fxcast_switch(), \
1570  observer_ ) \
1571 {} \
1572  \
1573 inline \
1574 sc_ufix_fast::sc_ufix_fast( tp a, \
1575  sc_q_mode qm, sc_o_mode om, int nb, \
1576  sc_fxnum_fast_observer* observer_ ) \
1577 : sc_fxnum_fast( a, \
1578  sc_fxtype_params( a.type_params(), qm, om, nb ), \
1579  SC_US_, \
1580  sc_fxcast_switch(), \
1581  observer_ ) \
1582 {} \
1583  \
1584 inline \
1585 sc_ufix_fast::sc_ufix_fast( tp a, \
1586  int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
1587  sc_fxnum_fast_observer* observer_ ) \
1588 : sc_fxnum_fast( a, \
1589  sc_fxtype_params( wl_, iwl_, qm, om ), \
1590  SC_US_, \
1591  sc_fxcast_switch(), \
1592  observer_ ) \
1593 {} \
1594  \
1595 inline \
1596 sc_ufix_fast::sc_ufix_fast( tp a, \
1597  int wl_, int iwl_, \
1598  sc_q_mode qm, sc_o_mode om, int nb, \
1599  sc_fxnum_fast_observer* observer_ ) \
1600 : sc_fxnum_fast( a, \
1601  sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
1602  SC_US_, \
1603  sc_fxcast_switch(), \
1604  observer_ ) \
1605 {} \
1606  \
1607 inline \
1608 sc_ufix_fast::sc_ufix_fast( tp a, \
1609  const sc_fxcast_switch& cast_sw, \
1610  sc_fxnum_fast_observer* observer_ ) \
1611 : sc_fxnum_fast( a, \
1612  a.type_params(), \
1613  SC_US_, \
1614  cast_sw, \
1615  observer_ ) \
1616 {} \
1617  \
1618 inline \
1619 sc_ufix_fast::sc_ufix_fast( tp a, \
1620  int wl_, int iwl_, \
1621  const sc_fxcast_switch& cast_sw, \
1622  sc_fxnum_fast_observer* observer_ ) \
1623 : sc_fxnum_fast( a, \
1624  sc_fxtype_params( a.type_params(), wl_, iwl_ ), \
1625  SC_US_, \
1626  cast_sw, \
1627  observer_ ) \
1628 {} \
1629  \
1630 inline \
1631 sc_ufix_fast::sc_ufix_fast( tp a, \
1632  sc_q_mode qm, sc_o_mode om, \
1633  const sc_fxcast_switch& cast_sw, \
1634  sc_fxnum_fast_observer* observer_ ) \
1635 : sc_fxnum_fast( a, \
1636  sc_fxtype_params( a.type_params(), qm, om ), \
1637  SC_US_, \
1638  cast_sw, \
1639  observer_ ) \
1640 {} \
1641  \
1642 inline \
1643 sc_ufix_fast::sc_ufix_fast( tp a, \
1644  sc_q_mode qm, sc_o_mode om, int nb, \
1645  const sc_fxcast_switch& cast_sw, \
1646  sc_fxnum_fast_observer* observer_ ) \
1647 : sc_fxnum_fast( a, \
1648  sc_fxtype_params( a.type_params(), qm, om, nb ), \
1649  SC_US_, \
1650  cast_sw, \
1651  observer_ ) \
1652 {} \
1653  \
1654 inline \
1655 sc_ufix_fast::sc_ufix_fast( tp a, \
1656  int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
1657  const sc_fxcast_switch& cast_sw, \
1658  sc_fxnum_fast_observer* observer_ ) \
1659 : sc_fxnum_fast( a, \
1660  sc_fxtype_params( wl_, iwl_, qm, om ), \
1661  SC_US_, \
1662  cast_sw, \
1663  observer_ ) \
1664 {} \
1665  \
1666 inline \
1667 sc_ufix_fast::sc_ufix_fast( tp a, \
1668  int wl_, int iwl_, \
1669  sc_q_mode qm, sc_o_mode om, int nb, \
1670  const sc_fxcast_switch& cast_sw, \
1671  sc_fxnum_fast_observer* observer_ ) \
1672 : sc_fxnum_fast( a, \
1673  sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
1674  SC_US_, \
1675  cast_sw, \
1676  observer_ ) \
1677 {} \
1678  \
1679 inline \
1680 sc_ufix_fast::sc_ufix_fast( tp a, \
1681  const sc_fxtype_params& type_params, \
1682  sc_fxnum_fast_observer* observer_ ) \
1683 : sc_fxnum_fast( a, \
1684  type_params, \
1685  SC_US_, \
1686  sc_fxcast_switch(), \
1687  observer_ ) \
1688 {} \
1689  \
1690 inline \
1691 sc_ufix_fast::sc_ufix_fast( tp a, \
1692  const sc_fxtype_params& type_params, \
1693  const sc_fxcast_switch& cast_sw, \
1694  sc_fxnum_fast_observer* observer_ ) \
1695 : sc_fxnum_fast( a, \
1696  type_params, \
1697  SC_US_, \
1698  cast_sw, \
1699  observer_ ) \
1700 {}
1701 
1702 DEFN_CTORS_T_A(int)
1703 DEFN_CTORS_T_A(unsigned int)
1704 DEFN_CTORS_T_A(long)
1705 DEFN_CTORS_T_A(unsigned long)
1706 DEFN_CTORS_T_A(float)
1707 DEFN_CTORS_T_A(double)
1708 DEFN_CTORS_T_A(const char*)
1709 DEFN_CTORS_T_A(const sc_fxval&)
1710 DEFN_CTORS_T_A(const sc_fxval_fast&)
1711 DEFN_CTORS_T_B(const sc_fxnum&)
1712 DEFN_CTORS_T_B(const sc_fxnum_fast&)
1713 #ifndef SC_FX_EXCLUDE_OTHER
1716 DEFN_CTORS_T_A(const sc_int_base&)
1717 DEFN_CTORS_T_A(const sc_uint_base&)
1718 DEFN_CTORS_T_A(const sc_signed&)
1719 DEFN_CTORS_T_A(const sc_unsigned&)
1720 #endif
1721 
1722 #undef DEFN_CTORS_T_A
1723 #undef DEFN_CTORS_T_B
1724 
1725 // copy constructor
1726 
1727 inline
1728 sc_ufix_fast::sc_ufix_fast( const sc_ufix_fast& a )
1729 : sc_fxnum_fast( a,
1730  a.type_params(),
1731  SC_US_,
1732  sc_fxcast_switch(),
1733  0 )
1734 {}
1735 
1736 
1737 // unary bitwise operators
1738 
1739 inline
1740 const sc_ufix_fast
1742 {
1744  int iwl_c = iwl();
1745  int wl_c = wl();
1746  sc_ufix_fast c( wl_c, iwl_c );
1747  for( int i = iwl_c - wl_c; i < iwl_c; ++ i )
1748  c.set_bit( i, ! get_bit( i ) );
1749  return sc_ufix_fast( c, wl_c, iwl_c );
1750 }
1751 
1752 
1753 // unary bitwise functions
1754 
1755 inline
1756 void
1757 b_not( sc_ufix_fast& c, const sc_ufix_fast& a )
1758 {
1760  int iwl_c = c.iwl();
1761  for( int i = iwl_c - c.wl(); i < iwl_c; ++ i )
1762  c.set_bit( i, ! a.get_bit( i ) );
1763  c.cast();
1765 }
1766 
1767 
1768 // binary bitwise operators
1769 
1770 #define DEFN_BIN_OP_T(op,op2,tp1,tp2) \
1771 inline \
1772 const sc_ufix_fast \
1773 operator op ( const tp1& a, const tp2& b ) \
1774 { \
1775  a.observer_read(); \
1776  b.observer_read(); \
1777  int iwl_a = a.iwl(); \
1778  int iwl_b = b.iwl(); \
1779  int iwl_c = sc_max( iwl_a, iwl_b ); \
1780  int fwl_c = sc_max( a.wl() - iwl_a, b.wl() - iwl_b ); \
1781  sc_ufix_fast c( iwl_c + fwl_c, iwl_c ); \
1782  for( int i = -fwl_c; i < iwl_c; ++ i ) \
1783  c.set_bit( i, a.get_bit( i ) op2 b.get_bit( i ) ); \
1784  return sc_ufix_fast( c, iwl_c + fwl_c, iwl_c ); \
1785 }
1786 
1787 DEFN_BIN_OP_T(&,&&,sc_ufix_fast,sc_ufix_fast)
1788 DEFN_BIN_OP_T(|,||,sc_ufix_fast,sc_ufix_fast)
1789 DEFN_BIN_OP_T(^,!=,sc_ufix_fast,sc_ufix_fast)
1790 
1791 #undef DEFN_BIN_OP_T
1792 
1793 
1794 // binary bitwise functions
1795 
1796 #define DEFN_BIN_FNC_T(fnc,op2,tp1,tp2) \
1797 inline \
1798 void \
1799 fnc ( sc_ufix_fast& c, const tp1& a, const tp2& b ) \
1800 { \
1801  a.observer_read(); \
1802  b.observer_read(); \
1803  int iwl_c = c.iwl(); \
1804  for( int i = iwl_c - c.wl(); i < iwl_c; ++ i ) \
1805  c.set_bit( i, a.get_bit( i ) op2 b.get_bit( i ) ); \
1806  c.cast(); \
1807  SC_FXNUM_FAST_OBSERVER_WRITE_( c ) \
1808 }
1809 
1810 DEFN_BIN_FNC_T(b_and,&&,sc_ufix_fast,sc_ufix_fast)
1811 DEFN_BIN_FNC_T(b_or,||,sc_ufix_fast,sc_ufix_fast)
1812 DEFN_BIN_FNC_T(b_xor,!=,sc_ufix_fast,sc_ufix_fast)
1813 
1814 #undef DEFN_BIN_FNC_T
1815 
1816 
1817 // assignment operators
1818 
1819 inline
1820 sc_ufix_fast&
1821 sc_ufix_fast::operator = ( const sc_ufix_fast& a )
1822 {
1823  sc_fxnum_fast::operator = ( a );
1824  return *this;
1825 }
1826 
1827 #define DEFN_ASN_OP_T(op,tp) \
1828 inline \
1829 sc_ufix_fast& \
1830 sc_ufix_fast::operator op ( tp a ) \
1831 { \
1832  sc_fxnum_fast::operator op( a ); \
1833  return *this; \
1834 }
1835 
1836 #ifndef SC_FX_EXCLUDE_OTHER
1837 #define DEFN_ASN_OP_OTHER(op) \
1838 DEFN_ASN_OP_T(op,int64) \
1839 DEFN_ASN_OP_T(op,uint64) \
1840 DEFN_ASN_OP_T(op,const sc_int_base&) \
1841 DEFN_ASN_OP_T(op,const sc_uint_base&) \
1842 DEFN_ASN_OP_T(op,const sc_signed&) \
1843 DEFN_ASN_OP_T(op,const sc_unsigned&)
1844 #else
1845 #define DEFN_ASN_OP_OTHER(op)
1846 #endif
1847 
1848 #define DEFN_ASN_OP(op) \
1849 DEFN_ASN_OP_T(op,int) \
1850 DEFN_ASN_OP_T(op,unsigned int) \
1851 DEFN_ASN_OP_T(op,long) \
1852 DEFN_ASN_OP_T(op,unsigned long) \
1853 DEFN_ASN_OP_T(op,float) \
1854 DEFN_ASN_OP_T(op,double) \
1855 DEFN_ASN_OP_T(op,const char*) \
1856 DEFN_ASN_OP_T(op,const sc_fxval&) \
1857 DEFN_ASN_OP_T(op,const sc_fxval_fast&) \
1858 DEFN_ASN_OP_T(op,const sc_fxnum&) \
1859 DEFN_ASN_OP_T(op,const sc_fxnum_fast&) \
1860 DEFN_ASN_OP_OTHER(op)
1861 
1862 DEFN_ASN_OP(=)
1863 
1864 DEFN_ASN_OP(*=)
1865 DEFN_ASN_OP(/=)
1866 DEFN_ASN_OP(+=)
1867 DEFN_ASN_OP(-=)
1868 
1869 DEFN_ASN_OP_T(<<=,int)
1870 DEFN_ASN_OP_T(>>=,int)
1871 
1872 #undef DEFN_ASN_OP_T
1873 #undef DEFN_ASN_OP_OTHER
1874 #undef DEFN_ASN_OP
1875 
1876 
1877 #define DEFN_ASN_OP_T(op,op2,tp) \
1878 inline \
1879 sc_ufix_fast& \
1880 sc_ufix_fast::operator op ( const tp& b ) \
1881 { \
1882  SC_FXNUM_FAST_OBSERVER_READ_( *this ) \
1883  b.observer_read(); \
1884  int iwl_c = iwl(); \
1885  for( int i = iwl_c - wl(); i < iwl_c; ++ i ) \
1886  set_bit( i, get_bit( i ) op2 b.get_bit( i ) ); \
1887  cast(); \
1888  SC_FXNUM_FAST_OBSERVER_WRITE_( *this ) \
1889  return *this; \
1890 }
1891 
1892 DEFN_ASN_OP_T(&=,&&,sc_ufix)
1893 DEFN_ASN_OP_T(&=,&&,sc_ufix_fast)
1894 DEFN_ASN_OP_T(|=,||,sc_ufix)
1895 DEFN_ASN_OP_T(|=,||,sc_ufix_fast)
1896 DEFN_ASN_OP_T(^=,!=,sc_ufix)
1897 DEFN_ASN_OP_T(^=,!=,sc_ufix_fast)
1898 
1899 #undef DEFN_ASN_OP_T
1900 
1901 
1902 // auto-increment and auto-decrement
1903 
1904 inline
1905 const sc_fxval_fast
1907 {
1908  return sc_fxval_fast( sc_fxnum_fast::operator ++ ( 0 ) );
1909 }
1910 
1911 inline
1912 const sc_fxval_fast
1914 {
1915  return sc_fxval_fast( sc_fxnum_fast::operator -- ( 0 ) );
1916 }
1917 
1918 inline
1919 sc_ufix_fast&
1921 {
1923  return *this;
1924 }
1925 
1926 inline
1927 sc_ufix_fast&
1929 {
1931  return *this;
1932 }
1933 
1934 } // namespace sc_dt
1935 
1936 
1937 #endif
1938 
1939 // Taf!
bool set_bit(int, bool)
Definition: sc_fxnum.h:3636
sc_ufix_fast & operator++()
Definition: sc_ufix.h:1920
sc_fxnum & operator++()
Definition: sc_fxnum.h:3290
friend void b_not(sc_ufix_fast &, const sc_ufix_fast &)
Definition: sc_ufix.h:1757
friend const sc_ufix_fast operator&(const sc_ufix_fast &, const sc_ufix_fast &)
#define DEFN_ASN_OP(op)
Definition: sc_ufix.h:1848
friend const sc_ufix operator&(const sc_ufix &, const sc_ufix &)
bool get_bit(int) const
sc_ufix(sc_fxnum_observer *=0)
Definition: sc_ufix.h:538
const sc_bit b_or(const sc_bit &a, const sc_bit &b)
Definition: sc_bit.h:347
#define SC_FXNUM_OBSERVER_READ_(object)
uint64_t uint64
Definition: sc_nbdefs.h:183
friend const sc_ufix operator|(const sc_ufix &, const sc_ufix &)
int iwl() const
Definition: sc_fxnum.h:4694
friend void b_or(sc_ufix_fast &, const sc_ufix_fast &, const sc_ufix_fast &)
#define DECL_CTORS_T_A(tp)
Definition: sc_ufix.h:392
#define DEFN_ASN_OP_T(op, tp)
Definition: sc_ufix.h:1877
sc_fxnum_fast & operator++()
Definition: sc_fxnum.h:4402
int64_t int64
Definition: sc_nbdefs.h:182
sc_o_mode
Definition: sc_fxdefs.h:116
sc_ufix & operator++()
Definition: sc_ufix.h:1222
#define SC_FXNUM_OBSERVER_WRITE_(object)
friend class sc_fxval
Definition: sc_fxnum.h:563
int wl() const
Definition: sc_fxnum.h:4687
friend const sc_ufix_fast operator^(const sc_ufix_fast &, const sc_ufix_fast &)
const sc_bit b_and(const sc_bit &a, const sc_bit &b)
Definition: sc_bit.h:344
friend void b_xor(sc_ufix_fast &, const sc_ufix_fast &, const sc_ufix_fast &)
const sc_ufix operator~() const
Definition: sc_ufix.h:1027
#define DECL_CTORS_T_B(tp)
Definition: sc_ufix.h:397
sc_ufix_fast(sc_fxnum_fast_observer *=0)
Definition: sc_ufix.h:1246
#define DEFN_CTORS_T_B(tp)
Definition: sc_ufix.h:1540
sc_ufix & operator=(const sc_ufix &)
Definition: sc_ufix.h:1123
friend void b_or(sc_ufix &, const sc_ufix &, const sc_ufix &)
const sc_bit b_xor(const sc_bit &a, const sc_bit &b)
Definition: sc_bit.h:350
int iwl() const
Definition: sc_fxnum.h:3571
#define DEFN_BIN_FNC_T(fnc, op2, tp1, tp2)
Definition: sc_ufix.h:1796
DEFN_BIN_OP_T(/, div, int64) DEFN_BIN_OP_T(/
sc_ufix & operator--()
Definition: sc_ufix.h:1230
const sc_bit b_not(const sc_bit &a)
Definition: sc_bit.h:316
#define DECL_ASN_OP(op)
Definition: sc_ufix.h:480
#define SC_FXNUM_FAST_OBSERVER_READ_(object)
#define SC_FXNUM_FAST_OBSERVER_WRITE_(object)
const sc_ufix_fast operator~() const
Definition: sc_ufix.h:1741
friend void b_and(sc_ufix_fast &, const sc_ufix_fast &, const sc_ufix_fast &)
friend void b_not(sc_ufix &, const sc_ufix &)
Definition: sc_ufix.h:1043
sc_q_mode
Definition: sc_fxdefs.h:87
friend class sc_fxval_fast
Definition: sc_fxnum.h:990
bool get_bit(int) const
Definition: sc_fxnum.h:3626
friend const sc_ufix_fast operator|(const sc_ufix_fast &, const sc_ufix_fast &)
sc_ufix_fast & operator=(const sc_ufix_fast &)
Definition: sc_ufix.h:1821
bool set_bit(int, bool)
#define DEFN_CTORS_T_A(tp)
Definition: sc_ufix.h:1378
sc_fxnum_fast & operator--()
Definition: sc_fxnum.h:4413
friend const sc_ufix operator^(const sc_ufix &, const sc_ufix &)
sc_fxnum & operator--()
Definition: sc_fxnum.h:3298
int wl() const
Definition: sc_fxnum.h:3564
friend void b_xor(sc_ufix &, const sc_ufix &, const sc_ufix &)
#define DECL_ASN_OP_T(op, tp)
Definition: sc_ufix.h:465
friend void b_and(sc_ufix &, const sc_ufix &, const sc_ufix &)
sc_ufix_fast & operator--()
Definition: sc_ufix.h:1928