92 class sc_int_bitref_r;
94 class sc_int_subref_r;
97 class sc_signed_subref_r;
98 class sc_unsigned_subref_r;
125 inline bool operator == (
const sc_int_base& a,
const sc_int_base&
b );
127 inline bool operator != (
const sc_int_base& a,
const sc_int_base&
b );
129 inline bool operator < (
const sc_int_base& a,
const sc_int_base&
b );
131 inline bool operator <= (
const sc_int_base& a,
const sc_int_base&
b );
133 inline bool operator > (
const sc_int_base& a,
const sc_int_base&
b );
135 inline bool operator >= (
const sc_int_base& a,
const sc_int_base&
b );
181 #ifdef SC_DT_DEPRECATED 189 {
if (xz_present_p) *xz_present_p =
false;
return 1; }
195 dst_p[word_i] &= ~bit_mask;
206 dst_p[word_i] |= bit_mask;
211 dst_p[word_i] &= ~bit_mask;
217 {
return operator uint64(); }
225 bool operator ! ()
const;
232 {
return operator uint64(); }
235 {
return operator uint64(); }
240 void print( ::std::ostream& os = ::std::cout )
const 297 virtual void concat_set(
int64 src,
int low_i);
298 virtual void concat_set(
const sc_signed& src,
int low_i);
299 virtual void concat_set(
const sc_unsigned& src,
int low_i);
300 virtual void concat_set(
uint64 src,
int low_i);
305 void scan( ::std::istream& is = ::std::cin );
328 friend class sc_int_signal;
364 {
return ( m_left - m_right + 1 ); }
366 #ifdef SC_DT_DEPRECATED 374 {
if ( xz_present_p ) *xz_present_p =
false;
return length(); }
375 virtual bool concat_get_ctrl(
sc_digit* dst_p,
int low_i )
const;
376 virtual bool concat_get_data(
sc_digit* dst_p,
int low_i )
const;
417 unsigned int to_uint()
const;
418 long to_long()
const;
419 unsigned long to_ulong()
const;
420 int64 to_int64()
const;
422 double to_double()
const;
433 void print( ::std::ostream& os = ::std::cout )
const 485 {
return operator = ( a.operator
uint_type() ); }
488 {
return operator = ( a.operator
uint_type() ); }
492 {
return operator = ( a->to_int64() ); }
497 {
return operator = ( (
int_type) a ); }
500 {
return operator = ( (
int_type) a ); }
503 {
return operator = ( (
int_type) a ); }
506 {
return operator = ( (
int_type) a ); }
509 {
return operator = ( (
int_type) a ); }
512 {
return operator = ( (
int_type) a ); }
521 virtual void concat_set(
int64 src,
int low_i);
522 virtual void concat_set(
const sc_signed& src,
int low_i);
523 virtual void concat_set(
const sc_unsigned& src,
int low_i);
524 virtual void concat_set(
uint64 src,
int low_i);
528 void scan( ::std::istream& is = ::std::cin );
558 void invalid_length()
const;
559 void invalid_index(
int i )
const;
560 void invalid_range(
int l,
int r )
const;
562 void check_length()
const 563 {
if( m_len <= 0 || m_len >
SC_INTWIDTH ) { invalid_length(); } }
565 void check_index(
int i )
const 566 {
if( i < 0 || i >= m_len ) { invalid_index( i ); } }
568 void check_range(
int l,
int r )
const 569 {
if( r < 0 || l >= m_len || l < r ) { invalid_range( l, r ); } }
571 void check_value()
const;
578 m_val = ( m_val << m_ulen >> m_ulen );
586 : m_val( 0 ), m_len( w ), m_ulen(
SC_INTWIDTH - m_len )
590 : m_val( v ), m_len( w ), m_ulen(
SC_INTWIDTH - m_len )
591 { check_length(); extend_sign(); }
599 : m_val( a ), m_len( a.length() ), m_ulen(
SC_INTWIDTH - m_len )
604 m_val( a->to_int64() ), m_len( a->length() ),
606 { check_length(); extend_sign(); }
626 { m_val = v; extend_sign();
return *
this; }
629 { m_val = a.
m_val; extend_sign();
return *
this; }
632 { m_val = a; extend_sign();
return *
this; }
636 { m_val = a->to_int64(); extend_sign();
return *
this; }
654 { m_val = a; extend_sign();
return *
this; }
657 { m_val = a; extend_sign();
return *
this; }
660 { m_val = a; extend_sign();
return *
this; }
663 { m_val = a; extend_sign();
return *
this; }
666 { m_val = a; extend_sign();
return *
this; }
669 { m_val = (
int_type) a; extend_sign();
return *
this; }
675 { m_val += v; extend_sign();
return *
this; }
678 { m_val -= v; extend_sign();
return *
this; }
681 { m_val *= v; extend_sign();
return *
this; }
684 { m_val /= v; extend_sign();
return *
this; }
687 { m_val %= v; extend_sign();
return *
this; }
693 { m_val &= v; extend_sign();
return *
this; }
696 { m_val |= v; extend_sign();
return *
this; }
699 { m_val ^= v; extend_sign();
return *
this; }
703 { m_val <<= v; extend_sign();
return *
this; }
706 { m_val >>= v;
return *
this; }
712 { ++ m_val; extend_sign();
return *
this; }
715 {
sc_int_base tmp( *
this ); ++ m_val; extend_sign();
return tmp; }
718 { -- m_val; extend_sign();
return *
this; }
721 {
sc_int_base tmp( *
this ); -- m_val; extend_sign();
return tmp; }
766 {
return ( 0 != (m_val & (
UINT_ONE << i)) ); }
771 void set(
int i,
bool v )
780 #ifdef SC_DT_DEPRECATED 788 {
if ( xz_present_p ) *xz_present_p =
false;
return length(); }
789 virtual bool concat_get_ctrl(
sc_digit* dst_p,
int low_i )
const;
790 virtual bool concat_get_data(
sc_digit* dst_p,
int low_i )
const;
798 virtual void concat_set(
int64 src,
int low_i);
799 virtual void concat_set(
const sc_signed& src,
int low_i);
800 virtual void concat_set(
const sc_unsigned& src,
int low_i);
801 virtual void concat_set(
uint64 src,
int low_i);
835 {
return (
int) m_val; }
838 {
return (
unsigned int) m_val; }
841 {
return (
long) m_val; }
844 {
return (
unsigned long) m_val; }
847 {
return (
int64) m_val; }
850 {
return (
uint64) m_val; }
853 {
return (
double) m_val; }
871 void print( ::std::ostream& os = ::std::cout )
const 874 void scan( ::std::istream& is = ::std::cin );
904 sc_int_bitref_r::operator
uint64 ()
const 906 return m_obj_p->test( m_index );
913 return ! m_obj_p->test( m_index );
920 return ! m_obj_p->test( m_index );
946 m_obj_p->set( m_index, (
bool) b );
947 m_obj_p->extend_sign();
955 m_obj_p->set( m_index, (
bool) b );
956 m_obj_p->extend_sign();
964 m_obj_p->set( m_index, b );
965 m_obj_p->extend_sign();
975 m_obj_p->set( m_index, b );
976 m_obj_p->extend_sign();
986 m_obj_p->set( m_index, b );
987 m_obj_p->extend_sign();
997 m_obj_p->m_val ^= (
UINT_ONE << m_index);
998 m_obj_p->extend_sign();
1027 int uright = uleft + m_right;
1028 return ( val << uleft >> uright );
1065 int result =
static_cast<int>(
operator uint_type());
1073 unsigned int result =
static_cast<unsigned int>(
operator uint_type());
1081 long result =
static_cast<long>(
operator uint_type());
1089 unsigned long result =
static_cast<unsigned long>(
operator uint_type());
1113 double result =
static_cast<double>(
operator uint_type());
1206 return operator = ( a.operator
int_type() );
1214 return ( *
this = aa = a );
1284 check_range( left, right );
1294 check_range( left, right );
1305 check_range( left, right );
1315 check_range( left, right );
void print(::std::ostream &os=::std::cout) const
virtual bool concat_get_ctrl(sc_digit *dst_p, int low_i) const
Base class for the fixed-point types; limited precision.
void print(::std::ostream &os=::std::cout) const
virtual ~sc_int_subref_r()
sc_int_bitref & operator^=(bool b)
Proxy class for sc_uint part selection (r-value only).
bool operator==(const sc_bit &a, const sc_bit &b)
Proxy class for sc_int part selection (r-value only).
Fixed-point value types; limited precision.
sc_int_base(const sc_int_subref_r &a)
sc_proxy< X >::value_type nand_reduce(const sc_proxy< X > &a)
virtual int concat_length(bool *xz_present_p) const
X & operator&=(sc_proxy< X > &px, const sc_proxy< Y > &py)
void scan(::std::istream &is=::std::cin)
Report ids for the datatypes/int code.
virtual ~sc_int_bitref_r()
Proxy class for sc_unsigned part selection (r-value only).
sc_proxy< X >::value_type xnor_reduce(const sc_proxy< X > &a)
void print(::std::ostream &os=::std::cout) const
sc_int_bitref & operator|=(bool b)
void scan(::std::istream &is=::std::cin)
unsigned int to_uint() const
static sc_core::sc_vpool< sc_int_bitref > m_pool
sc_proxy< X >::value_type nor_reduce(const sc_proxy< X > &a)
static const uint64 UINT_ONE
X & operator|=(sc_proxy< X > &px, const sc_proxy< Y > &py)
Arbitrary precision signed number.
virtual bool concat_get_data(sc_digit *dst_p, int low_i) const
void initialize(const sc_int_base *obj_p, int left_i, int right_i)
Abstract base class of all SystemC native variables.
sc_int_base(int w=sc_length_param().len())
Arbitrary precision unsigned number.
Base class for the fixed-point types; arbitrary precision.
Base class for SystemC bit values.
sc_int_subref_r(const sc_int_subref_r &a)
uint64 const sc_uint_base int b
virtual uint64 concat_get_uint64() const
bool operator!=(const sc_bit &a, const sc_bit &b)
sc_proxy< X >::value_type xor_reduce(const sc_proxy< X > &a)
static sc_core::sc_vpool< sc_int_subref > m_pool
unsigned long to_ulong() const
Proxy class for sc_int bit selection (r-value and l-value).
Fixed-point value type; arbitrary precision.
An unsigned integer whose length is less than 64 bits.
unsigned int to_uint() const
sc_int_bitref & operator&=(bool b)
Arbitrary size logic vector base class.
sc_proxy< X >::value_type or_reduce(const sc_proxy< X > &a)
bool operator>=(const sc_int_base &a, const sc_int_base &b)
sc_int_bitref & bit(int i)
unsigned long to_ulong() const
bool operator<(const sc_int_base &a, const sc_int_base &b)
const std::string to_string(sc_numrep numrep=SC_DEC) const
SC_API const std::string to_string(sc_enc)
Proxy class for sc_int part selection (r-value and l-value).
void initialize(const sc_int_base *obj_p, int index_)
bool operator>(const sc_int_base &a, const sc_int_base &b)
Abstract base class of all SystemC `simulation' objects.
Proxy class for user-defined value classes and other classes that.
Proxy class for sc_int bit selection (r-value only).
sc_numrep
Enumeration of number representations for character string conversion.
sc_int_base(int_type v, int w)
const std::string to_string(sc_numrep numrep=SC_DEC) const
sc_int_base(const sc_int_base &a)
void scan(::std::istream &is=::std::cin)
Proxy class for sc_signed part selection (r-value only).
static const uint64 UINT64_32ONES
virtual uint64 concat_get_uint64() const
X & operator^=(sc_proxy< X > &px, const sc_proxy< Y > &py)
sc_int_bitref(const sc_int_bitref &a)
virtual int concat_length(bool *xz_present_p) const
virtual uint64 concat_get_uint64() const
sc_int_bitref & operator=(const sc_int_bitref_r &b)
sc_int_bitref_r(const sc_int_bitref_r &a)
#define SC_API_TEMPLATE_DECL_
sc_int_subref(const sc_int_subref &a)
sc_numrep sc_io_base(::std::ostream &, sc_numrep)
virtual int concat_length(bool *xz_present_p) const
Top level header file for arbitrary precision signed/unsigned.
SC_API const uint_type mask_int[SC_INTWIDTH][SC_INTWIDTH]
Temporary value pool classes.
sc_int_base(const sc_generic_base< T > &a)
sc_int_subref & range(int left, int right)
inline ::std::ostream & operator<<(::std::ostream &os, const sc_bit &a)
const sc_bit operator~(const sc_bit &a)
Arbitrary size bit vector base class.
sc_int_bitref & operator[](int i)
bool sc_io_show_base(::std::ostream &)
sc_proxy< X >::value_type and_reduce(const sc_proxy< X > &a)
sc_int_subref & operator()(int left, int right)
bool operator<=(const sc_int_base &a, const sc_int_base &b)
inline ::std::istream & operator>>(::std::istream &is, sc_bit &a)
sc_int_subref & operator=(int_type v)