61 template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
class sc_fixed;
62 template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
class sc_fixed_fast;
71 template <
int W,
int I,
84 #define DECL_CTORS_T_A(tp) \ 85 sc_fixed( tp, sc_fxnum_observer* = 0 ); \ 86 sc_fixed( tp, const sc_fxcast_switch&, sc_fxnum_observer* = 0 ); 88 #define DECL_CTORS_T_B(tp) \ 89 explicit sc_fixed( tp, sc_fxnum_observer* = 0 ); \ 90 sc_fixed( tp, const sc_fxcast_switch&, sc_fxnum_observer* = 0 ); 103 #ifndef SC_FX_EXCLUDE_OTHER 112 #undef DECL_CTORS_T_A 113 #undef DECL_CTORS_T_B 124 #define DECL_ASN_OP_T(op,tp) \ 125 sc_fixed& operator op ( tp ); 127 #ifndef SC_FX_EXCLUDE_OTHER 128 #define DECL_ASN_OP_OTHER(op) \ 129 DECL_ASN_OP_T(op,int64) \ 130 DECL_ASN_OP_T(op,uint64) \ 131 DECL_ASN_OP_T(op,const sc_int_base&) \ 132 DECL_ASN_OP_T(op,const sc_uint_base&) \ 133 DECL_ASN_OP_T(op,const sc_signed&) \ 134 DECL_ASN_OP_T(op,const sc_unsigned&) 136 #define DECL_ASN_OP_OTHER(op) 139 #define DECL_ASN_OP(op) \ 140 DECL_ASN_OP_T(op,int) \ 141 DECL_ASN_OP_T(op,unsigned int) \ 142 DECL_ASN_OP_T(op,long) \ 143 DECL_ASN_OP_T(op,unsigned long) \ 144 DECL_ASN_OP_T(op,float) \ 145 DECL_ASN_OP_T(op,double) \ 146 DECL_ASN_OP_T(op,const char*) \ 147 DECL_ASN_OP_T(op,const sc_fxval&) \ 148 DECL_ASN_OP_T(op,const sc_fxval_fast&) \ 149 DECL_ASN_OP_T(op,const sc_fxnum&) \ 150 DECL_ASN_OP_T(op,const sc_fxnum_fast&) \ 151 DECL_ASN_OP_OTHER(op) 161 DECL_ASN_OP_T(>>=,
int)
163 DECL_ASN_OP_T(&=,const
sc_fix&)
165 DECL_ASN_OP_T(|=,const
sc_fix&)
167 DECL_ASN_OP_T(^=,const
sc_fix&)
171 #undef DECL_ASN_OP_OTHER 192 template <
int W,
int I,
206 #define DECL_CTORS_T_A(tp) \ 207 sc_fixed_fast( tp, sc_fxnum_fast_observer* = 0 ); \ 208 sc_fixed_fast( tp, const sc_fxcast_switch&, \ 209 sc_fxnum_fast_observer* = 0 ); 211 #define DECL_CTORS_T_B(tp) \ 212 explicit sc_fixed_fast( tp, sc_fxnum_fast_observer* = 0 ); \ 213 sc_fixed_fast( tp, const sc_fxcast_switch&, \ 214 sc_fxnum_fast_observer* = 0 ); 227 #ifndef SC_FX_EXCLUDE_OTHER 236 #undef DECL_CTORS_T_A 237 #undef DECL_CTORS_T_B 241 sc_fixed_fast(
const sc_fixed_fast<W,I,Q,O,N>& );
246 sc_fixed_fast&
operator = (
const sc_fixed_fast<W,I,Q,O,N>& );
248 #define DECL_ASN_OP_T(op,tp) \ 249 sc_fixed_fast& operator op ( tp ); 251 #ifndef SC_FX_EXCLUDE_OTHER 252 #define DECL_ASN_OP_OTHER(op) \ 253 DECL_ASN_OP_T(op,int64) \ 254 DECL_ASN_OP_T(op,uint64) \ 255 DECL_ASN_OP_T(op,const sc_int_base&) \ 256 DECL_ASN_OP_T(op,const sc_uint_base&) \ 257 DECL_ASN_OP_T(op,const sc_signed&) \ 258 DECL_ASN_OP_T(op,const sc_unsigned&) 260 #define DECL_ASN_OP_OTHER(op) 263 #define DECL_ASN_OP(op) \ 264 DECL_ASN_OP_T(op,int) \ 265 DECL_ASN_OP_T(op,unsigned int) \ 266 DECL_ASN_OP_T(op,long) \ 267 DECL_ASN_OP_T(op,unsigned long) \ 268 DECL_ASN_OP_T(op,float) \ 269 DECL_ASN_OP_T(op,double) \ 270 DECL_ASN_OP_T(op,const char*) \ 271 DECL_ASN_OP_T(op,const sc_fxval&) \ 272 DECL_ASN_OP_T(op,const sc_fxval_fast&) \ 273 DECL_ASN_OP_T(op,const sc_fxnum&) \ 274 DECL_ASN_OP_T(op,const sc_fxnum_fast&) \ 275 DECL_ASN_OP_OTHER(op) 285 DECL_ASN_OP_T(>>=,
int)
287 DECL_ASN_OP_T(&=,const
sc_fix&)
288 DECL_ASN_OP_T(&=,const sc_fix_fast&)
289 DECL_ASN_OP_T(|=,const
sc_fix&)
290 DECL_ASN_OP_T(|=,const sc_fix_fast&)
291 DECL_ASN_OP_T(^=,const
sc_fix&)
292 DECL_ASN_OP_T(^=,const sc_fix_fast&)
295 #undef DECL_ASN_OP_OTHER 318 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
321 :
sc_fix( W, I, Q, O, N, observer_ )
324 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
328 :
sc_fix( W, I, Q, O, N, cast_sw, observer_ )
331 #define DEFN_CTORS_T(tp) \ 332 template<int W, int I, sc_q_mode Q, sc_o_mode O, int N> \ 334 sc_fixed<W,I,Q,O,N>::sc_fixed( tp a, \ 335 sc_fxnum_observer* observer_ ) \ 336 : sc_fix( a, W, I, Q, O, N, observer_ ) \ 339 template<int W, int I, sc_q_mode Q, sc_o_mode O, int N> \ 341 sc_fixed<W,I,Q,O,N>::sc_fixed( tp a, \ 342 const sc_fxcast_switch& cast_sw, \ 343 sc_fxnum_observer* observer_ ) \ 344 : sc_fix( a, W, I, Q, O, N, cast_sw, observer_ ) \ 358 #ifndef SC_FX_EXCLUDE_OTHER 371 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
374 :
sc_fix( a, W, I, Q, O, N )
380 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
389 #define DEFN_ASN_OP_T(op,tp) \ 390 template<int W, int I, sc_q_mode Q, sc_o_mode O, int N> \ 392 sc_fixed<W,I,Q,O,N>& \ 393 sc_fixed<W,I,Q,O,N>::operator op ( tp a ) \ 395 sc_fix::operator op ( a ); \ 399 #ifndef SC_FX_EXCLUDE_OTHER 400 #define DEFN_ASN_OP_OTHER(op) \ 401 DEFN_ASN_OP_T(op,int64) \ 402 DEFN_ASN_OP_T(op,uint64) \ 403 DEFN_ASN_OP_T(op,const sc_int_base&) \ 404 DEFN_ASN_OP_T(op,const sc_uint_base&) \ 405 DEFN_ASN_OP_T(op,const sc_signed&) \ 406 DEFN_ASN_OP_T(op,const sc_unsigned&) 408 #define DEFN_ASN_OP_OTHER(op) 411 #define DEFN_ASN_OP(op) \ 412 DEFN_ASN_OP_T(op,int) \ 413 DEFN_ASN_OP_T(op,unsigned int) \ 414 DEFN_ASN_OP_T(op,long) \ 415 DEFN_ASN_OP_T(op,unsigned long) \ 416 DEFN_ASN_OP_T(op,float) \ 417 DEFN_ASN_OP_T(op,double) \ 418 DEFN_ASN_OP_T(op,const char*) \ 419 DEFN_ASN_OP_T(op,const sc_fxval&) \ 420 DEFN_ASN_OP_T(op,const sc_fxval_fast&) \ 421 DEFN_ASN_OP_T(op,const sc_fxnum&) \ 422 DEFN_ASN_OP_T(op,const sc_fxnum_fast&) \ 423 DEFN_ASN_OP_OTHER(op) 443 #undef DEFN_ASN_OP_OTHER 449 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
454 return sc_fxval( sc_fix::operator ++ ( 0 ) );
457 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
462 return sc_fxval( sc_fix::operator -- ( 0 ) );
465 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
474 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
490 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
496 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
503 #define DEFN_CTORS_T(tp) \ 504 template<int W, int I, sc_q_mode Q, sc_o_mode O, int N> \ 506 sc_fixed_fast<W,I,Q,O,N>::sc_fixed_fast( tp a, \ 507 sc_fxnum_fast_observer* observer_ ) \ 508 : sc_fix_fast( a, W, I, Q, O, N, observer_ ) \ 511 template<int W, int I, sc_q_mode Q, sc_o_mode O, int N> \ 513 sc_fixed_fast<W,I,Q,O,N>::sc_fixed_fast( tp a, \ 514 const sc_fxcast_switch& cast_sw, \ 515 sc_fxnum_fast_observer* observer_ ) \ 516 : sc_fix_fast( a, W, I, Q, O, N, cast_sw, observer_ ) \ 530 #ifndef SC_FX_EXCLUDE_OTHER 543 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
552 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
561 #define DEFN_ASN_OP_T(op,tp) \ 562 template<int W, int I, sc_q_mode Q, sc_o_mode O, int N> \ 564 sc_fixed_fast<W,I,Q,O,N>& \ 565 sc_fixed_fast<W,I,Q,O,N>::operator op ( tp a ) \ 567 sc_fix_fast::operator op ( a ); \ 571 #ifndef SC_FX_EXCLUDE_OTHER 572 #define DEFN_ASN_OP_OTHER(op) \ 573 DEFN_ASN_OP_T(op,int64) \ 574 DEFN_ASN_OP_T(op,uint64) \ 575 DEFN_ASN_OP_T(op,const sc_int_base&) \ 576 DEFN_ASN_OP_T(op,const sc_uint_base&) \ 577 DEFN_ASN_OP_T(op,const sc_signed&) \ 578 DEFN_ASN_OP_T(op,const sc_unsigned&) 580 #define DEFN_ASN_OP_OTHER(op) 583 #define DEFN_ASN_OP(op) \ 584 DEFN_ASN_OP_T(op,int) \ 585 DEFN_ASN_OP_T(op,unsigned int) \ 586 DEFN_ASN_OP_T(op,long) \ 587 DEFN_ASN_OP_T(op,unsigned long) \ 588 DEFN_ASN_OP_T(op,float) \ 589 DEFN_ASN_OP_T(op,double) \ 590 DEFN_ASN_OP_T(op,const char*) \ 591 DEFN_ASN_OP_T(op,const sc_fxval&) \ 592 DEFN_ASN_OP_T(op,const sc_fxval_fast&) \ 593 DEFN_ASN_OP_T(op,const sc_fxnum&) \ 594 DEFN_ASN_OP_T(op,const sc_fxnum_fast&) \ 595 DEFN_ASN_OP_OTHER(op) 605 DEFN_ASN_OP_T(>>=,
int)
607 DEFN_ASN_OP_T(&=,const sc_fix&)
609 DEFN_ASN_OP_T(|=,const sc_fix&)
611 DEFN_ASN_OP_T(^=,const sc_fix&)
615 #undef DEFN_ASN_OP_OTHER 621 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
629 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
637 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
646 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
Base class for the fixed-point types; limited precision.
sc_fixed_fast & operator++()
const sc_o_mode SC_DEFAULT_O_MODE_
"Constrained" signed fixed-point class; arbitrary precision.
Fixed-point value types; limited precision.
#define DECL_CTORS_T_A(tp)
sc_fix_fast & operator++()
const sc_q_mode SC_DEFAULT_Q_MODE_
Fixed-point cast switch class.
sc_fixed(sc_fxnum_observer *=0)
sc_fix_fast & operator=(const sc_fix_fast &)
const int SC_DEFAULT_N_BITS_
"Unconstrained" signed fixed-point class; limited precision.
Arbitrary precision signed number.
sc_fixed_fast & operator--()
Abstract base class for fixed-point types observers; limited precision.
Arbitrary precision unsigned number.
Base class for the fixed-point types; arbitrary precision.
"Constrained" signed fixed-point class; limited precision.
Fixed-point value type; arbitrary precision.
Abstract base class for fixed-point types observers; arbitrary precision.
#define DECL_CTORS_T_B(tp)
sc_fix_fast & operator--()
friend class sc_fxval_fast
sc_fixed_fast & operator=(const sc_fixed_fast< W, I, Q, O, N > &)
#define DEFN_ASN_OP_T(op, tp)
sc_fix_fast(sc_fxnum_fast_observer *=0)
sc_q_mode
Enumeration of quantization modes.
sc_fix & operator=(const sc_fix &)
sc_fixed_fast(sc_fxnum_fast_observer *=0)
sc_fixed & operator=(const sc_fixed< W, I, Q, O, N > &)
#define DECL_ASN_OP_T(op, tp)
"Unconstrained" signed fixed-point class; arbitrary precision.
sc_fix(sc_fxnum_observer *=0)
sc_o_mode
Enumeration of overflow modes.