00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 #ifndef SC_UFIX_H
00049 #define SC_UFIX_H
00050
00051
00052 #include "sysc/datatypes/fx/sc_fxnum.h"
00053
00054
00055 namespace sc_dt
00056 {
00057
00058
00059 class sc_ufix;
00060 class sc_ufix_fast;
00061
00062
00063
00064
00065
00066
00067
00068
00069 class sc_ufix : public sc_fxnum
00070 {
00071
00072 public:
00073
00074
00075
00076 explicit sc_ufix( sc_fxnum_observer* = 0 );
00077 sc_ufix( int, int,
00078 sc_fxnum_observer* = 0 );
00079 sc_ufix( sc_q_mode, sc_o_mode,
00080 sc_fxnum_observer* = 0 );
00081 sc_ufix( sc_q_mode, sc_o_mode, int,
00082 sc_fxnum_observer* = 0 );
00083 sc_ufix( int, int, sc_q_mode, sc_o_mode,
00084 sc_fxnum_observer* = 0 );
00085 sc_ufix( int, int, sc_q_mode, sc_o_mode, int,
00086 sc_fxnum_observer* = 0 );
00087 explicit sc_ufix( const sc_fxcast_switch&,
00088 sc_fxnum_observer* = 0 );
00089 sc_ufix( int, int,
00090 const sc_fxcast_switch&,
00091 sc_fxnum_observer* = 0 );
00092 sc_ufix( sc_q_mode, sc_o_mode,
00093 const sc_fxcast_switch&,
00094 sc_fxnum_observer* = 0 );
00095 sc_ufix( sc_q_mode, sc_o_mode, int,
00096 const sc_fxcast_switch&,
00097 sc_fxnum_observer* = 0 );
00098 sc_ufix( int, int, sc_q_mode, sc_o_mode,
00099 const sc_fxcast_switch&,
00100 sc_fxnum_observer* = 0 );
00101 sc_ufix( int, int, sc_q_mode, sc_o_mode, int,
00102 const sc_fxcast_switch&,
00103 sc_fxnum_observer* = 0 );
00104 explicit sc_ufix( const sc_fxtype_params&,
00105 sc_fxnum_observer* = 0 );
00106 sc_ufix( const sc_fxtype_params&,
00107 const sc_fxcast_switch&,
00108 sc_fxnum_observer* = 0 );
00109
00110 #define DECL_CTORS_T(tp) \
00111 sc_ufix( tp, \
00112 int, int, \
00113 sc_fxnum_observer* = 0 ); \
00114 sc_ufix( tp, \
00115 sc_q_mode, sc_o_mode, \
00116 sc_fxnum_observer* = 0 ); \
00117 sc_ufix( tp, \
00118 sc_q_mode, sc_o_mode, int, \
00119 sc_fxnum_observer* = 0 ); \
00120 sc_ufix( tp, \
00121 int, int, sc_q_mode, sc_o_mode, \
00122 sc_fxnum_observer* = 0 ); \
00123 sc_ufix( tp, \
00124 int, int, sc_q_mode, sc_o_mode, int, \
00125 sc_fxnum_observer* = 0 ); \
00126 sc_ufix( tp, \
00127 const sc_fxcast_switch&, \
00128 sc_fxnum_observer* = 0 ); \
00129 sc_ufix( tp, \
00130 int, int, \
00131 const sc_fxcast_switch&, \
00132 sc_fxnum_observer* = 0 ); \
00133 sc_ufix( tp, \
00134 sc_q_mode, sc_o_mode, \
00135 const sc_fxcast_switch&, \
00136 sc_fxnum_observer* = 0 ); \
00137 sc_ufix( tp, \
00138 sc_q_mode, sc_o_mode, int, \
00139 const sc_fxcast_switch&, \
00140 sc_fxnum_observer* = 0 ); \
00141 sc_ufix( tp, \
00142 int, int, sc_q_mode, sc_o_mode, \
00143 const sc_fxcast_switch&, \
00144 sc_fxnum_observer* = 0 ); \
00145 sc_ufix( tp, \
00146 int, int, sc_q_mode, sc_o_mode, int, \
00147 const sc_fxcast_switch&, \
00148 sc_fxnum_observer* = 0 ); \
00149 sc_ufix( tp, \
00150 const sc_fxtype_params&, \
00151 sc_fxnum_observer* = 0 ); \
00152 sc_ufix( tp, \
00153 const sc_fxtype_params&, \
00154 const sc_fxcast_switch&, \
00155 sc_fxnum_observer* = 0 );
00156
00157 #define DECL_CTORS_T_A(tp) \
00158 sc_ufix( tp, \
00159 sc_fxnum_observer* = 0 ); \
00160 DECL_CTORS_T(tp)
00161
00162 #define DECL_CTORS_T_B(tp) \
00163 explicit sc_ufix( tp, \
00164 sc_fxnum_observer* = 0 ); \
00165 DECL_CTORS_T(tp)
00166
00167 DECL_CTORS_T_A(int)
00168 DECL_CTORS_T_A(unsigned int)
00169 DECL_CTORS_T_A(long)
00170 DECL_CTORS_T_A(unsigned long)
00171 DECL_CTORS_T_A(float)
00172 DECL_CTORS_T_A(double)
00173 DECL_CTORS_T_A(const char*)
00174 DECL_CTORS_T_A(const sc_fxval&)
00175 DECL_CTORS_T_A(const sc_fxval_fast&)
00176 DECL_CTORS_T_A(const sc_fxnum&)
00177 DECL_CTORS_T_A(const sc_fxnum_fast&)
00178 #ifndef SC_FX_EXCLUDE_OTHER
00179 DECL_CTORS_T_B(int64)
00180 DECL_CTORS_T_B(uint64)
00181 DECL_CTORS_T_B(const sc_int_base&)
00182 DECL_CTORS_T_B(const sc_uint_base&)
00183 DECL_CTORS_T_B(const sc_signed&)
00184 DECL_CTORS_T_B(const sc_unsigned&)
00185 #endif
00186
00187 #undef DECL_CTORS_T
00188 #undef DECL_CTORS_T_A
00189 #undef DECL_CTORS_T_B
00190
00191
00192
00193 sc_ufix( const sc_ufix& );
00194
00195
00196
00197
00198 const sc_ufix operator ~ () const;
00199
00200
00201
00202
00203 friend void b_not( sc_ufix&, const sc_ufix& );
00204
00205
00206
00207
00208 friend const sc_ufix operator & ( const sc_ufix&, const sc_ufix& );
00209 friend const sc_ufix operator & ( const sc_ufix&, const sc_ufix_fast& );
00210 friend const sc_ufix operator & ( const sc_ufix_fast&, const sc_ufix& );
00211 friend const sc_ufix operator | ( const sc_ufix&, const sc_ufix& );
00212 friend const sc_ufix operator | ( const sc_ufix&, const sc_ufix_fast& );
00213 friend const sc_ufix operator | ( const sc_ufix_fast&, const sc_ufix& );
00214 friend const sc_ufix operator ^ ( const sc_ufix&, const sc_ufix& );
00215 friend const sc_ufix operator ^ ( const sc_ufix&, const sc_ufix_fast& );
00216 friend const sc_ufix operator ^ ( const sc_ufix_fast&, const sc_ufix& );
00217
00218
00219
00220
00221 friend void b_and( sc_ufix&, const sc_ufix&, const sc_ufix& );
00222 friend void b_and( sc_ufix&, const sc_ufix&, const sc_ufix_fast& );
00223 friend void b_and( sc_ufix&, const sc_ufix_fast&, const sc_ufix& );
00224 friend void b_or ( sc_ufix&, const sc_ufix&, const sc_ufix& );
00225 friend void b_or ( sc_ufix&, const sc_ufix&, const sc_ufix_fast& );
00226 friend void b_or ( sc_ufix&, const sc_ufix_fast&, const sc_ufix& );
00227 friend void b_xor( sc_ufix&, const sc_ufix&, const sc_ufix& );
00228 friend void b_xor( sc_ufix&, const sc_ufix&, const sc_ufix_fast& );
00229 friend void b_xor( sc_ufix&, const sc_ufix_fast&, const sc_ufix& );
00230
00231
00232
00233
00234 sc_ufix& operator = ( const sc_ufix& );
00235
00236 #define DECL_ASN_OP_T(op,tp) \
00237 sc_ufix& operator op ( tp );
00238
00239 #ifndef SC_FX_EXCLUDE_OTHER
00240 #define DECL_ASN_OP_OTHER(op) \
00241 DECL_ASN_OP_T(op,int64) \
00242 DECL_ASN_OP_T(op,uint64) \
00243 DECL_ASN_OP_T(op,const sc_int_base&) \
00244 DECL_ASN_OP_T(op,const sc_uint_base&) \
00245 DECL_ASN_OP_T(op,const sc_signed&) \
00246 DECL_ASN_OP_T(op,const sc_unsigned&)
00247 #else
00248 #define DECL_ASN_OP_OTHER(op)
00249 #endif
00250
00251 #define DECL_ASN_OP(op) \
00252 DECL_ASN_OP_T(op,int) \
00253 DECL_ASN_OP_T(op,unsigned int) \
00254 DECL_ASN_OP_T(op,long) \
00255 DECL_ASN_OP_T(op,unsigned long) \
00256 DECL_ASN_OP_T(op,float) \
00257 DECL_ASN_OP_T(op,double) \
00258 DECL_ASN_OP_T(op,const char*) \
00259 DECL_ASN_OP_T(op,const sc_fxval&) \
00260 DECL_ASN_OP_T(op,const sc_fxval_fast&) \
00261 DECL_ASN_OP_T(op,const sc_fxnum&) \
00262 DECL_ASN_OP_T(op,const sc_fxnum_fast&) \
00263 DECL_ASN_OP_OTHER(op)
00264
00265 DECL_ASN_OP(=)
00266
00267 DECL_ASN_OP(*=)
00268 DECL_ASN_OP(/=)
00269 DECL_ASN_OP(+=)
00270 DECL_ASN_OP(-=)
00271
00272 DECL_ASN_OP_T(<<=,int)
00273 DECL_ASN_OP_T(>>=,int)
00274
00275 DECL_ASN_OP_T(&=,const sc_ufix&)
00276 DECL_ASN_OP_T(&=,const sc_ufix_fast&)
00277 DECL_ASN_OP_T(|=,const sc_ufix&)
00278 DECL_ASN_OP_T(|=,const sc_ufix_fast&)
00279 DECL_ASN_OP_T(^=,const sc_ufix&)
00280 DECL_ASN_OP_T(^=,const sc_ufix_fast&)
00281
00282 #undef DECL_ASN_OP_T
00283 #undef DECL_ASN_OP_OTHER
00284 #undef DECL_ASN_OP
00285
00286
00287
00288
00289 const sc_fxval operator ++ ( int );
00290 const sc_fxval operator -- ( int );
00291
00292 sc_ufix& operator ++ ();
00293 sc_ufix& operator -- ();
00294
00295 };
00296
00297
00298
00299
00300
00301
00302
00303
00304 class sc_ufix_fast : public sc_fxnum_fast
00305 {
00306
00307 public:
00308
00309
00310
00311 explicit sc_ufix_fast( sc_fxnum_fast_observer* = 0 );
00312 sc_ufix_fast( int, int,
00313 sc_fxnum_fast_observer* = 0 );
00314 sc_ufix_fast( sc_q_mode, sc_o_mode,
00315 sc_fxnum_fast_observer* = 0 );
00316 sc_ufix_fast( sc_q_mode, sc_o_mode, int,
00317 sc_fxnum_fast_observer* = 0 );
00318 sc_ufix_fast( int, int, sc_q_mode, sc_o_mode,
00319 sc_fxnum_fast_observer* = 0 );
00320 sc_ufix_fast( int, int, sc_q_mode, sc_o_mode, int,
00321 sc_fxnum_fast_observer* = 0 );
00322 explicit sc_ufix_fast( const sc_fxcast_switch&,
00323 sc_fxnum_fast_observer* = 0 );
00324 sc_ufix_fast( int, int,
00325 const sc_fxcast_switch&,
00326 sc_fxnum_fast_observer* = 0 );
00327 sc_ufix_fast( sc_q_mode, sc_o_mode,
00328 const sc_fxcast_switch&,
00329 sc_fxnum_fast_observer* = 0 );
00330 sc_ufix_fast( sc_q_mode, sc_o_mode, int,
00331 const sc_fxcast_switch&,
00332 sc_fxnum_fast_observer* = 0 );
00333 sc_ufix_fast( int, int, sc_q_mode, sc_o_mode,
00334 const sc_fxcast_switch&,
00335 sc_fxnum_fast_observer* = 0 );
00336 sc_ufix_fast( int, int, sc_q_mode, sc_o_mode, int,
00337 const sc_fxcast_switch&,
00338 sc_fxnum_fast_observer* = 0 );
00339 explicit sc_ufix_fast( const sc_fxtype_params&,
00340 sc_fxnum_fast_observer* = 0 );
00341 sc_ufix_fast( const sc_fxtype_params&,
00342 const sc_fxcast_switch&,
00343 sc_fxnum_fast_observer* = 0 );
00344
00345 #define DECL_CTORS_T(tp) \
00346 sc_ufix_fast( tp, \
00347 int, int, \
00348 sc_fxnum_fast_observer* = 0 ); \
00349 sc_ufix_fast( tp, \
00350 sc_q_mode, sc_o_mode, \
00351 sc_fxnum_fast_observer* = 0 ); \
00352 sc_ufix_fast( tp, \
00353 sc_q_mode, sc_o_mode, int, \
00354 sc_fxnum_fast_observer* = 0 ); \
00355 sc_ufix_fast( tp, \
00356 int, int, sc_q_mode, sc_o_mode, \
00357 sc_fxnum_fast_observer* = 0 ); \
00358 sc_ufix_fast( tp, \
00359 int, int, sc_q_mode, sc_o_mode, int, \
00360 sc_fxnum_fast_observer* = 0 ); \
00361 sc_ufix_fast( tp, \
00362 const sc_fxcast_switch&, \
00363 sc_fxnum_fast_observer* = 0 ); \
00364 sc_ufix_fast( tp, \
00365 int, int, \
00366 const sc_fxcast_switch&, \
00367 sc_fxnum_fast_observer* = 0 ); \
00368 sc_ufix_fast( tp, \
00369 sc_q_mode, sc_o_mode, \
00370 const sc_fxcast_switch&, \
00371 sc_fxnum_fast_observer* = 0 ); \
00372 sc_ufix_fast( tp, \
00373 sc_q_mode, sc_o_mode, int, \
00374 const sc_fxcast_switch&, \
00375 sc_fxnum_fast_observer* = 0 ); \
00376 sc_ufix_fast( tp, \
00377 int, int, sc_q_mode, sc_o_mode, \
00378 const sc_fxcast_switch&, \
00379 sc_fxnum_fast_observer* = 0 ); \
00380 sc_ufix_fast( tp, \
00381 int, int, sc_q_mode, sc_o_mode, int, \
00382 const sc_fxcast_switch&, \
00383 sc_fxnum_fast_observer* = 0 ); \
00384 sc_ufix_fast( tp, \
00385 const sc_fxtype_params&, \
00386 sc_fxnum_fast_observer* = 0 ); \
00387 sc_ufix_fast( tp, \
00388 const sc_fxtype_params&, \
00389 const sc_fxcast_switch&, \
00390 sc_fxnum_fast_observer* = 0 );
00391
00392 #define DECL_CTORS_T_A(tp) \
00393 sc_ufix_fast( tp, \
00394 sc_fxnum_fast_observer* = 0 ); \
00395 DECL_CTORS_T(tp)
00396
00397 #define DECL_CTORS_T_B(tp) \
00398 explicit sc_ufix_fast( tp, \
00399 sc_fxnum_fast_observer* = 0 ); \
00400 DECL_CTORS_T(tp)
00401
00402 DECL_CTORS_T_A(int)
00403 DECL_CTORS_T_A(unsigned int)
00404 DECL_CTORS_T_A(long)
00405 DECL_CTORS_T_A(unsigned long)
00406 DECL_CTORS_T_A(float)
00407 DECL_CTORS_T_A(double)
00408 DECL_CTORS_T_A(const char*)
00409 DECL_CTORS_T_A(const sc_fxval&)
00410 DECL_CTORS_T_A(const sc_fxval_fast&)
00411 DECL_CTORS_T_A(const sc_fxnum&)
00412 DECL_CTORS_T_A(const sc_fxnum_fast&)
00413 #ifndef SC_FX_EXCLUDE_OTHER
00414 DECL_CTORS_T_B(int64)
00415 DECL_CTORS_T_B(uint64)
00416 DECL_CTORS_T_B(const sc_int_base&)
00417 DECL_CTORS_T_B(const sc_uint_base&)
00418 DECL_CTORS_T_B(const sc_signed&)
00419 DECL_CTORS_T_B(const sc_unsigned&)
00420 #endif
00421
00422 #undef DECL_CTORS_T
00423 #undef DECL_CTORS_T_A
00424 #undef DECL_CTORS_T_B
00425
00426
00427
00428 sc_ufix_fast( const sc_ufix_fast& );
00429
00430
00431
00432
00433 const sc_ufix_fast operator ~ () const;
00434
00435
00436
00437
00438 friend void b_not( sc_ufix_fast&, const sc_ufix_fast& );
00439
00440
00441
00442
00443 friend const sc_ufix_fast operator & ( const sc_ufix_fast&,
00444 const sc_ufix_fast& );
00445 friend const sc_ufix_fast operator ^ ( const sc_ufix_fast&,
00446 const sc_ufix_fast& );
00447 friend const sc_ufix_fast operator | ( const sc_ufix_fast&,
00448 const sc_ufix_fast& );
00449
00450
00451
00452
00453 friend void b_and( sc_ufix_fast&, const sc_ufix_fast&,
00454 const sc_ufix_fast& );
00455 friend void b_or ( sc_ufix_fast&, const sc_ufix_fast&,
00456 const sc_ufix_fast& );
00457 friend void b_xor( sc_ufix_fast&, const sc_ufix_fast&,
00458 const sc_ufix_fast& );
00459
00460
00461
00462
00463 sc_ufix_fast& operator = ( const sc_ufix_fast& );
00464
00465 #define DECL_ASN_OP_T(op,tp) \
00466 sc_ufix_fast& operator op ( tp );
00467
00468 #ifndef SC_FX_EXCLUDE_OTHER
00469 #define DECL_ASN_OP_OTHER(op) \
00470 DECL_ASN_OP_T(op,int64) \
00471 DECL_ASN_OP_T(op,uint64) \
00472 DECL_ASN_OP_T(op,const sc_int_base&) \
00473 DECL_ASN_OP_T(op,const sc_uint_base&) \
00474 DECL_ASN_OP_T(op,const sc_signed&) \
00475 DECL_ASN_OP_T(op,const sc_unsigned&)
00476 #else
00477 #define DECL_ASN_OP_OTHER(op)
00478 #endif
00479
00480 #define DECL_ASN_OP(op) \
00481 DECL_ASN_OP_T(op,int) \
00482 DECL_ASN_OP_T(op,unsigned int) \
00483 DECL_ASN_OP_T(op,long) \
00484 DECL_ASN_OP_T(op,unsigned long) \
00485 DECL_ASN_OP_T(op,float) \
00486 DECL_ASN_OP_T(op,double) \
00487 DECL_ASN_OP_T(op,const char*) \
00488 DECL_ASN_OP_T(op,const sc_fxval&) \
00489 DECL_ASN_OP_T(op,const sc_fxval_fast&) \
00490 DECL_ASN_OP_T(op,const sc_fxnum&) \
00491 DECL_ASN_OP_T(op,const sc_fxnum_fast&) \
00492 DECL_ASN_OP_OTHER(op)
00493
00494 DECL_ASN_OP(=)
00495
00496 DECL_ASN_OP(*=)
00497 DECL_ASN_OP(/=)
00498 DECL_ASN_OP(+=)
00499 DECL_ASN_OP(-=)
00500
00501 DECL_ASN_OP_T(<<=,int)
00502 DECL_ASN_OP_T(>>=,int)
00503
00504 DECL_ASN_OP_T(&=,const sc_ufix&)
00505 DECL_ASN_OP_T(&=,const sc_ufix_fast&)
00506 DECL_ASN_OP_T(|=,const sc_ufix&)
00507 DECL_ASN_OP_T(|=,const sc_ufix_fast&)
00508 DECL_ASN_OP_T(^=,const sc_ufix&)
00509 DECL_ASN_OP_T(^=,const sc_ufix_fast&)
00510
00511 #undef DECL_ASN_OP_T
00512 #undef DECL_ASN_OP_OTHER
00513 #undef DECL_ASN_OP
00514
00515
00516
00517
00518 const sc_fxval_fast operator ++ ( int );
00519 const sc_fxval_fast operator -- ( int );
00520
00521 sc_ufix_fast& operator ++ ();
00522 sc_ufix_fast& operator -- ();
00523
00524 };
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537 inline
00538 sc_ufix::sc_ufix( sc_fxnum_observer* observer_ )
00539 : sc_fxnum( sc_fxtype_params(),
00540 SC_US_,
00541 sc_fxcast_switch(),
00542 observer_ )
00543 {}
00544
00545 inline
00546 sc_ufix::sc_ufix( int wl_, int iwl_,
00547 sc_fxnum_observer* observer_ )
00548 : sc_fxnum( sc_fxtype_params( wl_, iwl_ ),
00549 SC_US_,
00550 sc_fxcast_switch(),
00551 observer_ )
00552 {}
00553
00554 inline
00555 sc_ufix::sc_ufix( sc_q_mode qm, sc_o_mode om,
00556 sc_fxnum_observer* observer_ )
00557 : sc_fxnum( sc_fxtype_params( qm, om ),
00558 SC_US_,
00559 sc_fxcast_switch(),
00560 observer_ )
00561 {}
00562
00563 inline
00564 sc_ufix::sc_ufix( sc_q_mode qm, sc_o_mode om, int nb,
00565 sc_fxnum_observer* observer_ )
00566 : sc_fxnum( sc_fxtype_params( qm, om, nb ),
00567 SC_US_,
00568 sc_fxcast_switch(),
00569 observer_ )
00570 {}
00571
00572 inline
00573 sc_ufix::sc_ufix( int wl_, int iwl_, sc_q_mode qm, sc_o_mode om,
00574 sc_fxnum_observer* observer_ )
00575 : sc_fxnum( sc_fxtype_params( wl_, iwl_, qm, om ),
00576 SC_US_,
00577 sc_fxcast_switch(),
00578 observer_ )
00579 {}
00580
00581 inline
00582 sc_ufix::sc_ufix( int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb,
00583 sc_fxnum_observer* observer_ )
00584 : sc_fxnum( sc_fxtype_params( wl_, iwl_, qm, om, nb ),
00585 SC_US_,
00586 sc_fxcast_switch(),
00587 observer_ )
00588 {}
00589
00590 inline
00591 sc_ufix::sc_ufix( const sc_fxcast_switch& cast_sw,
00592 sc_fxnum_observer* observer_ )
00593 : sc_fxnum( sc_fxtype_params(),
00594 SC_US_,
00595 cast_sw,
00596 observer_ )
00597 {}
00598
00599 inline
00600 sc_ufix::sc_ufix( int wl_, int iwl_,
00601 const sc_fxcast_switch& cast_sw,
00602 sc_fxnum_observer* observer_ )
00603 : sc_fxnum( sc_fxtype_params( wl_, iwl_ ),
00604 SC_US_,
00605 cast_sw,
00606 observer_ )
00607 {}
00608
00609 inline
00610 sc_ufix::sc_ufix( sc_q_mode qm, sc_o_mode om,
00611 const sc_fxcast_switch& cast_sw,
00612 sc_fxnum_observer* observer_ )
00613 : sc_fxnum( sc_fxtype_params( qm, om ),
00614 SC_US_,
00615 cast_sw,
00616 observer_ )
00617 {}
00618
00619 inline
00620 sc_ufix::sc_ufix( sc_q_mode qm, sc_o_mode om, int nb,
00621 const sc_fxcast_switch& cast_sw,
00622 sc_fxnum_observer* observer_ )
00623 : sc_fxnum( sc_fxtype_params( qm, om, nb ),
00624 SC_US_,
00625 cast_sw,
00626 observer_ )
00627 {}
00628
00629 inline
00630 sc_ufix::sc_ufix( int wl_, int iwl_, sc_q_mode qm, sc_o_mode om,
00631 const sc_fxcast_switch& cast_sw,
00632 sc_fxnum_observer* observer_ )
00633 : sc_fxnum( sc_fxtype_params( wl_, iwl_, qm, om ),
00634 SC_US_,
00635 cast_sw,
00636 observer_ )
00637 {}
00638
00639 inline
00640 sc_ufix::sc_ufix( int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb,
00641 const sc_fxcast_switch& cast_sw,
00642 sc_fxnum_observer* observer_ )
00643 : sc_fxnum( sc_fxtype_params( wl_, iwl_, qm, om, nb ),
00644 SC_US_,
00645 cast_sw,
00646 observer_ )
00647 {}
00648
00649 inline
00650 sc_ufix::sc_ufix( const sc_fxtype_params& type_params,
00651 sc_fxnum_observer* observer_ )
00652 : sc_fxnum( type_params,
00653 SC_US_,
00654 sc_fxcast_switch(),
00655 observer_ )
00656 {}
00657
00658 inline
00659 sc_ufix::sc_ufix( const sc_fxtype_params& type_params,
00660 const sc_fxcast_switch& cast_sw,
00661 sc_fxnum_observer* observer_ )
00662 : sc_fxnum( type_params,
00663 SC_US_,
00664 cast_sw,
00665 observer_ )
00666 {}
00667
00668 #define DEFN_CTORS_T_A(tp) \
00669 inline \
00670 sc_ufix::sc_ufix( tp a, \
00671 sc_fxnum_observer* observer_ ) \
00672 : sc_fxnum( a, \
00673 sc_fxtype_params(), \
00674 SC_US_, \
00675 sc_fxcast_switch(), \
00676 observer_ ) \
00677 {} \
00678 \
00679 inline \
00680 sc_ufix::sc_ufix( tp a, \
00681 int wl_, int iwl_, \
00682 sc_fxnum_observer* observer_ ) \
00683 : sc_fxnum( a, \
00684 sc_fxtype_params( wl_, iwl_ ), \
00685 SC_US_, \
00686 sc_fxcast_switch(), \
00687 observer_ ) \
00688 {} \
00689 \
00690 inline \
00691 sc_ufix::sc_ufix( tp a, \
00692 sc_q_mode qm, sc_o_mode om, \
00693 sc_fxnum_observer* observer_ ) \
00694 : sc_fxnum( a, \
00695 sc_fxtype_params( qm, om ), \
00696 SC_US_, \
00697 sc_fxcast_switch(), \
00698 observer_ ) \
00699 {} \
00700 \
00701 inline \
00702 sc_ufix::sc_ufix( tp a, \
00703 sc_q_mode qm, sc_o_mode om, int nb, \
00704 sc_fxnum_observer* observer_ ) \
00705 : sc_fxnum( a, \
00706 sc_fxtype_params( qm, om, nb ), \
00707 SC_US_, \
00708 sc_fxcast_switch(), \
00709 observer_ ) \
00710 {} \
00711 \
00712 inline \
00713 sc_ufix::sc_ufix( tp a, \
00714 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
00715 sc_fxnum_observer* observer_ ) \
00716 : sc_fxnum( a, \
00717 sc_fxtype_params( wl_, iwl_, qm, om ), \
00718 SC_US_, \
00719 sc_fxcast_switch(), \
00720 observer_ ) \
00721 {} \
00722 \
00723 inline \
00724 sc_ufix::sc_ufix( tp a, \
00725 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb, \
00726 sc_fxnum_observer* observer_ ) \
00727 : sc_fxnum( a, \
00728 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
00729 SC_US_, \
00730 sc_fxcast_switch(), \
00731 observer_ ) \
00732 {} \
00733 \
00734 inline \
00735 sc_ufix::sc_ufix( tp a, \
00736 const sc_fxcast_switch& cast_sw, \
00737 sc_fxnum_observer* observer_ ) \
00738 : sc_fxnum( a, \
00739 sc_fxtype_params(), \
00740 SC_US_, \
00741 cast_sw, \
00742 observer_ ) \
00743 {} \
00744 \
00745 inline \
00746 sc_ufix::sc_ufix( tp a, \
00747 int wl_, int iwl_, \
00748 const sc_fxcast_switch& cast_sw, \
00749 sc_fxnum_observer* observer_ ) \
00750 : sc_fxnum( a, \
00751 sc_fxtype_params( wl_, iwl_ ), \
00752 SC_US_, \
00753 cast_sw, \
00754 observer_ ) \
00755 {} \
00756 \
00757 inline \
00758 sc_ufix::sc_ufix( tp a, \
00759 sc_q_mode qm, sc_o_mode om, \
00760 const sc_fxcast_switch& cast_sw, \
00761 sc_fxnum_observer* observer_ ) \
00762 : sc_fxnum( a, \
00763 sc_fxtype_params( qm, om ), \
00764 SC_US_, \
00765 cast_sw, \
00766 observer_ ) \
00767 {} \
00768 \
00769 inline \
00770 sc_ufix::sc_ufix( tp a, \
00771 sc_q_mode qm, sc_o_mode om, int nb, \
00772 const sc_fxcast_switch& cast_sw, \
00773 sc_fxnum_observer* observer_ ) \
00774 : sc_fxnum( a, \
00775 sc_fxtype_params( qm, om, nb ), \
00776 SC_US_, \
00777 cast_sw, \
00778 observer_ ) \
00779 {} \
00780 \
00781 inline \
00782 sc_ufix::sc_ufix( tp a, \
00783 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
00784 const sc_fxcast_switch& cast_sw, \
00785 sc_fxnum_observer* observer_ ) \
00786 : sc_fxnum( a, \
00787 sc_fxtype_params( wl_, iwl_, qm, om ), \
00788 SC_US_, \
00789 cast_sw, \
00790 observer_ ) \
00791 {} \
00792 \
00793 inline \
00794 sc_ufix::sc_ufix( tp a, \
00795 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb, \
00796 const sc_fxcast_switch& cast_sw, \
00797 sc_fxnum_observer* observer_ ) \
00798 : sc_fxnum( a, \
00799 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
00800 SC_US_, \
00801 cast_sw, \
00802 observer_ ) \
00803 {} \
00804 \
00805 inline \
00806 sc_ufix::sc_ufix( tp a, \
00807 const sc_fxtype_params& type_params, \
00808 sc_fxnum_observer* observer_ ) \
00809 : sc_fxnum( a, \
00810 type_params, \
00811 SC_US_, \
00812 sc_fxcast_switch(), \
00813 observer_ ) \
00814 {} \
00815 \
00816 inline \
00817 sc_ufix::sc_ufix( tp a, \
00818 const sc_fxtype_params& type_params, \
00819 const sc_fxcast_switch& cast_sw, \
00820 sc_fxnum_observer* observer_ ) \
00821 : sc_fxnum( a, \
00822 type_params, \
00823 SC_US_, \
00824 cast_sw, \
00825 observer_ ) \
00826 {}
00827
00828 #define DEFN_CTORS_T_B(tp) \
00829 inline \
00830 sc_ufix::sc_ufix( tp a, \
00831 sc_fxnum_observer* observer_ ) \
00832 : sc_fxnum( a, \
00833 a.type_params(), \
00834 SC_US_, \
00835 sc_fxcast_switch(), \
00836 observer_ ) \
00837 {} \
00838 \
00839 inline \
00840 sc_ufix::sc_ufix( tp a, \
00841 int wl_, int iwl_, \
00842 sc_fxnum_observer* observer_ ) \
00843 : sc_fxnum( a, \
00844 sc_fxtype_params( a.type_params(), wl_, iwl_ ), \
00845 SC_US_, \
00846 sc_fxcast_switch(), \
00847 observer_ ) \
00848 {} \
00849 \
00850 inline \
00851 sc_ufix::sc_ufix( tp a, \
00852 sc_q_mode qm, sc_o_mode om, \
00853 sc_fxnum_observer* observer_ ) \
00854 : sc_fxnum( a, \
00855 sc_fxtype_params( a.type_params(), qm, om ), \
00856 SC_US_, \
00857 sc_fxcast_switch(), \
00858 observer_ ) \
00859 {} \
00860 \
00861 inline \
00862 sc_ufix::sc_ufix( tp a, \
00863 sc_q_mode qm, sc_o_mode om, int nb, \
00864 sc_fxnum_observer* observer_ ) \
00865 : sc_fxnum( a, \
00866 sc_fxtype_params( a.type_params(), qm, om, nb ), \
00867 SC_US_, \
00868 sc_fxcast_switch(), \
00869 observer_ ) \
00870 {} \
00871 \
00872 inline \
00873 sc_ufix::sc_ufix( tp a, \
00874 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
00875 sc_fxnum_observer* observer_ ) \
00876 : sc_fxnum( a, \
00877 sc_fxtype_params( wl_, iwl_, qm, om ), \
00878 SC_US_, \
00879 sc_fxcast_switch(), \
00880 observer_ ) \
00881 {} \
00882 \
00883 inline \
00884 sc_ufix::sc_ufix( tp a, \
00885 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb, \
00886 sc_fxnum_observer* observer_ ) \
00887 : sc_fxnum( a, \
00888 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
00889 SC_US_, \
00890 sc_fxcast_switch(), \
00891 observer_ ) \
00892 {} \
00893 \
00894 inline \
00895 sc_ufix::sc_ufix( tp a, \
00896 const sc_fxcast_switch& cast_sw, \
00897 sc_fxnum_observer* observer_ ) \
00898 : sc_fxnum( a, \
00899 a.type_params(), \
00900 SC_US_, \
00901 cast_sw, \
00902 observer_ ) \
00903 {} \
00904 \
00905 inline \
00906 sc_ufix::sc_ufix( tp a, \
00907 int wl_, int iwl_, \
00908 const sc_fxcast_switch& cast_sw, \
00909 sc_fxnum_observer* observer_ ) \
00910 : sc_fxnum( a, \
00911 sc_fxtype_params( a.type_params(), wl_, iwl_ ), \
00912 SC_US_, \
00913 cast_sw, \
00914 observer_ ) \
00915 {} \
00916 \
00917 inline \
00918 sc_ufix::sc_ufix( tp a, \
00919 sc_q_mode qm, sc_o_mode om, \
00920 const sc_fxcast_switch& cast_sw, \
00921 sc_fxnum_observer* observer_ ) \
00922 : sc_fxnum( a, \
00923 sc_fxtype_params( a.type_params(), qm, om ), \
00924 SC_US_, \
00925 cast_sw, \
00926 observer_ ) \
00927 {} \
00928 \
00929 inline \
00930 sc_ufix::sc_ufix( tp a, \
00931 sc_q_mode qm, sc_o_mode om, int nb, \
00932 const sc_fxcast_switch& cast_sw, \
00933 sc_fxnum_observer* observer_ ) \
00934 : sc_fxnum( a, \
00935 sc_fxtype_params( a.type_params(), qm, om, nb ), \
00936 SC_US_, \
00937 cast_sw, \
00938 observer_ ) \
00939 {} \
00940 \
00941 inline \
00942 sc_ufix::sc_ufix( tp a, \
00943 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
00944 const sc_fxcast_switch& cast_sw, \
00945 sc_fxnum_observer* observer_ ) \
00946 : sc_fxnum( a, \
00947 sc_fxtype_params( wl_, iwl_, qm, om ), \
00948 SC_US_, \
00949 cast_sw, \
00950 observer_ ) \
00951 {} \
00952 \
00953 inline \
00954 sc_ufix::sc_ufix( tp a, \
00955 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb, \
00956 const sc_fxcast_switch& cast_sw, \
00957 sc_fxnum_observer* observer_ ) \
00958 : sc_fxnum( a, \
00959 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
00960 SC_US_, \
00961 cast_sw, \
00962 observer_ ) \
00963 {} \
00964 \
00965 inline \
00966 sc_ufix::sc_ufix( tp a, \
00967 const sc_fxtype_params& type_params, \
00968 sc_fxnum_observer* observer_ ) \
00969 : sc_fxnum( a, \
00970 type_params, \
00971 SC_US_, \
00972 sc_fxcast_switch(), \
00973 observer_ ) \
00974 {} \
00975 \
00976 inline \
00977 sc_ufix::sc_ufix( tp a, \
00978 const sc_fxtype_params& type_params, \
00979 const sc_fxcast_switch& cast_sw, \
00980 sc_fxnum_observer* observer_ ) \
00981 : sc_fxnum( a, \
00982 type_params, \
00983 SC_US_, \
00984 cast_sw, \
00985 observer_ ) \
00986 {}
00987
00988 DEFN_CTORS_T_A(int)
00989 DEFN_CTORS_T_A(unsigned int)
00990 DEFN_CTORS_T_A(long)
00991 DEFN_CTORS_T_A(unsigned long)
00992 DEFN_CTORS_T_A(float)
00993 DEFN_CTORS_T_A(double)
00994 DEFN_CTORS_T_A(const char*)
00995 DEFN_CTORS_T_A(const sc_fxval&)
00996 DEFN_CTORS_T_A(const sc_fxval_fast&)
00997 DEFN_CTORS_T_B(const sc_fxnum&)
00998 DEFN_CTORS_T_B(const sc_fxnum_fast&)
00999 #ifndef SC_FX_EXCLUDE_OTHER
01000 DEFN_CTORS_T_A(int64)
01001 DEFN_CTORS_T_A(uint64)
01002 DEFN_CTORS_T_A(const sc_int_base&)
01003 DEFN_CTORS_T_A(const sc_uint_base&)
01004 DEFN_CTORS_T_A(const sc_signed&)
01005 DEFN_CTORS_T_A(const sc_unsigned&)
01006 #endif
01007
01008 #undef DEFN_CTORS_T_A
01009 #undef DEFN_CTORS_T_B
01010
01011
01012
01013 inline
01014 sc_ufix::sc_ufix( const sc_ufix& a )
01015 : sc_fxnum( a,
01016 a.type_params(),
01017 SC_US_,
01018 sc_fxcast_switch(),
01019 0 )
01020 {}
01021
01022
01023
01024
01025 inline
01026 const sc_ufix
01027 sc_ufix::operator ~ () const
01028 {
01029 SC_FXNUM_OBSERVER_READ_( *this )
01030 int iwl_c = iwl();
01031 int wl_c = wl();
01032 sc_ufix c( wl_c, iwl_c );
01033 for( int i = iwl_c - wl_c; i < iwl_c; ++ i )
01034 c.set_bit( i, ! get_bit( i ) );
01035 return sc_ufix( c, wl_c, iwl_c );
01036 }
01037
01038
01039
01040
01041 inline
01042 void
01043 b_not( sc_ufix& c, const sc_ufix& a )
01044 {
01045 SC_FXNUM_OBSERVER_READ_( a )
01046 int iwl_c = c.iwl();
01047 for( int i = iwl_c - c.wl(); i < iwl_c; ++ i )
01048 c.set_bit( i, ! a.get_bit( i ) );
01049 c.cast();
01050 SC_FXNUM_OBSERVER_WRITE_( c )
01051 }
01052
01053
01054
01055
01056 #define DEFN_BIN_OP_T(op,op2,tp1,tp2) \
01057 inline \
01058 const sc_ufix \
01059 operator op ( const tp1& a, const tp2& b ) \
01060 { \
01061 a.observer_read(); \
01062 b.observer_read(); \
01063 int iwl_a = a.iwl(); \
01064 int iwl_b = b.iwl(); \
01065 int iwl_c = sc_max( iwl_a, iwl_b ); \
01066 int fwl_c = sc_max( a.wl() - iwl_a, b.wl() - iwl_b ); \
01067 sc_ufix c( iwl_c + fwl_c, iwl_c ); \
01068 for( int i = -fwl_c; i < iwl_c; ++ i ) \
01069 c.set_bit( i, a.get_bit( i ) op2 b.get_bit( i ) ); \
01070 return sc_ufix( c, iwl_c + fwl_c, iwl_c ); \
01071 }
01072
01073 DEFN_BIN_OP_T(&,&&,sc_ufix,sc_ufix)
01074 DEFN_BIN_OP_T(&,&&,sc_ufix,sc_ufix_fast)
01075 DEFN_BIN_OP_T(&,&&,sc_ufix_fast,sc_ufix)
01076
01077 DEFN_BIN_OP_T(|,||,sc_ufix,sc_ufix)
01078 DEFN_BIN_OP_T(|,||,sc_ufix,sc_ufix_fast)
01079 DEFN_BIN_OP_T(|,||,sc_ufix_fast,sc_ufix)
01080
01081 DEFN_BIN_OP_T(^,!=,sc_ufix,sc_ufix)
01082 DEFN_BIN_OP_T(^,!=,sc_ufix,sc_ufix_fast)
01083 DEFN_BIN_OP_T(^,!=,sc_ufix_fast,sc_ufix)
01084
01085 #undef DEFN_BIN_OP_T
01086
01087
01088
01089
01090 #define DEFN_BIN_FNC_T(fnc,op2,tp1,tp2) \
01091 inline \
01092 void \
01093 fnc ( sc_ufix& c, const tp1& a, const tp2& b ) \
01094 { \
01095 a.observer_read(); \
01096 b.observer_read(); \
01097 int iwl_c = c.iwl(); \
01098 for( int i = iwl_c - c.wl(); i < iwl_c; ++ i ) \
01099 c.set_bit( i, a.get_bit( i ) op2 b.get_bit( i ) ); \
01100 c.cast(); \
01101 SC_FXNUM_OBSERVER_WRITE_( c ) \
01102 }
01103
01104 DEFN_BIN_FNC_T(b_and,&&,sc_ufix,sc_ufix)
01105 DEFN_BIN_FNC_T(b_and,&&,sc_ufix,sc_ufix_fast)
01106 DEFN_BIN_FNC_T(b_and,&&,sc_ufix_fast,sc_ufix)
01107
01108 DEFN_BIN_FNC_T(b_or,||,sc_ufix,sc_ufix)
01109 DEFN_BIN_FNC_T(b_or,||,sc_ufix,sc_ufix_fast)
01110 DEFN_BIN_FNC_T(b_or,||,sc_ufix_fast,sc_ufix)
01111
01112 DEFN_BIN_FNC_T(b_xor,!=,sc_ufix,sc_ufix)
01113 DEFN_BIN_FNC_T(b_xor,!=,sc_ufix,sc_ufix_fast)
01114 DEFN_BIN_FNC_T(b_xor,!=,sc_ufix_fast,sc_ufix)
01115
01116 #undef DEFN_BIN_FNC_T
01117
01118
01119
01120
01121 inline
01122 sc_ufix&
01123 sc_ufix::operator = ( const sc_ufix& a )
01124 {
01125 sc_fxnum::operator = ( a );
01126 return *this;
01127 }
01128
01129 #define DEFN_ASN_OP_T(op,tp) \
01130 inline \
01131 sc_ufix& \
01132 sc_ufix::operator op ( tp a ) \
01133 { \
01134 sc_fxnum::operator op( a ); \
01135 return *this; \
01136 }
01137
01138 #ifndef SC_FX_EXCLUDE_OTHER
01139 #define DEFN_ASN_OP_OTHER(op) \
01140 DEFN_ASN_OP_T(op,int64) \
01141 DEFN_ASN_OP_T(op,uint64) \
01142 DEFN_ASN_OP_T(op,const sc_int_base&) \
01143 DEFN_ASN_OP_T(op,const sc_uint_base&) \
01144 DEFN_ASN_OP_T(op,const sc_signed&) \
01145 DEFN_ASN_OP_T(op,const sc_unsigned&)
01146 #else
01147 #define DEFN_ASN_OP_OTHER(op)
01148 #endif
01149
01150 #define DEFN_ASN_OP(op) \
01151 DEFN_ASN_OP_T(op,int) \
01152 DEFN_ASN_OP_T(op,unsigned int) \
01153 DEFN_ASN_OP_T(op,long) \
01154 DEFN_ASN_OP_T(op,unsigned long) \
01155 DEFN_ASN_OP_T(op,float) \
01156 DEFN_ASN_OP_T(op,double) \
01157 DEFN_ASN_OP_T(op,const char*) \
01158 DEFN_ASN_OP_T(op,const sc_fxval&) \
01159 DEFN_ASN_OP_T(op,const sc_fxval_fast&) \
01160 DEFN_ASN_OP_T(op,const sc_fxnum&) \
01161 DEFN_ASN_OP_T(op,const sc_fxnum_fast&) \
01162 DEFN_ASN_OP_OTHER(op)
01163
01164 DEFN_ASN_OP(=)
01165
01166 DEFN_ASN_OP(*=)
01167 DEFN_ASN_OP(/=)
01168 DEFN_ASN_OP(+=)
01169 DEFN_ASN_OP(-=)
01170
01171 DEFN_ASN_OP_T(<<=,int)
01172 DEFN_ASN_OP_T(>>=,int)
01173
01174 #undef DEFN_ASN_OP_T
01175 #undef DEFN_ASN_OP_OTHER
01176 #undef DEFN_ASN_OP
01177
01178
01179 #define DEFN_ASN_OP_T(op,op2,tp) \
01180 inline \
01181 sc_ufix& \
01182 sc_ufix::operator op ( const tp& b ) \
01183 { \
01184 SC_FXNUM_OBSERVER_READ_( *this ) \
01185 b.observer_read(); \
01186 int iwl_c = iwl(); \
01187 for( int i = iwl_c - wl(); i < iwl_c; ++ i ) \
01188 set_bit( i, get_bit( i ) op2 b.get_bit( i ) ); \
01189 cast(); \
01190 SC_FXNUM_OBSERVER_WRITE_( *this ) \
01191 return *this; \
01192 }
01193
01194 DEFN_ASN_OP_T(&=,&&,sc_ufix)
01195 DEFN_ASN_OP_T(&=,&&,sc_ufix_fast)
01196 DEFN_ASN_OP_T(|=,||,sc_ufix)
01197 DEFN_ASN_OP_T(|=,||,sc_ufix_fast)
01198 DEFN_ASN_OP_T(^=,!=,sc_ufix)
01199 DEFN_ASN_OP_T(^=,!=,sc_ufix_fast)
01200
01201 #undef DEFN_ASN_OP_T
01202
01203
01204
01205
01206 inline
01207 const sc_fxval
01208 sc_ufix::operator ++ ( int )
01209 {
01210 return sc_fxval( sc_fxnum::operator ++ ( 0 ) );
01211 }
01212
01213 inline
01214 const sc_fxval
01215 sc_ufix::operator -- ( int )
01216 {
01217 return sc_fxval( sc_fxnum::operator -- ( 0 ) );
01218 }
01219
01220 inline
01221 sc_ufix&
01222 sc_ufix::operator ++ ()
01223 {
01224 sc_fxnum::operator ++ ();
01225 return *this;
01226 }
01227
01228 inline
01229 sc_ufix&
01230 sc_ufix::operator -- ()
01231 {
01232 sc_fxnum::operator -- ();
01233 return *this;
01234 }
01235
01236
01237
01238
01239
01240
01241
01242
01243
01244
01245 inline
01246 sc_ufix_fast::sc_ufix_fast( sc_fxnum_fast_observer* observer_ )
01247 : sc_fxnum_fast( sc_fxtype_params(),
01248 SC_US_,
01249 sc_fxcast_switch(),
01250 observer_ )
01251 {}
01252
01253 inline
01254 sc_ufix_fast::sc_ufix_fast( int wl_, int iwl_,
01255 sc_fxnum_fast_observer* observer_ )
01256 : sc_fxnum_fast( sc_fxtype_params( wl_, iwl_ ),
01257 SC_US_,
01258 sc_fxcast_switch(),
01259 observer_ )
01260 {}
01261
01262 inline
01263 sc_ufix_fast::sc_ufix_fast( sc_q_mode qm, sc_o_mode om,
01264 sc_fxnum_fast_observer* observer_ )
01265 : sc_fxnum_fast( sc_fxtype_params( qm, om ),
01266 SC_US_,
01267 sc_fxcast_switch(),
01268 observer_ )
01269 {}
01270
01271 inline
01272 sc_ufix_fast::sc_ufix_fast( sc_q_mode qm, sc_o_mode om, int nb,
01273 sc_fxnum_fast_observer* observer_ )
01274 : sc_fxnum_fast( sc_fxtype_params( qm, om, nb ),
01275 SC_US_,
01276 sc_fxcast_switch(),
01277 observer_ )
01278 {}
01279
01280 inline
01281 sc_ufix_fast::sc_ufix_fast( int wl_, int iwl_, sc_q_mode qm, sc_o_mode om,
01282 sc_fxnum_fast_observer* observer_ )
01283 : sc_fxnum_fast( sc_fxtype_params( wl_, iwl_, qm, om ),
01284 SC_US_,
01285 sc_fxcast_switch(),
01286 observer_ )
01287 {}
01288
01289 inline
01290 sc_ufix_fast::sc_ufix_fast( int wl_, int iwl_,
01291 sc_q_mode qm, sc_o_mode om, int nb,
01292 sc_fxnum_fast_observer* observer_ )
01293 : sc_fxnum_fast( sc_fxtype_params( wl_, iwl_, qm, om, nb ),
01294 SC_US_,
01295 sc_fxcast_switch(),
01296 observer_ )
01297 {}
01298
01299 inline
01300 sc_ufix_fast::sc_ufix_fast( const sc_fxcast_switch& cast_sw,
01301 sc_fxnum_fast_observer* observer_ )
01302 : sc_fxnum_fast( sc_fxtype_params(),
01303 SC_US_,
01304 cast_sw,
01305 observer_ )
01306 {}
01307
01308 inline
01309 sc_ufix_fast::sc_ufix_fast( int wl_, int iwl_,
01310 const sc_fxcast_switch& cast_sw,
01311 sc_fxnum_fast_observer* observer_ )
01312 : sc_fxnum_fast( sc_fxtype_params( wl_, iwl_ ),
01313 SC_US_,
01314 cast_sw,
01315 observer_ )
01316 {}
01317
01318 inline
01319 sc_ufix_fast::sc_ufix_fast( sc_q_mode qm, sc_o_mode om,
01320 const sc_fxcast_switch& cast_sw,
01321 sc_fxnum_fast_observer* observer_ )
01322 : sc_fxnum_fast( sc_fxtype_params( qm, om ),
01323 SC_US_,
01324 cast_sw,
01325 observer_ )
01326 {}
01327
01328 inline
01329 sc_ufix_fast::sc_ufix_fast( sc_q_mode qm, sc_o_mode om, int nb,
01330 const sc_fxcast_switch& cast_sw,
01331 sc_fxnum_fast_observer* observer_ )
01332 : sc_fxnum_fast( sc_fxtype_params( qm, om, nb ),
01333 SC_US_,
01334 cast_sw,
01335 observer_ )
01336 {}
01337
01338 inline
01339 sc_ufix_fast::sc_ufix_fast( int wl_, int iwl_, sc_q_mode qm, sc_o_mode om,
01340 const sc_fxcast_switch& cast_sw,
01341 sc_fxnum_fast_observer* observer_ )
01342 : sc_fxnum_fast( sc_fxtype_params( wl_, iwl_, qm, om ),
01343 SC_US_,
01344 cast_sw,
01345 observer_ )
01346 {}
01347
01348 inline
01349 sc_ufix_fast::sc_ufix_fast( int wl_, int iwl_,
01350 sc_q_mode qm, sc_o_mode om, int nb,
01351 const sc_fxcast_switch& cast_sw,
01352 sc_fxnum_fast_observer* observer_ )
01353 : sc_fxnum_fast( sc_fxtype_params( wl_, iwl_, qm, om, nb ),
01354 SC_US_,
01355 cast_sw,
01356 observer_ )
01357 {}
01358
01359 inline
01360 sc_ufix_fast::sc_ufix_fast( const sc_fxtype_params& type_params,
01361 sc_fxnum_fast_observer* observer_ )
01362 : sc_fxnum_fast( type_params,
01363 SC_US_,
01364 sc_fxcast_switch(),
01365 observer_ )
01366 {}
01367
01368 inline
01369 sc_ufix_fast::sc_ufix_fast( const sc_fxtype_params& type_params,
01370 const sc_fxcast_switch& cast_sw,
01371 sc_fxnum_fast_observer* observer_ )
01372 : sc_fxnum_fast( type_params,
01373 SC_US_,
01374 cast_sw,
01375 observer_ )
01376 {}
01377
01378 #define DEFN_CTORS_T_A(tp) \
01379 inline \
01380 sc_ufix_fast::sc_ufix_fast( tp a, \
01381 sc_fxnum_fast_observer* observer_ ) \
01382 : sc_fxnum_fast( a, \
01383 sc_fxtype_params(), \
01384 SC_US_, \
01385 sc_fxcast_switch(), \
01386 observer_ ) \
01387 {} \
01388 \
01389 inline \
01390 sc_ufix_fast::sc_ufix_fast( tp a, \
01391 int wl_, int iwl_, \
01392 sc_fxnum_fast_observer* observer_ ) \
01393 : sc_fxnum_fast( a, \
01394 sc_fxtype_params( wl_, iwl_ ), \
01395 SC_US_, \
01396 sc_fxcast_switch(), \
01397 observer_ ) \
01398 {} \
01399 \
01400 inline \
01401 sc_ufix_fast::sc_ufix_fast( tp a, \
01402 sc_q_mode qm, sc_o_mode om, \
01403 sc_fxnum_fast_observer* observer_ ) \
01404 : sc_fxnum_fast( a, \
01405 sc_fxtype_params( qm, om ), \
01406 SC_US_, \
01407 sc_fxcast_switch(), \
01408 observer_ ) \
01409 {} \
01410 \
01411 inline \
01412 sc_ufix_fast::sc_ufix_fast( tp a, \
01413 sc_q_mode qm, sc_o_mode om, int nb, \
01414 sc_fxnum_fast_observer* observer_ ) \
01415 : sc_fxnum_fast( a, \
01416 sc_fxtype_params( qm, om, nb ), \
01417 SC_US_, \
01418 sc_fxcast_switch(), \
01419 observer_ ) \
01420 {} \
01421 \
01422 inline \
01423 sc_ufix_fast::sc_ufix_fast( tp a, \
01424 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
01425 sc_fxnum_fast_observer* observer_ ) \
01426 : sc_fxnum_fast( a, \
01427 sc_fxtype_params( wl_, iwl_, qm, om ), \
01428 SC_US_, \
01429 sc_fxcast_switch(), \
01430 observer_ ) \
01431 {} \
01432 \
01433 inline \
01434 sc_ufix_fast::sc_ufix_fast( tp a, \
01435 int wl_, int iwl_, \
01436 sc_q_mode qm, sc_o_mode om, int nb, \
01437 sc_fxnum_fast_observer* observer_ ) \
01438 : sc_fxnum_fast( a, \
01439 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
01440 SC_US_, \
01441 sc_fxcast_switch(), \
01442 observer_ ) \
01443 {} \
01444 \
01445 inline \
01446 sc_ufix_fast::sc_ufix_fast( tp a, \
01447 const sc_fxcast_switch& cast_sw, \
01448 sc_fxnum_fast_observer* observer_ ) \
01449 : sc_fxnum_fast( a, \
01450 sc_fxtype_params(), \
01451 SC_US_, \
01452 cast_sw, \
01453 observer_ ) \
01454 {} \
01455 \
01456 inline \
01457 sc_ufix_fast::sc_ufix_fast( tp a, \
01458 int wl_, int iwl_, \
01459 const sc_fxcast_switch& cast_sw, \
01460 sc_fxnum_fast_observer* observer_ ) \
01461 : sc_fxnum_fast( a, \
01462 sc_fxtype_params( wl_, iwl_ ), \
01463 SC_US_, \
01464 cast_sw, \
01465 observer_ ) \
01466 {} \
01467 \
01468 inline \
01469 sc_ufix_fast::sc_ufix_fast( tp a, \
01470 sc_q_mode qm, sc_o_mode om, \
01471 const sc_fxcast_switch& cast_sw, \
01472 sc_fxnum_fast_observer* observer_ ) \
01473 : sc_fxnum_fast( a, \
01474 sc_fxtype_params( qm, om ), \
01475 SC_US_, \
01476 cast_sw, \
01477 observer_ ) \
01478 {} \
01479 \
01480 inline \
01481 sc_ufix_fast::sc_ufix_fast( tp a, \
01482 sc_q_mode qm, sc_o_mode om, int nb, \
01483 const sc_fxcast_switch& cast_sw, \
01484 sc_fxnum_fast_observer* observer_ ) \
01485 : sc_fxnum_fast( a, \
01486 sc_fxtype_params( qm, om, nb ), \
01487 SC_US_, \
01488 cast_sw, \
01489 observer_ ) \
01490 {} \
01491 \
01492 inline \
01493 sc_ufix_fast::sc_ufix_fast( tp a, \
01494 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
01495 const sc_fxcast_switch& cast_sw, \
01496 sc_fxnum_fast_observer* observer_ ) \
01497 : sc_fxnum_fast( a, \
01498 sc_fxtype_params( wl_, iwl_, qm, om ), \
01499 SC_US_, \
01500 cast_sw, \
01501 observer_ ) \
01502 {} \
01503 \
01504 inline \
01505 sc_ufix_fast::sc_ufix_fast( tp a, \
01506 int wl_, int iwl_, \
01507 sc_q_mode qm, sc_o_mode om, int nb, \
01508 const sc_fxcast_switch& cast_sw, \
01509 sc_fxnum_fast_observer* observer_ ) \
01510 : sc_fxnum_fast( a, \
01511 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
01512 SC_US_, \
01513 cast_sw, \
01514 observer_ ) \
01515 {} \
01516 \
01517 inline \
01518 sc_ufix_fast::sc_ufix_fast( tp a, \
01519 const sc_fxtype_params& type_params, \
01520 sc_fxnum_fast_observer* observer_ ) \
01521 : sc_fxnum_fast( a, \
01522 type_params, \
01523 SC_US_, \
01524 sc_fxcast_switch(), \
01525 observer_ ) \
01526 {} \
01527 \
01528 inline \
01529 sc_ufix_fast::sc_ufix_fast( tp a, \
01530 const sc_fxtype_params& type_params, \
01531 const sc_fxcast_switch& cast_sw, \
01532 sc_fxnum_fast_observer* observer_ ) \
01533 : sc_fxnum_fast( a, \
01534 type_params, \
01535 SC_US_, \
01536 cast_sw, \
01537 observer_ ) \
01538 {}
01539
01540 #define DEFN_CTORS_T_B(tp) \
01541 inline \
01542 sc_ufix_fast::sc_ufix_fast( tp a, \
01543 sc_fxnum_fast_observer* observer_ ) \
01544 : sc_fxnum_fast( a, \
01545 a.type_params(), \
01546 SC_US_, \
01547 sc_fxcast_switch(), \
01548 observer_ ) \
01549 {} \
01550 \
01551 inline \
01552 sc_ufix_fast::sc_ufix_fast( tp a, \
01553 int wl_, int iwl_, \
01554 sc_fxnum_fast_observer* observer_ ) \
01555 : sc_fxnum_fast( a, \
01556 sc_fxtype_params( a.type_params(), wl_, iwl_ ), \
01557 SC_US_, \
01558 sc_fxcast_switch(), \
01559 observer_ ) \
01560 {} \
01561 \
01562 inline \
01563 sc_ufix_fast::sc_ufix_fast( tp a, \
01564 sc_q_mode qm, sc_o_mode om, \
01565 sc_fxnum_fast_observer* observer_ ) \
01566 : sc_fxnum_fast( a, \
01567 sc_fxtype_params( a.type_params(), qm, om ), \
01568 SC_US_, \
01569 sc_fxcast_switch(), \
01570 observer_ ) \
01571 {} \
01572 \
01573 inline \
01574 sc_ufix_fast::sc_ufix_fast( tp a, \
01575 sc_q_mode qm, sc_o_mode om, int nb, \
01576 sc_fxnum_fast_observer* observer_ ) \
01577 : sc_fxnum_fast( a, \
01578 sc_fxtype_params( a.type_params(), qm, om, nb ), \
01579 SC_US_, \
01580 sc_fxcast_switch(), \
01581 observer_ ) \
01582 {} \
01583 \
01584 inline \
01585 sc_ufix_fast::sc_ufix_fast( tp a, \
01586 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
01587 sc_fxnum_fast_observer* observer_ ) \
01588 : sc_fxnum_fast( a, \
01589 sc_fxtype_params( wl_, iwl_, qm, om ), \
01590 SC_US_, \
01591 sc_fxcast_switch(), \
01592 observer_ ) \
01593 {} \
01594 \
01595 inline \
01596 sc_ufix_fast::sc_ufix_fast( tp a, \
01597 int wl_, int iwl_, \
01598 sc_q_mode qm, sc_o_mode om, int nb, \
01599 sc_fxnum_fast_observer* observer_ ) \
01600 : sc_fxnum_fast( a, \
01601 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
01602 SC_US_, \
01603 sc_fxcast_switch(), \
01604 observer_ ) \
01605 {} \
01606 \
01607 inline \
01608 sc_ufix_fast::sc_ufix_fast( tp a, \
01609 const sc_fxcast_switch& cast_sw, \
01610 sc_fxnum_fast_observer* observer_ ) \
01611 : sc_fxnum_fast( a, \
01612 a.type_params(), \
01613 SC_US_, \
01614 cast_sw, \
01615 observer_ ) \
01616 {} \
01617 \
01618 inline \
01619 sc_ufix_fast::sc_ufix_fast( tp a, \
01620 int wl_, int iwl_, \
01621 const sc_fxcast_switch& cast_sw, \
01622 sc_fxnum_fast_observer* observer_ ) \
01623 : sc_fxnum_fast( a, \
01624 sc_fxtype_params( a.type_params(), wl_, iwl_ ), \
01625 SC_US_, \
01626 cast_sw, \
01627 observer_ ) \
01628 {} \
01629 \
01630 inline \
01631 sc_ufix_fast::sc_ufix_fast( tp a, \
01632 sc_q_mode qm, sc_o_mode om, \
01633 const sc_fxcast_switch& cast_sw, \
01634 sc_fxnum_fast_observer* observer_ ) \
01635 : sc_fxnum_fast( a, \
01636 sc_fxtype_params( a.type_params(), qm, om ), \
01637 SC_US_, \
01638 cast_sw, \
01639 observer_ ) \
01640 {} \
01641 \
01642 inline \
01643 sc_ufix_fast::sc_ufix_fast( tp a, \
01644 sc_q_mode qm, sc_o_mode om, int nb, \
01645 const sc_fxcast_switch& cast_sw, \
01646 sc_fxnum_fast_observer* observer_ ) \
01647 : sc_fxnum_fast( a, \
01648 sc_fxtype_params( a.type_params(), qm, om, nb ), \
01649 SC_US_, \
01650 cast_sw, \
01651 observer_ ) \
01652 {} \
01653 \
01654 inline \
01655 sc_ufix_fast::sc_ufix_fast( tp a, \
01656 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
01657 const sc_fxcast_switch& cast_sw, \
01658 sc_fxnum_fast_observer* observer_ ) \
01659 : sc_fxnum_fast( a, \
01660 sc_fxtype_params( wl_, iwl_, qm, om ), \
01661 SC_US_, \
01662 cast_sw, \
01663 observer_ ) \
01664 {} \
01665 \
01666 inline \
01667 sc_ufix_fast::sc_ufix_fast( tp a, \
01668 int wl_, int iwl_, \
01669 sc_q_mode qm, sc_o_mode om, int nb, \
01670 const sc_fxcast_switch& cast_sw, \
01671 sc_fxnum_fast_observer* observer_ ) \
01672 : sc_fxnum_fast( a, \
01673 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
01674 SC_US_, \
01675 cast_sw, \
01676 observer_ ) \
01677 {} \
01678 \
01679 inline \
01680 sc_ufix_fast::sc_ufix_fast( tp a, \
01681 const sc_fxtype_params& type_params, \
01682 sc_fxnum_fast_observer* observer_ ) \
01683 : sc_fxnum_fast( a, \
01684 type_params, \
01685 SC_US_, \
01686 sc_fxcast_switch(), \
01687 observer_ ) \
01688 {} \
01689 \
01690 inline \
01691 sc_ufix_fast::sc_ufix_fast( tp a, \
01692 const sc_fxtype_params& type_params, \
01693 const sc_fxcast_switch& cast_sw, \
01694 sc_fxnum_fast_observer* observer_ ) \
01695 : sc_fxnum_fast( a, \
01696 type_params, \
01697 SC_US_, \
01698 cast_sw, \
01699 observer_ ) \
01700 {}
01701
01702 DEFN_CTORS_T_A(int)
01703 DEFN_CTORS_T_A(unsigned int)
01704 DEFN_CTORS_T_A(long)
01705 DEFN_CTORS_T_A(unsigned long)
01706 DEFN_CTORS_T_A(float)
01707 DEFN_CTORS_T_A(double)
01708 DEFN_CTORS_T_A(const char*)
01709 DEFN_CTORS_T_A(const sc_fxval&)
01710 DEFN_CTORS_T_A(const sc_fxval_fast&)
01711 DEFN_CTORS_T_B(const sc_fxnum&)
01712 DEFN_CTORS_T_B(const sc_fxnum_fast&)
01713 #ifndef SC_FX_EXCLUDE_OTHER
01714 DEFN_CTORS_T_A(int64)
01715 DEFN_CTORS_T_A(uint64)
01716 DEFN_CTORS_T_A(const sc_int_base&)
01717 DEFN_CTORS_T_A(const sc_uint_base&)
01718 DEFN_CTORS_T_A(const sc_signed&)
01719 DEFN_CTORS_T_A(const sc_unsigned&)
01720 #endif
01721
01722 #undef DEFN_CTORS_T_A
01723 #undef DEFN_CTORS_T_B
01724
01725
01726
01727 inline
01728 sc_ufix_fast::sc_ufix_fast( const sc_ufix_fast& a )
01729 : sc_fxnum_fast( a,
01730 a.type_params(),
01731 SC_US_,
01732 sc_fxcast_switch(),
01733 0 )
01734 {}
01735
01736
01737
01738
01739 inline
01740 const sc_ufix_fast
01741 sc_ufix_fast::operator ~ () const
01742 {
01743 SC_FXNUM_FAST_OBSERVER_READ_( *this )
01744 int iwl_c = iwl();
01745 int wl_c = wl();
01746 sc_ufix_fast c( wl_c, iwl_c );
01747 for( int i = iwl_c - wl_c; i < iwl_c; ++ i )
01748 c.set_bit( i, ! get_bit( i ) );
01749 return sc_ufix_fast( c, wl_c, iwl_c );
01750 }
01751
01752
01753
01754
01755 inline
01756 void
01757 b_not( sc_ufix_fast& c, const sc_ufix_fast& a )
01758 {
01759 SC_FXNUM_FAST_OBSERVER_READ_( a )
01760 int iwl_c = c.iwl();
01761 for( int i = iwl_c - c.wl(); i < iwl_c; ++ i )
01762 c.set_bit( i, ! a.get_bit( i ) );
01763 c.cast();
01764 SC_FXNUM_FAST_OBSERVER_WRITE_( c )
01765 }
01766
01767
01768
01769
01770 #define DEFN_BIN_OP_T(op,op2,tp1,tp2) \
01771 inline \
01772 const sc_ufix_fast \
01773 operator op ( const tp1& a, const tp2& b ) \
01774 { \
01775 a.observer_read(); \
01776 b.observer_read(); \
01777 int iwl_a = a.iwl(); \
01778 int iwl_b = b.iwl(); \
01779 int iwl_c = sc_max( iwl_a, iwl_b ); \
01780 int fwl_c = sc_max( a.wl() - iwl_a, b.wl() - iwl_b ); \
01781 sc_ufix_fast c( iwl_c + fwl_c, iwl_c ); \
01782 for( int i = -fwl_c; i < iwl_c; ++ i ) \
01783 c.set_bit( i, a.get_bit( i ) op2 b.get_bit( i ) ); \
01784 return sc_ufix_fast( c, iwl_c + fwl_c, iwl_c ); \
01785 }
01786
01787 DEFN_BIN_OP_T(&,&&,sc_ufix_fast,sc_ufix_fast)
01788 DEFN_BIN_OP_T(|,||,sc_ufix_fast,sc_ufix_fast)
01789 DEFN_BIN_OP_T(^,!=,sc_ufix_fast,sc_ufix_fast)
01790
01791 #undef DEFN_BIN_OP_T
01792
01793
01794
01795
01796 #define DEFN_BIN_FNC_T(fnc,op2,tp1,tp2) \
01797 inline \
01798 void \
01799 fnc ( sc_ufix_fast& c, const tp1& a, const tp2& b ) \
01800 { \
01801 a.observer_read(); \
01802 b.observer_read(); \
01803 int iwl_c = c.iwl(); \
01804 for( int i = iwl_c - c.wl(); i < iwl_c; ++ i ) \
01805 c.set_bit( i, a.get_bit( i ) op2 b.get_bit( i ) ); \
01806 c.cast(); \
01807 SC_FXNUM_FAST_OBSERVER_WRITE_( c ) \
01808 }
01809
01810 DEFN_BIN_FNC_T(b_and,&&,sc_ufix_fast,sc_ufix_fast)
01811 DEFN_BIN_FNC_T(b_or,||,sc_ufix_fast,sc_ufix_fast)
01812 DEFN_BIN_FNC_T(b_xor,!=,sc_ufix_fast,sc_ufix_fast)
01813
01814 #undef DEFN_BIN_FNC_T
01815
01816
01817
01818
01819 inline
01820 sc_ufix_fast&
01821 sc_ufix_fast::operator = ( const sc_ufix_fast& a )
01822 {
01823 sc_fxnum_fast::operator = ( a );
01824 return *this;
01825 }
01826
01827 #define DEFN_ASN_OP_T(op,tp) \
01828 inline \
01829 sc_ufix_fast& \
01830 sc_ufix_fast::operator op ( tp a ) \
01831 { \
01832 sc_fxnum_fast::operator op( a ); \
01833 return *this; \
01834 }
01835
01836 #ifndef SC_FX_EXCLUDE_OTHER
01837 #define DEFN_ASN_OP_OTHER(op) \
01838 DEFN_ASN_OP_T(op,int64) \
01839 DEFN_ASN_OP_T(op,uint64) \
01840 DEFN_ASN_OP_T(op,const sc_int_base&) \
01841 DEFN_ASN_OP_T(op,const sc_uint_base&) \
01842 DEFN_ASN_OP_T(op,const sc_signed&) \
01843 DEFN_ASN_OP_T(op,const sc_unsigned&)
01844 #else
01845 #define DEFN_ASN_OP_OTHER(op)
01846 #endif
01847
01848 #define DEFN_ASN_OP(op) \
01849 DEFN_ASN_OP_T(op,int) \
01850 DEFN_ASN_OP_T(op,unsigned int) \
01851 DEFN_ASN_OP_T(op,long) \
01852 DEFN_ASN_OP_T(op,unsigned long) \
01853 DEFN_ASN_OP_T(op,float) \
01854 DEFN_ASN_OP_T(op,double) \
01855 DEFN_ASN_OP_T(op,const char*) \
01856 DEFN_ASN_OP_T(op,const sc_fxval&) \
01857 DEFN_ASN_OP_T(op,const sc_fxval_fast&) \
01858 DEFN_ASN_OP_T(op,const sc_fxnum&) \
01859 DEFN_ASN_OP_T(op,const sc_fxnum_fast&) \
01860 DEFN_ASN_OP_OTHER(op)
01861
01862 DEFN_ASN_OP(=)
01863
01864 DEFN_ASN_OP(*=)
01865 DEFN_ASN_OP(/=)
01866 DEFN_ASN_OP(+=)
01867 DEFN_ASN_OP(-=)
01868
01869 DEFN_ASN_OP_T(<<=,int)
01870 DEFN_ASN_OP_T(>>=,int)
01871
01872 #undef DEFN_ASN_OP_T
01873 #undef DEFN_ASN_OP_OTHER
01874 #undef DEFN_ASN_OP
01875
01876
01877 #define DEFN_ASN_OP_T(op,op2,tp) \
01878 inline \
01879 sc_ufix_fast& \
01880 sc_ufix_fast::operator op ( const tp& b ) \
01881 { \
01882 SC_FXNUM_FAST_OBSERVER_READ_( *this ) \
01883 b.observer_read(); \
01884 int iwl_c = iwl(); \
01885 for( int i = iwl_c - wl(); i < iwl_c; ++ i ) \
01886 set_bit( i, get_bit( i ) op2 b.get_bit( i ) ); \
01887 cast(); \
01888 SC_FXNUM_FAST_OBSERVER_WRITE_( *this ) \
01889 return *this; \
01890 }
01891
01892 DEFN_ASN_OP_T(&=,&&,sc_ufix)
01893 DEFN_ASN_OP_T(&=,&&,sc_ufix_fast)
01894 DEFN_ASN_OP_T(|=,||,sc_ufix)
01895 DEFN_ASN_OP_T(|=,||,sc_ufix_fast)
01896 DEFN_ASN_OP_T(^=,!=,sc_ufix)
01897 DEFN_ASN_OP_T(^=,!=,sc_ufix_fast)
01898
01899 #undef DEFN_ASN_OP_T
01900
01901
01902
01903
01904 inline
01905 const sc_fxval_fast
01906 sc_ufix_fast::operator ++ ( int )
01907 {
01908 return sc_fxval_fast( sc_fxnum_fast::operator ++ ( 0 ) );
01909 }
01910
01911 inline
01912 const sc_fxval_fast
01913 sc_ufix_fast::operator -- ( int )
01914 {
01915 return sc_fxval_fast( sc_fxnum_fast::operator -- ( 0 ) );
01916 }
01917
01918 inline
01919 sc_ufix_fast&
01920 sc_ufix_fast::operator ++ ()
01921 {
01922 sc_fxnum_fast::operator ++ ();
01923 return *this;
01924 }
01925
01926 inline
01927 sc_ufix_fast&
01928 sc_ufix_fast::operator -- ()
01929 {
01930 sc_fxnum_fast::operator -- ();
01931 return *this;
01932 }
01933
01934 }
01935
01936
01937 #endif
01938
01939