89 #if defined(__GNUC__) || defined(_MSC_VER) || defined(__SUNPRO_CC)
94 if ( flags & ::std::ios::dec )
return SC_DEC;
95 if ( flags & ::std::ios::hex )
return SC_HEX;
96 if ( flags & ::std::ios::oct )
return SC_OCT;
103 return (os.flags() & ::std::ios::showbase) != 0 ;
142 "is_valid_base( sc_numrep base ) : "
143 "bases SC_CSD, or ending in _US and _SM are not supported" );
147 std::sprintf( msg,
"is_valid_base( sc_numrep base ) : "
148 "base = %s is not valid",
439 assert((ulen >= 0) && (u != NULL));
440 assert((vlen >= 0) && (v != NULL));
442 assert((ulen <= 0) || (u[ulen - 1] != 0));
443 assert((vlen <= 0) || (v[vlen - 1] != 0));
447 return (ulen - vlen);
450 while ((--ulen >= 0) && (u[ulen] == v[ulen]))
459 assert((u[ulen] &
DIGIT_MASK) != (v[ulen] & DIGIT_MASK));
462 return (
int) (u[ulen] - v[ulen]);
477 assert((ulen > 0) && (u != NULL));
480 while ((--ulen >= 0) && (! u[ulen]))
498 assert((ulen > 0) && (u != NULL));
516 assert((ulen > 0) && (u != NULL));
517 assert((vlen > 0) && (v != NULL));
523 return vec_cmp(ulen, u, vlen, v);
534 assert((ulen > 0) && (u != NULL));
537 for(
int i = from; i < ulen; i++)
557 assert((n > 0) && (u != NULL) && (v != NULL));
560 for (
int i = 0; i < n; ++i)
572 assert((ulen > 0) && (u != NULL));
573 assert((vlen > 0) && (v != NULL));
574 assert(ulen >= vlen);
589 assert((ulen > 0) && (u != NULL));
594 for (
int i = 0; i < ulen; ++i) {
609 template<
class Type >
617 assert((ulen > 0) && (u != NULL));
623 while (v && (i < ulen)) {
639 template<
class Type >
652 if(
SC_LIKELY_( u > (std::numeric_limits<Type>::min)() ) )
687 if (nb > SC_MAX_NBITS) {
689 std::sprintf( msg,
"test_bound( int nb ) : "
690 "nb = %d > SC_MAX_NBITS = %d is not valid",
698 template<
class Type >
705 "div_by_zero<Type>( Type ) : division by zero" );
723 assert((ulen > 0) && (u != NULL));
742 assert((ulen > 0) && (u != NULL));
775 assert((nb > 0) && (nd > 0) && (d != NULL));
790 trim(added, nb, nd, d);
816 assert((nb > 0) && (nd > 0) && (d != NULL));
831 assert((nb > 0) && (nd > 0) && (d != NULL));
899 assert((nb > 0) && (nd > 0) && (d != NULL));
956 int vnb,
int vnd,
const sc_digit *vd)
1001 #ifdef DEBUG_SYSTEMC
1002 assert((i >= 0) && (d != NULL));
1024 return std::numeric_limits<double>::has_quiet_NaN && (v != v);
1031 return v == std::numeric_limits<double>::infinity()
1032 || v == -std::numeric_limits<double>::infinity();
1042 "is_bad_double( double v ) : "
1043 "v is not finite - NaN or Inf" );
void safe_set(int i, bool v, sc_digit *d)
void convert_signed_SM_to_2C(small_type s, int nd, sc_digit *d)
void parse_hex_bits(const char *src_p, int dst_n, sc_digit *data_p, sc_digit *ctrl_p=0)
void vec_sub_small(int ulen, const sc_digit *u, sc_digit v, sc_digit *w)
small_type convert_signed_2C_to_SM(int nb, int nd, sc_digit *d)
small_type mul_signs(small_type us, small_type vs)
#define SC_REPORT_ERROR(msg_type, msg)
void vec_complement(int ulen, sc_digit *u)
sc_digit one_and_zeros(int n)
void copy_digits_signed(small_type &us, int unb, int und, sc_digit *ud, int vnb, int vnd, const sc_digit *vd)
void vec_add(int ulen, const sc_digit *u, int vlen, const sc_digit *v, sc_digit *w)
small_type convert_unsigned_SM_to_2C_to_SM(small_type s, int nb, int nd, sc_digit *d)
void convert_SM_to_2C(small_type s, int nd, sc_digit *d)
sc_digit high_half(sc_digit d)
void vec_div_small(int ulen, const sc_digit *u, sc_digit v, sc_digit *w)
void vec_mul_small_on(int ulen, sc_digit *u, sc_digit v)
void vec_from_char(int ulen, const uchar *u, int vlen, sc_digit *v)
void vec_shift_right(int vlen, sc_digit *u, int nsr, sc_digit fill=0)
void convert_unsigned_SM_to_2C_trimmed(small_type s, int nb, int nd, sc_digit *d)
int vec_find_first_nonzero(int ulen, const sc_digit *u)
bool sc_io_show_base(systemc_ostream &)
const char * get_base_and_sign(const char *v, small_type &base, small_type &sign)
void vec_reverse(int unb, int und, sc_digit *ud, int l, int r=0)
void copy_digits_unsigned(small_type &us, int unb, int und, sc_digit *ud, int, int vnd, const sc_digit *vd)
void vec_add_on2(int ulen, sc_digit *u, int vlen, const sc_digit *v)
void vec_zero(int from, int ulen, sc_digit *u)
void vec_sub_small_on(int ulen, sc_digit *u, sc_digit v)
int vec_skip_and_cmp(int ulen, const sc_digit *u, int vlen, const sc_digit *v)
sc_digit vec_rem_small(int ulen, const sc_digit *u, sc_digit v)
::std::ios::fmtflags fmtflags
small_type convert_unsigned_2C_to_SM(int nb, int nd, sc_digit *d)
uint64 const sc_uint_base int b
void is_valid_base(sc_numrep base)
sc_digit low_half(sc_digit d)
void vec_sub(int ulen, const sc_digit *u, int vlen, const sc_digit *v, sc_digit *w)
void is_bad_double(double v)
void vec_add_small(int ulen, const sc_digit *u, sc_digit v, sc_digit *w)
void vec_mul(int ulen, const sc_digit *u, int vlen, const sc_digit *v, sc_digit *w)
small_type fsm_move(char c, small_type &b, small_type &s, small_type &state)
sc_numrep sc_io_base(systemc_ostream &, sc_numrep)
sc_digit one_and_ones(int n)
void vec_copy_and_zero(int ulen, sc_digit *u, int vlen, const sc_digit *v)
void trim(small_type added, int nb, int nd, sc_digit *d)
void vec_rem_large(int ulen, const sc_digit *u, int vlen, const sc_digit *v, sc_digit *w)
void vec_sub_on(int ulen, sc_digit *u, int vlen, const sc_digit *v)
small_type check_for_zero(small_type s, int ulen, const sc_digit *u)
void convert_SM_to_2C_trimmed(small_type added, small_type s, int nb, int nd, sc_digit *d)
int vec_cmp(int ulen, const sc_digit *u, int vlen, const sc_digit *v)
void convert_unsigned_SM_to_2C(small_type s, int nd, sc_digit *d)
int vec_to_char(int ulen, const sc_digit *u, int vlen, uchar *v)
sc_digit high_half_masked(sc_digit d)
const char SC_ID_NOT_IMPLEMENTED_[]
void vec_add_on(int ulen, sc_digit *u, int vlen, const sc_digit *v)
sc_digit vec_rem_on_small(int ulen, sc_digit *u, sc_digit v)
void convert_signed_SM_to_2C_trimmed(small_type s, int nb, int nd, sc_digit *d)
void vec_sub_on2(int ulen, sc_digit *u, int vlen, const sc_digit *v)
void vec_div_large(int ulen, const sc_digit *u, int vlen, const sc_digit *v, sc_digit *w)
void trim_signed(int nb, int nd, sc_digit *d)
::std::ostream systemc_ostream
void trim_unsigned(int nb, int nd, sc_digit *d)
void parse_binary_bits(const char *src_p, int dst_n, sc_digit *data_p, sc_digit *ctrl_p=0)
void vec_add_small_on(int ulen, sc_digit *u, sc_digit v)
void vec_shift_left(int ulen, sc_digit *u, int nsl)
void from_uint(int ulen, sc_digit *u, Type v)
void vec_copy(int n, sc_digit *u, const sc_digit *v)
inline::std::ostream & operator<<(::std::ostream &os, const sc_bit &a)
const char SC_ID_OUT_OF_BOUNDS_[]
void vec_mul_small(int ulen, const sc_digit *u, sc_digit v, sc_digit *w)
int vec_skip_leading_zeros(int ulen, const sc_digit *u)
#define BITS_PER_HALF_DIGIT
sc_concref_r< sc_bitref_r< T1 >, sc_bitref_r< T2 > > concat(sc_bitref_r< T1 >, sc_bitref_r< T2 >)
small_type convert_signed_SM_to_2C_to_SM(small_type s, int nb, int nd, sc_digit *d)
const std::string to_string(sc_enc)
small_type get_sign(Type &u)
small_type make_zero(int nd, sc_digit *d)
small_type vec_from_str(int unb, int und, sc_digit *u, const char *v, sc_numrep base=SC_NOBASE)