50#ifndef __SYSTEMC_EXT_DT_FX_SC_FIXED_HH__
51#define __SYSTEMC_EXT_DT_FX_SC_FIXED_HH__
59template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
61template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
70template <
int W,
int I,
80#define DECL_CTORS_T_A(tp) \
81 sc_fixed(tp, sc_fxnum_observer * =0); \
82 sc_fixed(tp, const sc_fxcast_switch &, sc_fxnum_observer * =0);
84#define DECL_CTORS_T_B(tp) \
85 explicit sc_fixed(tp, sc_fxnum_observer * =0); \
86 sc_fixed(tp, const sc_fxcast_switch &, sc_fxnum_observer * =0);
116#define DECL_ASN_OP_T(op, tp) sc_fixed &operator op (tp);
118#define DECL_ASN_OP_OTHER(op) \
119 DECL_ASN_OP_T(op, int64) \
120 DECL_ASN_OP_T(op, uint64) \
121 DECL_ASN_OP_T(op, const sc_int_base&) \
122 DECL_ASN_OP_T(op, const sc_uint_base&) \
123 DECL_ASN_OP_T(op, const sc_signed&) \
124 DECL_ASN_OP_T(op, const sc_unsigned&)
126#define DECL_ASN_OP(op) \
127 DECL_ASN_OP_T(op, int) \
128 DECL_ASN_OP_T(op, unsigned int) \
129 DECL_ASN_OP_T(op, long) \
130 DECL_ASN_OP_T(op, unsigned long) \
131 DECL_ASN_OP_T(op, float) \
132 DECL_ASN_OP_T(op, double) \
133 DECL_ASN_OP_T(op, const char *) \
134 DECL_ASN_OP_T(op, const sc_fxval &) \
135 DECL_ASN_OP_T(op, const sc_fxval_fast &) \
136 DECL_ASN_OP_T(op, const sc_fxnum &) \
137 DECL_ASN_OP_T(op, const sc_fxnum_fast &) \
138 DECL_ASN_OP_OTHER(op)
158#undef DECL_ASN_OP_OTHER
176template <
int W,
int I,
187#define DECL_CTORS_T_A(tp) \
188 sc_fixed_fast(tp, sc_fxnum_fast_observer * =0); \
189 sc_fixed_fast(tp, const sc_fxcast_switch &, \
190 sc_fxnum_fast_observer * =0);
192#define DECL_CTORS_T_B(tp) \
193 explicit sc_fixed_fast(tp, sc_fxnum_fast_observer * =0); \
194 sc_fixed_fast(tp, const sc_fxcast_switch &, \
195 sc_fxnum_fast_observer * =0);
225#define DECL_ASN_OP_T(op, tp) sc_fixed_fast &operator op (tp);
227#define DECL_ASN_OP_OTHER(op) \
228 DECL_ASN_OP_T(op, int64) \
229 DECL_ASN_OP_T(op, uint64) \
230 DECL_ASN_OP_T(op, const sc_int_base &) \
231 DECL_ASN_OP_T(op, const sc_uint_base &) \
232 DECL_ASN_OP_T(op, const sc_signed &) \
233 DECL_ASN_OP_T(op, const sc_unsigned &)
235#define DECL_ASN_OP(op) \
236 DECL_ASN_OP_T(op, int) \
237 DECL_ASN_OP_T(op, unsigned int) \
238 DECL_ASN_OP_T(op, long) \
239 DECL_ASN_OP_T(op, unsigned long) \
240 DECL_ASN_OP_T(op, float) \
241 DECL_ASN_OP_T(op, double) \
242 DECL_ASN_OP_T(op, const char *) \
243 DECL_ASN_OP_T(op, const sc_fxval &) \
244 DECL_ASN_OP_T(op, const sc_fxval_fast &) \
245 DECL_ASN_OP_T(op, const sc_fxnum &) \
246 DECL_ASN_OP_T(op, const sc_fxnum_fast &) \
247 DECL_ASN_OP_OTHER(op)
267#undef DECL_ASN_OP_OTHER
287template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
289 sc_fix(W, I, Q, O, N, observer_)
292template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
295 sc_fix(W, I, Q, O, N, cast_sw, observer_)
298#define DEFN_CTORS_T(tp) \
299template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> \
300inline sc_fixed<W, I, Q, O, N>::sc_fixed( \
301 tp a, sc_fxnum_observer* observer_) : \
302 sc_fix(a, W, I, Q, O, N, observer_) \
305template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> \
306inline sc_fixed<W, I, Q, O, N>::sc_fixed( \
307 tp a, const sc_fxcast_switch &cast_sw, \
308 sc_fxnum_observer *observer_) : \
309 sc_fix(a, W, I, Q, O, N, cast_sw, observer_) \
334template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
340template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
348#define DEFN_ASN_OP_T(op, tp) \
349template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> \
350inline sc_fixed<W, I, Q, O, N> & \
351sc_fixed<W, I, Q, O, N>::operator op (tp a) \
353 sc_fix::operator op (a); \
357#define DEFN_ASN_OP_OTHER(op) \
358DEFN_ASN_OP_T(op, int64) \
359DEFN_ASN_OP_T(op, uint64) \
360DEFN_ASN_OP_T(op, const sc_int_base &) \
361DEFN_ASN_OP_T(op, const sc_uint_base &) \
362DEFN_ASN_OP_T(op, const sc_signed &) \
363DEFN_ASN_OP_T(op, const sc_unsigned &)
365#define DEFN_ASN_OP(op) \
366DEFN_ASN_OP_T(op, int) \
367DEFN_ASN_OP_T(op, unsigned int) \
368DEFN_ASN_OP_T(op, long) \
369DEFN_ASN_OP_T(op, unsigned long) \
370DEFN_ASN_OP_T(op, float) \
371DEFN_ASN_OP_T(op, double) \
372DEFN_ASN_OP_T(op, const char *) \
373DEFN_ASN_OP_T(op, const sc_fxval &) \
374DEFN_ASN_OP_T(op, const sc_fxval_fast &) \
375DEFN_ASN_OP_T(op, const sc_fxnum &) \
376DEFN_ASN_OP_T(op, const sc_fxnum_fast &) \
397#undef DEFN_ASN_OP_OTHER
401template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
405 return sc_fxval(sc_fix::operator ++ (0));
408template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
412 return sc_fxval(sc_fix::operator -- (0));
415template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
423template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
438template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
444template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
450#define DEFN_CTORS_T(tp) \
451template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> \
452inline sc_fixed_fast<W, I, Q, O, N>::sc_fixed_fast( \
453 tp a, sc_fxnum_fast_observer *observer_) : \
454 sc_fix_fast(a, W, I, Q, O, N, observer_) \
457template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> \
458inline sc_fixed_fast<W, I, Q, O, N>::sc_fixed_fast( \
459 tp a, const sc_fxcast_switch &cast_sw, \
460 sc_fxnum_fast_observer *observer_) : \
461 sc_fix_fast(a, W, I, Q, O, N, cast_sw, observer_) \
486template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
492template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
501#define DEFN_ASN_OP_T(op, tp) \
502template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> \
503inline sc_fixed_fast<W, I, Q, O, N> & \
504sc_fixed_fast<W, I, Q, O, N>::operator op (tp a) \
506 sc_fix_fast::operator op (a); \
510#define DEFN_ASN_OP_OTHER(op) \
511DEFN_ASN_OP_T(op, int64) \
512DEFN_ASN_OP_T(op, uint64) \
513DEFN_ASN_OP_T(op, const sc_int_base &) \
514DEFN_ASN_OP_T(op, const sc_uint_base &) \
515DEFN_ASN_OP_T(op, const sc_signed &) \
516DEFN_ASN_OP_T(op, const sc_unsigned &)
518#define DEFN_ASN_OP(op) \
519DEFN_ASN_OP_T(op, int) \
520DEFN_ASN_OP_T(op, unsigned int) \
521DEFN_ASN_OP_T(op, long) \
522DEFN_ASN_OP_T(op, unsigned long) \
523DEFN_ASN_OP_T(op, float) \
524DEFN_ASN_OP_T(op, double) \
525DEFN_ASN_OP_T(op, const char *) \
526DEFN_ASN_OP_T(op, const sc_fxval &) \
527DEFN_ASN_OP_T(op, const sc_fxval_fast &) \
528DEFN_ASN_OP_T(op, const sc_fxnum &) \
529DEFN_ASN_OP_T(op, const sc_fxnum_fast &) \
550#undef DEFN_ASN_OP_OTHER
554template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
561template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
568template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
576template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
sc_fix_fast & operator--()
sc_fix_fast & operator++()
sc_fix_fast & operator=(const sc_fix_fast &)
sc_fix & operator=(const sc_fix &)
sc_fixed_fast(sc_fxnum_fast_observer *=0)
sc_fixed_fast & operator--()
sc_fixed_fast & operator=(const sc_fixed_fast< W, I, Q, O, N > &)
sc_fixed_fast & operator++()
sc_fixed(sc_fxnum_observer *=0)
sc_fixed & operator=(const sc_fixed< W, I, Q, O, N > &)
const sc_q_mode SC_DEFAULT_Q_MODE_
const sc_o_mode SC_DEFAULT_O_MODE_
const int SC_DEFAULT_N_BITS_
#define DEFN_ASN_OP_T(op, tp)
#define DECL_CTORS_T_A(tp)
#define DECL_CTORS_T_B(tp)
#define DECL_ASN_OP_T(op, tp)