112 #define DECL_CTORS_T(tp) \ 115 sc_fxnum_observer* = 0 ); \ 117 sc_q_mode, sc_o_mode, \ 118 sc_fxnum_observer* = 0 ); \ 120 sc_q_mode, sc_o_mode, int, \ 121 sc_fxnum_observer* = 0 ); \ 123 int, int, sc_q_mode, sc_o_mode, \ 124 sc_fxnum_observer* = 0 ); \ 126 int, int, sc_q_mode, sc_o_mode, int, \ 127 sc_fxnum_observer* = 0 ); \ 129 const sc_fxcast_switch&, \ 130 sc_fxnum_observer* = 0 ); \ 133 const sc_fxcast_switch&, \ 134 sc_fxnum_observer* = 0 ); \ 136 sc_q_mode, sc_o_mode, \ 137 const sc_fxcast_switch&, \ 138 sc_fxnum_observer* = 0 ); \ 140 sc_q_mode, sc_o_mode, int, \ 141 const sc_fxcast_switch&, \ 142 sc_fxnum_observer* = 0 ); \ 144 int, int, sc_q_mode, sc_o_mode, \ 145 const sc_fxcast_switch&, \ 146 sc_fxnum_observer* = 0 ); \ 148 int, int, sc_q_mode, sc_o_mode, int, \ 149 const sc_fxcast_switch&, \ 150 sc_fxnum_observer* = 0 ); \ 152 const sc_fxtype_params&, \ 153 sc_fxnum_observer* = 0 ); \ 155 const sc_fxtype_params&, \ 156 const sc_fxcast_switch&, \ 157 sc_fxnum_observer* = 0 ); 159 #define DECL_CTORS_T_A(tp) \ 161 sc_fxnum_observer* = 0 ); \ 164 #define DECL_CTORS_T_B(tp) \ 165 explicit sc_ufix( tp, \ 166 sc_fxnum_observer* = 0 ); \ 180 #ifndef SC_FX_EXCLUDE_OTHER 190 #undef DECL_CTORS_T_A 191 #undef DECL_CTORS_T_B 205 friend void b_not( sc_ufix&,
const sc_ufix& );
210 friend const sc_ufix
operator & (
const sc_ufix&,
const sc_ufix& );
213 friend const sc_ufix
operator | (
const sc_ufix&,
const sc_ufix& );
216 friend const sc_ufix
operator ^ (
const sc_ufix&,
const sc_ufix& );
223 friend void b_and( sc_ufix&,
const sc_ufix&,
const sc_ufix& );
226 friend void b_or ( sc_ufix&,
const sc_ufix&,
const sc_ufix& );
229 friend void b_xor( sc_ufix&,
const sc_ufix&,
const sc_ufix& );
236 sc_ufix& operator = (
const sc_ufix& );
238 #define DECL_ASN_OP_T(op,tp) \ 239 sc_ufix& operator op ( tp ); 241 #ifndef SC_FX_EXCLUDE_OTHER 242 #define DECL_ASN_OP_OTHER(op) \ 243 DECL_ASN_OP_T(op,int64) \ 244 DECL_ASN_OP_T(op,uint64) \ 245 DECL_ASN_OP_T(op,const sc_int_base&) \ 246 DECL_ASN_OP_T(op,const sc_uint_base&) \ 247 DECL_ASN_OP_T(op,const sc_signed&) \ 248 DECL_ASN_OP_T(op,const sc_unsigned&) 250 #define DECL_ASN_OP_OTHER(op) 253 #define DECL_ASN_OP(op) \ 254 DECL_ASN_OP_T(op,int) \ 255 DECL_ASN_OP_T(op,unsigned int) \ 256 DECL_ASN_OP_T(op,long) \ 257 DECL_ASN_OP_T(op,unsigned long) \ 258 DECL_ASN_OP_T(op,float) \ 259 DECL_ASN_OP_T(op,double) \ 260 DECL_ASN_OP_T(op,const char*) \ 261 DECL_ASN_OP_T(op,const sc_fxval&) \ 262 DECL_ASN_OP_T(op,const sc_fxval_fast&) \ 263 DECL_ASN_OP_T(op,const sc_fxnum&) \ 264 DECL_ASN_OP_T(op,const sc_fxnum_fast&) \ 265 DECL_ASN_OP_OTHER(op) 285 #undef DECL_ASN_OP_OTHER 294 sc_ufix& operator ++ ();
295 sc_ufix& operator -- ();
347 #define DECL_CTORS_T(tp) \ 350 sc_fxnum_fast_observer* = 0 ); \ 352 sc_q_mode, sc_o_mode, \ 353 sc_fxnum_fast_observer* = 0 ); \ 355 sc_q_mode, sc_o_mode, int, \ 356 sc_fxnum_fast_observer* = 0 ); \ 358 int, int, sc_q_mode, sc_o_mode, \ 359 sc_fxnum_fast_observer* = 0 ); \ 361 int, int, sc_q_mode, sc_o_mode, int, \ 362 sc_fxnum_fast_observer* = 0 ); \ 364 const sc_fxcast_switch&, \ 365 sc_fxnum_fast_observer* = 0 ); \ 368 const sc_fxcast_switch&, \ 369 sc_fxnum_fast_observer* = 0 ); \ 371 sc_q_mode, sc_o_mode, \ 372 const sc_fxcast_switch&, \ 373 sc_fxnum_fast_observer* = 0 ); \ 375 sc_q_mode, sc_o_mode, int, \ 376 const sc_fxcast_switch&, \ 377 sc_fxnum_fast_observer* = 0 ); \ 379 int, int, sc_q_mode, sc_o_mode, \ 380 const sc_fxcast_switch&, \ 381 sc_fxnum_fast_observer* = 0 ); \ 383 int, int, sc_q_mode, sc_o_mode, int, \ 384 const sc_fxcast_switch&, \ 385 sc_fxnum_fast_observer* = 0 ); \ 387 const sc_fxtype_params&, \ 388 sc_fxnum_fast_observer* = 0 ); \ 390 const sc_fxtype_params&, \ 391 const sc_fxcast_switch&, \ 392 sc_fxnum_fast_observer* = 0 ); 394 #define DECL_CTORS_T_A(tp) \ 396 sc_fxnum_fast_observer* = 0 ); \ 399 #define DECL_CTORS_T_B(tp) \ 400 explicit sc_ufix_fast( tp, \ 401 sc_fxnum_fast_observer* = 0 ); \ 415 #ifndef SC_FX_EXCLUDE_OTHER 425 #undef DECL_CTORS_T_A 426 #undef DECL_CTORS_T_B 430 sc_ufix_fast(
const sc_ufix_fast& );
440 friend void b_not( sc_ufix_fast&,
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 friend const sc_ufix_fast
operator | (
const sc_ufix_fast&,
450 const sc_ufix_fast& );
455 friend void b_and( sc_ufix_fast&,
const sc_ufix_fast&,
456 const sc_ufix_fast& );
457 friend void b_or ( sc_ufix_fast&,
const sc_ufix_fast&,
458 const sc_ufix_fast& );
459 friend void b_xor( sc_ufix_fast&,
const sc_ufix_fast&,
460 const sc_ufix_fast& );
465 sc_ufix_fast& operator = (
const sc_ufix_fast& );
467 #define DECL_ASN_OP_T(op,tp) \ 468 sc_ufix_fast& operator op ( tp ); 470 #ifndef SC_FX_EXCLUDE_OTHER 471 #define DECL_ASN_OP_OTHER(op) \ 472 DECL_ASN_OP_T(op,int64) \ 473 DECL_ASN_OP_T(op,uint64) \ 474 DECL_ASN_OP_T(op,const sc_int_base&) \ 475 DECL_ASN_OP_T(op,const sc_uint_base&) \ 476 DECL_ASN_OP_T(op,const sc_signed&) \ 477 DECL_ASN_OP_T(op,const sc_unsigned&) 479 #define DECL_ASN_OP_OTHER(op) 482 #define DECL_ASN_OP(op) \ 483 DECL_ASN_OP_T(op,int) \ 484 DECL_ASN_OP_T(op,unsigned int) \ 485 DECL_ASN_OP_T(op,long) \ 486 DECL_ASN_OP_T(op,unsigned long) \ 487 DECL_ASN_OP_T(op,float) \ 488 DECL_ASN_OP_T(op,double) \ 489 DECL_ASN_OP_T(op,const char*) \ 490 DECL_ASN_OP_T(op,const sc_fxval&) \ 491 DECL_ASN_OP_T(op,const sc_fxval_fast&) \ 492 DECL_ASN_OP_T(op,const sc_fxnum&) \ 493 DECL_ASN_OP_T(op,const sc_fxnum_fast&) \ 494 DECL_ASN_OP_OTHER(op) 504 DECL_ASN_OP_T(>>=,
int)
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 DECL_ASN_OP_T(^=,const sc_ufix&)
511 DECL_ASN_OP_T(^=,const sc_ufix_fast&)
514 #undef DECL_ASN_OP_OTHER 520 const sc_fxval_fast operator ++ (
int );
521 const sc_fxval_fast operator -- (
int );
523 sc_ufix_fast& operator ++ ();
524 sc_ufix_fast& operator -- ();
670 #define DEFN_CTORS_T_A(tp) \ 672 sc_ufix::sc_ufix( tp a, \ 673 sc_fxnum_observer* observer_ ) \ 675 sc_fxtype_params(), \ 677 sc_fxcast_switch(), \ 682 sc_ufix::sc_ufix( tp a, \ 684 sc_fxnum_observer* observer_ ) \ 686 sc_fxtype_params( wl_, iwl_ ), \ 688 sc_fxcast_switch(), \ 693 sc_ufix::sc_ufix( tp a, \ 694 sc_q_mode qm, sc_o_mode om, \ 695 sc_fxnum_observer* observer_ ) \ 697 sc_fxtype_params( qm, om ), \ 699 sc_fxcast_switch(), \ 704 sc_ufix::sc_ufix( tp a, \ 705 sc_q_mode qm, sc_o_mode om, int nb, \ 706 sc_fxnum_observer* observer_ ) \ 708 sc_fxtype_params( qm, om, nb ), \ 710 sc_fxcast_switch(), \ 715 sc_ufix::sc_ufix( tp a, \ 716 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \ 717 sc_fxnum_observer* observer_ ) \ 719 sc_fxtype_params( wl_, iwl_, qm, om ), \ 721 sc_fxcast_switch(), \ 726 sc_ufix::sc_ufix( tp a, \ 727 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb, \ 728 sc_fxnum_observer* observer_ ) \ 730 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \ 732 sc_fxcast_switch(), \ 737 sc_ufix::sc_ufix( tp a, \ 738 const sc_fxcast_switch& cast_sw, \ 739 sc_fxnum_observer* observer_ ) \ 741 sc_fxtype_params(), \ 748 sc_ufix::sc_ufix( tp a, \ 750 const sc_fxcast_switch& cast_sw, \ 751 sc_fxnum_observer* observer_ ) \ 753 sc_fxtype_params( wl_, iwl_ ), \ 760 sc_ufix::sc_ufix( tp a, \ 761 sc_q_mode qm, sc_o_mode om, \ 762 const sc_fxcast_switch& cast_sw, \ 763 sc_fxnum_observer* observer_ ) \ 765 sc_fxtype_params( qm, om ), \ 772 sc_ufix::sc_ufix( tp a, \ 773 sc_q_mode qm, sc_o_mode om, int nb, \ 774 const sc_fxcast_switch& cast_sw, \ 775 sc_fxnum_observer* observer_ ) \ 777 sc_fxtype_params( qm, om, nb ), \ 784 sc_ufix::sc_ufix( tp a, \ 785 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \ 786 const sc_fxcast_switch& cast_sw, \ 787 sc_fxnum_observer* observer_ ) \ 789 sc_fxtype_params( wl_, iwl_, qm, om ), \ 796 sc_ufix::sc_ufix( tp a, \ 797 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb, \ 798 const sc_fxcast_switch& cast_sw, \ 799 sc_fxnum_observer* observer_ ) \ 801 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \ 808 sc_ufix::sc_ufix( tp a, \ 809 const sc_fxtype_params& type_params_, \ 810 sc_fxnum_observer* observer_ ) \ 814 sc_fxcast_switch(), \ 819 sc_ufix::sc_ufix( tp a, \ 820 const sc_fxtype_params& type_params_, \ 821 const sc_fxcast_switch& cast_sw, \ 822 sc_fxnum_observer* observer_ ) \ 830 #define DEFN_CTORS_T_B(tp) \ 832 sc_ufix::sc_ufix( tp a, \ 833 sc_fxnum_observer* observer_ ) \ 837 sc_fxcast_switch(), \ 842 sc_ufix::sc_ufix( tp a, \ 844 sc_fxnum_observer* observer_ ) \ 846 sc_fxtype_params( a.type_params(), wl_, iwl_ ), \ 848 sc_fxcast_switch(), \ 853 sc_ufix::sc_ufix( tp a, \ 854 sc_q_mode qm, sc_o_mode om, \ 855 sc_fxnum_observer* observer_ ) \ 857 sc_fxtype_params( a.type_params(), qm, om ), \ 859 sc_fxcast_switch(), \ 864 sc_ufix::sc_ufix( tp a, \ 865 sc_q_mode qm, sc_o_mode om, int nb, \ 866 sc_fxnum_observer* observer_ ) \ 868 sc_fxtype_params( a.type_params(), qm, om, nb ), \ 870 sc_fxcast_switch(), \ 875 sc_ufix::sc_ufix( tp a, \ 876 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \ 877 sc_fxnum_observer* observer_ ) \ 879 sc_fxtype_params( wl_, iwl_, qm, om ), \ 881 sc_fxcast_switch(), \ 886 sc_ufix::sc_ufix( tp a, \ 887 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb, \ 888 sc_fxnum_observer* observer_ ) \ 890 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \ 892 sc_fxcast_switch(), \ 897 sc_ufix::sc_ufix( tp a, \ 898 const sc_fxcast_switch& cast_sw, \ 899 sc_fxnum_observer* observer_ ) \ 908 sc_ufix::sc_ufix( tp a, \ 910 const sc_fxcast_switch& cast_sw, \ 911 sc_fxnum_observer* observer_ ) \ 913 sc_fxtype_params( a.type_params(), wl_, iwl_ ), \ 920 sc_ufix::sc_ufix( tp a, \ 921 sc_q_mode qm, sc_o_mode om, \ 922 const sc_fxcast_switch& cast_sw, \ 923 sc_fxnum_observer* observer_ ) \ 925 sc_fxtype_params( a.type_params(), qm, om ), \ 932 sc_ufix::sc_ufix( tp a, \ 933 sc_q_mode qm, sc_o_mode om, int nb, \ 934 const sc_fxcast_switch& cast_sw, \ 935 sc_fxnum_observer* observer_ ) \ 937 sc_fxtype_params( a.type_params(), qm, om, nb ), \ 944 sc_ufix::sc_ufix( tp a, \ 945 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \ 946 const sc_fxcast_switch& cast_sw, \ 947 sc_fxnum_observer* observer_ ) \ 949 sc_fxtype_params( wl_, iwl_, qm, om ), \ 956 sc_ufix::sc_ufix( tp a, \ 957 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb, \ 958 const sc_fxcast_switch& cast_sw, \ 959 sc_fxnum_observer* observer_ ) \ 961 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \ 968 sc_ufix::sc_ufix( tp a, \ 969 const sc_fxtype_params& type_params_, \ 970 sc_fxnum_observer* observer_ ) \ 974 sc_fxcast_switch(), \ 979 sc_ufix::sc_ufix( tp a, \ 980 const sc_fxtype_params& type_params_, \ 981 const sc_fxcast_switch& cast_sw, \ 982 sc_fxnum_observer* observer_ ) \ 1001 #ifndef SC_FX_EXCLUDE_OTHER 1010 #undef DEFN_CTORS_T_A 1011 #undef DEFN_CTORS_T_B 1035 for(
int i = iwl_c - wl_c; i < iwl_c; ++ i )
1037 return sc_ufix( c, wl_c, iwl_c );
1048 int iwl_c = c.
iwl();
1049 for(
int i = iwl_c - c.
wl(); i < iwl_c; ++ i )
1058 #define DEFN_BIN_OP_T(op,op2,tp1,tp2) \ 1061 operator op ( const tp1& a, const tp2& b ) \ 1063 a.observer_read(); \ 1064 b.observer_read(); \ 1065 int iwl_a = a.iwl(); \ 1066 int iwl_b = b.iwl(); \ 1067 int iwl_c = sc_max( iwl_a, iwl_b ); \ 1068 int fwl_c = sc_max( a.wl() - iwl_a, b.wl() - iwl_b ); \ 1069 sc_ufix c( iwl_c + fwl_c, iwl_c ); \ 1070 for( int i = -fwl_c; i < iwl_c; ++ i ) \ 1071 c.set_bit( i, a.get_bit( i ) op2 b.get_bit( i ) ); \ 1072 return sc_ufix( c, iwl_c + fwl_c, iwl_c ); \ 1087 #undef DEFN_BIN_OP_T 1092 #define DEFN_BIN_FNC_T(fnc,op2,tp1,tp2) \ 1095 fnc ( sc_ufix& c, const tp1& a, const tp2& b ) \ 1097 a.observer_read(); \ 1098 b.observer_read(); \ 1099 int iwl_c = c.iwl(); \ 1100 for( int i = iwl_c - c.wl(); i < iwl_c; ++ i ) \ 1101 c.set_bit( i, a.get_bit( i ) op2 b.get_bit( i ) ); \ 1103 SC_FXNUM_OBSERVER_WRITE_( c ) \ 1118 #undef DEFN_BIN_FNC_T 1127 sc_fxnum::operator = ( a );
1131 #define DEFN_ASN_OP_T(op,tp) \ 1134 sc_ufix::operator op ( tp a ) \ 1136 sc_fxnum::operator op( a ); \ 1140 #ifndef SC_FX_EXCLUDE_OTHER 1141 #define DEFN_ASN_OP_OTHER(op) \ 1142 DEFN_ASN_OP_T(op,int64) \ 1143 DEFN_ASN_OP_T(op,uint64) \ 1144 DEFN_ASN_OP_T(op,const sc_int_base&) \ 1145 DEFN_ASN_OP_T(op,const sc_uint_base&) \ 1146 DEFN_ASN_OP_T(op,const sc_signed&) \ 1147 DEFN_ASN_OP_T(op,const sc_unsigned&) 1149 #define DEFN_ASN_OP_OTHER(op) 1152 #define DEFN_ASN_OP(op) \ 1153 DEFN_ASN_OP_T(op,int) \ 1154 DEFN_ASN_OP_T(op,unsigned int) \ 1155 DEFN_ASN_OP_T(op,long) \ 1156 DEFN_ASN_OP_T(op,unsigned long) \ 1157 DEFN_ASN_OP_T(op,float) \ 1158 DEFN_ASN_OP_T(op,double) \ 1159 DEFN_ASN_OP_T(op,const char*) \ 1160 DEFN_ASN_OP_T(op,const sc_fxval&) \ 1161 DEFN_ASN_OP_T(op,const sc_fxval_fast&) \ 1162 DEFN_ASN_OP_T(op,const sc_fxnum&) \ 1163 DEFN_ASN_OP_T(op,const sc_fxnum_fast&) \ 1164 DEFN_ASN_OP_OTHER(op) 1176 #undef DEFN_ASN_OP_T 1177 #undef DEFN_ASN_OP_OTHER 1181 #define DEFN_ASN_OP_T(op,op2,tp) \ 1184 sc_ufix::operator op ( const tp& b ) \ 1186 SC_FXNUM_OBSERVER_READ_( *this ) \ 1187 b.observer_read(); \ 1188 int iwl_c = iwl(); \ 1189 for( int i = iwl_c - wl(); i < iwl_c; ++ i ) \ 1190 set_bit( i, get_bit( i ) op2 b.get_bit( i ) ); \ 1192 SC_FXNUM_OBSERVER_WRITE_( *this ) \ 1203 #undef DEFN_ASN_OP_T 1212 return sc_fxval( sc_fxnum::operator ++ ( 0 ) );
1219 return sc_fxval( sc_fxnum::operator -- ( 0 ) );
1380 #define DEFN_CTORS_T_A(tp) \ 1382 sc_ufix_fast::sc_ufix_fast( tp a, \ 1383 sc_fxnum_fast_observer* observer_ ) \ 1384 : sc_fxnum_fast( a, \ 1385 sc_fxtype_params(), \ 1387 sc_fxcast_switch(), \ 1392 sc_ufix_fast::sc_ufix_fast( tp a, \ 1393 int wl_, int iwl_, \ 1394 sc_fxnum_fast_observer* observer_ ) \ 1395 : sc_fxnum_fast( a, \ 1396 sc_fxtype_params( wl_, iwl_ ), \ 1398 sc_fxcast_switch(), \ 1403 sc_ufix_fast::sc_ufix_fast( tp a, \ 1404 sc_q_mode qm, sc_o_mode om, \ 1405 sc_fxnum_fast_observer* observer_ ) \ 1406 : sc_fxnum_fast( a, \ 1407 sc_fxtype_params( qm, om ), \ 1409 sc_fxcast_switch(), \ 1414 sc_ufix_fast::sc_ufix_fast( tp a, \ 1415 sc_q_mode qm, sc_o_mode om, int nb, \ 1416 sc_fxnum_fast_observer* observer_ ) \ 1417 : sc_fxnum_fast( a, \ 1418 sc_fxtype_params( qm, om, nb ), \ 1420 sc_fxcast_switch(), \ 1425 sc_ufix_fast::sc_ufix_fast( tp a, \ 1426 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \ 1427 sc_fxnum_fast_observer* observer_ ) \ 1428 : sc_fxnum_fast( a, \ 1429 sc_fxtype_params( wl_, iwl_, qm, om ), \ 1431 sc_fxcast_switch(), \ 1436 sc_ufix_fast::sc_ufix_fast( tp a, \ 1437 int wl_, int iwl_, \ 1438 sc_q_mode qm, sc_o_mode om, int nb, \ 1439 sc_fxnum_fast_observer* observer_ ) \ 1440 : sc_fxnum_fast( a, \ 1441 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \ 1443 sc_fxcast_switch(), \ 1448 sc_ufix_fast::sc_ufix_fast( tp a, \ 1449 const sc_fxcast_switch& cast_sw, \ 1450 sc_fxnum_fast_observer* observer_ ) \ 1451 : sc_fxnum_fast( a, \ 1452 sc_fxtype_params(), \ 1459 sc_ufix_fast::sc_ufix_fast( tp a, \ 1460 int wl_, int iwl_, \ 1461 const sc_fxcast_switch& cast_sw, \ 1462 sc_fxnum_fast_observer* observer_ ) \ 1463 : sc_fxnum_fast( a, \ 1464 sc_fxtype_params( wl_, iwl_ ), \ 1471 sc_ufix_fast::sc_ufix_fast( tp a, \ 1472 sc_q_mode qm, sc_o_mode om, \ 1473 const sc_fxcast_switch& cast_sw, \ 1474 sc_fxnum_fast_observer* observer_ ) \ 1475 : sc_fxnum_fast( a, \ 1476 sc_fxtype_params( qm, om ), \ 1483 sc_ufix_fast::sc_ufix_fast( tp a, \ 1484 sc_q_mode qm, sc_o_mode om, int nb, \ 1485 const sc_fxcast_switch& cast_sw, \ 1486 sc_fxnum_fast_observer* observer_ ) \ 1487 : sc_fxnum_fast( a, \ 1488 sc_fxtype_params( qm, om, nb ), \ 1495 sc_ufix_fast::sc_ufix_fast( tp a, \ 1496 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \ 1497 const sc_fxcast_switch& cast_sw, \ 1498 sc_fxnum_fast_observer* observer_ ) \ 1499 : sc_fxnum_fast( a, \ 1500 sc_fxtype_params( wl_, iwl_, qm, om ), \ 1507 sc_ufix_fast::sc_ufix_fast( tp a, \ 1508 int wl_, int iwl_, \ 1509 sc_q_mode qm, sc_o_mode om, int nb, \ 1510 const sc_fxcast_switch& cast_sw, \ 1511 sc_fxnum_fast_observer* observer_ ) \ 1512 : sc_fxnum_fast( a, \ 1513 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \ 1520 sc_ufix_fast::sc_ufix_fast( tp a, \ 1521 const sc_fxtype_params& type_params_, \ 1522 sc_fxnum_fast_observer* observer_ ) \ 1523 : sc_fxnum_fast( a, \ 1526 sc_fxcast_switch(), \ 1531 sc_ufix_fast::sc_ufix_fast( tp a, \ 1532 const sc_fxtype_params& type_params_, \ 1533 const sc_fxcast_switch& cast_sw, \ 1534 sc_fxnum_fast_observer* observer_ ) \ 1535 : sc_fxnum_fast( a, \ 1542 #define DEFN_CTORS_T_B(tp) \ 1544 sc_ufix_fast::sc_ufix_fast( tp a, \ 1545 sc_fxnum_fast_observer* observer_ ) \ 1546 : sc_fxnum_fast( a, \ 1549 sc_fxcast_switch(), \ 1554 sc_ufix_fast::sc_ufix_fast( tp a, \ 1555 int wl_, int iwl_, \ 1556 sc_fxnum_fast_observer* observer_ ) \ 1557 : sc_fxnum_fast( a, \ 1558 sc_fxtype_params( a.type_params(), wl_, iwl_ ), \ 1560 sc_fxcast_switch(), \ 1565 sc_ufix_fast::sc_ufix_fast( tp a, \ 1566 sc_q_mode qm, sc_o_mode om, \ 1567 sc_fxnum_fast_observer* observer_ ) \ 1568 : sc_fxnum_fast( a, \ 1569 sc_fxtype_params( a.type_params(), qm, om ), \ 1571 sc_fxcast_switch(), \ 1576 sc_ufix_fast::sc_ufix_fast( tp a, \ 1577 sc_q_mode qm, sc_o_mode om, int nb, \ 1578 sc_fxnum_fast_observer* observer_ ) \ 1579 : sc_fxnum_fast( a, \ 1580 sc_fxtype_params( a.type_params(), qm, om, nb ), \ 1582 sc_fxcast_switch(), \ 1587 sc_ufix_fast::sc_ufix_fast( tp a, \ 1588 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \ 1589 sc_fxnum_fast_observer* observer_ ) \ 1590 : sc_fxnum_fast( a, \ 1591 sc_fxtype_params( wl_, iwl_, qm, om ), \ 1593 sc_fxcast_switch(), \ 1598 sc_ufix_fast::sc_ufix_fast( tp a, \ 1599 int wl_, int iwl_, \ 1600 sc_q_mode qm, sc_o_mode om, int nb, \ 1601 sc_fxnum_fast_observer* observer_ ) \ 1602 : sc_fxnum_fast( a, \ 1603 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \ 1605 sc_fxcast_switch(), \ 1610 sc_ufix_fast::sc_ufix_fast( tp a, \ 1611 const sc_fxcast_switch& cast_sw, \ 1612 sc_fxnum_fast_observer* observer_ ) \ 1613 : sc_fxnum_fast( a, \ 1621 sc_ufix_fast::sc_ufix_fast( tp a, \ 1622 int wl_, int iwl_, \ 1623 const sc_fxcast_switch& cast_sw, \ 1624 sc_fxnum_fast_observer* observer_ ) \ 1625 : sc_fxnum_fast( a, \ 1626 sc_fxtype_params( a.type_params(), wl_, iwl_ ), \ 1633 sc_ufix_fast::sc_ufix_fast( tp a, \ 1634 sc_q_mode qm, sc_o_mode om, \ 1635 const sc_fxcast_switch& cast_sw, \ 1636 sc_fxnum_fast_observer* observer_ ) \ 1637 : sc_fxnum_fast( a, \ 1638 sc_fxtype_params( a.type_params(), qm, om ), \ 1645 sc_ufix_fast::sc_ufix_fast( tp a, \ 1646 sc_q_mode qm, sc_o_mode om, int nb, \ 1647 const sc_fxcast_switch& cast_sw, \ 1648 sc_fxnum_fast_observer* observer_ ) \ 1649 : sc_fxnum_fast( a, \ 1650 sc_fxtype_params( a.type_params(), qm, om, nb ), \ 1657 sc_ufix_fast::sc_ufix_fast( tp a, \ 1658 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \ 1659 const sc_fxcast_switch& cast_sw, \ 1660 sc_fxnum_fast_observer* observer_ ) \ 1661 : sc_fxnum_fast( a, \ 1662 sc_fxtype_params( wl_, iwl_, qm, om ), \ 1669 sc_ufix_fast::sc_ufix_fast( tp a, \ 1670 int wl_, int iwl_, \ 1671 sc_q_mode qm, sc_o_mode om, int nb, \ 1672 const sc_fxcast_switch& cast_sw, \ 1673 sc_fxnum_fast_observer* observer_ ) \ 1674 : sc_fxnum_fast( a, \ 1675 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \ 1682 sc_ufix_fast::sc_ufix_fast( tp a, \ 1683 const sc_fxtype_params& type_params_, \ 1684 sc_fxnum_fast_observer* observer_ ) \ 1685 : sc_fxnum_fast( a, \ 1688 sc_fxcast_switch(), \ 1693 sc_ufix_fast::sc_ufix_fast( tp a, \ 1694 const sc_fxtype_params& type_params_, \ 1695 const sc_fxcast_switch& cast_sw, \ 1696 sc_fxnum_fast_observer* observer_ ) \ 1697 : sc_fxnum_fast( a, \ 1715 #ifndef SC_FX_EXCLUDE_OTHER 1724 #undef DEFN_CTORS_T_A 1725 #undef DEFN_CTORS_T_B 1749 for(
int i = iwl_c - wl_c; i < iwl_c; ++ i )
1762 int iwl_c = c.
iwl();
1763 for(
int i = iwl_c - c.
wl(); i < iwl_c; ++ i )
1772 #define DEFN_BIN_OP_T(op,op2,tp1,tp2) \ 1774 const sc_ufix_fast \ 1775 operator op ( const tp1& a, const tp2& b ) \ 1777 a.observer_read(); \ 1778 b.observer_read(); \ 1779 int iwl_a = a.iwl(); \ 1780 int iwl_b = b.iwl(); \ 1781 int iwl_c = sc_max( iwl_a, iwl_b ); \ 1782 int fwl_c = sc_max( a.wl() - iwl_a, b.wl() - iwl_b ); \ 1783 sc_ufix_fast c( iwl_c + fwl_c, iwl_c ); \ 1784 for( int i = -fwl_c; i < iwl_c; ++ i ) \ 1785 c.set_bit( i, a.get_bit( i ) op2 b.get_bit( i ) ); \ 1786 return sc_ufix_fast( c, iwl_c + fwl_c, iwl_c ); \ 1793 #undef DEFN_BIN_OP_T 1798 #define DEFN_BIN_FNC_T(fnc,op2,tp1,tp2) \ 1801 fnc ( sc_ufix_fast& c, const tp1& a, const tp2& b ) \ 1803 a.observer_read(); \ 1804 b.observer_read(); \ 1805 int iwl_c = c.iwl(); \ 1806 for( int i = iwl_c - c.wl(); i < iwl_c; ++ i ) \ 1807 c.set_bit( i, a.get_bit( i ) op2 b.get_bit( i ) ); \ 1809 SC_FXNUM_FAST_OBSERVER_WRITE_( c ) \ 1816 #undef DEFN_BIN_FNC_T 1825 sc_fxnum_fast::operator = ( a );
1829 #define DEFN_ASN_OP_T(op,tp) \ 1832 sc_ufix_fast::operator op ( tp a ) \ 1834 sc_fxnum_fast::operator op( a ); \ 1838 #ifndef SC_FX_EXCLUDE_OTHER 1839 #define DEFN_ASN_OP_OTHER(op) \ 1840 DEFN_ASN_OP_T(op,int64) \ 1841 DEFN_ASN_OP_T(op,uint64) \ 1842 DEFN_ASN_OP_T(op,const sc_int_base&) \ 1843 DEFN_ASN_OP_T(op,const sc_uint_base&) \ 1844 DEFN_ASN_OP_T(op,const sc_signed&) \ 1845 DEFN_ASN_OP_T(op,const sc_unsigned&) 1847 #define DEFN_ASN_OP_OTHER(op) 1850 #define DEFN_ASN_OP(op) \ 1851 DEFN_ASN_OP_T(op,int) \ 1852 DEFN_ASN_OP_T(op,unsigned int) \ 1853 DEFN_ASN_OP_T(op,long) \ 1854 DEFN_ASN_OP_T(op,unsigned long) \ 1855 DEFN_ASN_OP_T(op,float) \ 1856 DEFN_ASN_OP_T(op,double) \ 1857 DEFN_ASN_OP_T(op,const char*) \ 1858 DEFN_ASN_OP_T(op,const sc_fxval&) \ 1859 DEFN_ASN_OP_T(op,const sc_fxval_fast&) \ 1860 DEFN_ASN_OP_T(op,const sc_fxnum&) \ 1861 DEFN_ASN_OP_T(op,const sc_fxnum_fast&) \ 1862 DEFN_ASN_OP_OTHER(op) 1872 DEFN_ASN_OP_T(>>=,
int)
1874 #undef DEFN_ASN_OP_T 1875 #undef DEFN_ASN_OP_OTHER 1879 #define DEFN_ASN_OP_T(op,op2,tp) \ 1882 sc_ufix_fast::operator op ( const tp& b ) \ 1884 SC_FXNUM_FAST_OBSERVER_READ_( *this ) \ 1885 b.observer_read(); \ 1886 int iwl_c = iwl(); \ 1887 for( int i = iwl_c - wl(); i < iwl_c; ++ i ) \ 1888 set_bit( i, get_bit( i ) op2 b.get_bit( i ) ); \ 1890 SC_FXNUM_FAST_OBSERVER_WRITE_( *this ) \ 1901 #undef DEFN_ASN_OP_T friend void b_xor(sc_ufix &, const sc_ufix &, const sc_ufix &)
Base class for the fixed-point types; limited precision.
const sc_ufix operator~() const
friend void b_and(sc_ufix_fast &, const sc_ufix_fast &, const sc_ufix_fast &)
#define DEFN_CTORS_T_B(tp)
#define DECL_CTORS_T_B(tp)
friend void b_or(sc_ufix &, const sc_ufix &, const sc_ufix &)
Fixed-point value types; limited precision.
sc_ufix_fast & operator++()
const sc_ufix_fast operator~() const
#define DEFN_ASN_OP_T(op, tp)
#define SC_FXNUM_OBSERVER_READ_(object)
Fixed-point cast switch class.
#define SC_FXNUM_FAST_OBSERVER_READ_(object)
sc_ufix & operator=(const sc_ufix &)
Arbitrary precision signed number.
Abstract base class for fixed-point types observers; limited precision.
Arbitrary precision unsigned number.
Base class for the fixed-point types; arbitrary precision.
#define DECL_ASN_OP_T(op, tp)
friend void b_xor(sc_ufix_fast &, const sc_ufix_fast &, const sc_ufix_fast &)
sc_fxnum_fast & operator--()
DEFN_BIN_OP_T(/, div, int64) DEFN_BIN_OP_T(/
const sc_bit b_or(const sc_bit &a, const sc_bit &b)
friend void b_not(sc_ufix &, const sc_ufix &)
const sc_bit b_not(const sc_bit &a)
const sc_fxtype_params & type_params() const
const sc_bit operator|(const sc_bit &a, const sc_bit &b)
sc_ufix_fast & operator=(const sc_ufix_fast &)
sc_ufix_fast & operator--()
Fixed-point value type; arbitrary precision.
Abstract base class for fixed-point types observers; arbitrary precision.
"Unconstrained" unsigned fixed-point class; limited precision.
friend void b_not(sc_ufix_fast &, const sc_ufix_fast &)
friend class sc_fxval_fast
Fixed-point type parameters class.
sc_ufix(sc_fxnum_observer *=0)
const sc_bit operator^(const sc_bit &a, const sc_bit &b)
sc_ufix_fast(sc_fxnum_fast_observer *=0)
#define DEFN_CTORS_T_A(tp)
#define SC_FXNUM_OBSERVER_WRITE_(object)
"Unconstrained" unsigned fixed-point class; arbitrary precision.
#define SC_FXNUM_FAST_OBSERVER_WRITE_(object)
const sc_bit b_xor(const sc_bit &a, const sc_bit &b)
friend void b_or(sc_ufix_fast &, const sc_ufix_fast &, const sc_ufix_fast &)
sc_q_mode
Enumeration of quantization modes.
sc_fxnum_fast & operator++()
const sc_bit b_and(const sc_bit &a, const sc_bit &b)
#define DECL_CTORS_T_A(tp)
const sc_bit operator&(const sc_bit &a, const sc_bit &b)
const sc_fxtype_params & type_params() const
sc_o_mode
Enumeration of overflow modes.
const sc_bit operator~(const sc_bit &a)
friend void b_and(sc_ufix &, const sc_ufix &, const sc_ufix &)
#define DEFN_BIN_FNC_T(fnc, op2, tp1, tp2)