70 #ifndef SC_UINT_BASE_H
71 #define SC_UINT_BASE_H
90 class sc_uint_bitref_r;
92 class sc_uint_subref_r;
99 class sc_int_subref_r;
100 class sc_signed_subref_r;
101 class sc_unsigned_subref_r;
163 {
if ( xz_present_p ) *xz_present_p =
false;
return 1; }
169 dst_p[word_i] &= ~bit_mask;
180 dst_p[word_i] |= bit_mask;
185 dst_p[word_i] &= ~bit_mask;
191 {
return operator uint64(); }
198 #ifdef SC_DT_DEPRECATED
214 {
return operator uint64 (); }
217 {
return operator uint64 (); }
222 void print( ::std::ostream& os = ::std::cout )
const
286 void scan( ::std::istream& is = ::std::cin );
345 #ifdef SC_DT_DEPRECATED
353 {
if ( xz_present_p ) *xz_present_p =
false;
return length(); }
406 void print( ::std::ostream& os = ::std::cout )
const
503 void scan( ::std::istream& is = ::std::cin );
533 void invalid_length()
const;
534 void invalid_index(
int i )
const;
535 void invalid_range(
int l,
int r )
const;
537 void check_length()
const
538 {
if( m_len <= 0 || m_len >
SC_INTWIDTH ) { invalid_length(); } }
540 void check_index(
int i )
const
541 {
if( i < 0 || i >=
m_len ) { invalid_index( i ); } }
543 void check_range(
int l,
int r )
const
544 {
if( r < 0 || l >=
m_len || l < r ) { invalid_range( l, r ); } }
546 void check_value()
const;
566 { check_length(); extend_sign(); }
580 { check_length(); extend_sign(); }
600 {
m_val = v; extend_sign();
return *
this; }
603 {
m_val = a.
m_val; extend_sign();
return *
this; }
606 {
m_val = a; extend_sign();
return *
this; }
610 {
m_val = a->to_uint64(); extend_sign();
return *
this; }
628 {
m_val = a; extend_sign();
return *
this; }
631 {
m_val = a; extend_sign();
return *
this; }
634 {
m_val = a; extend_sign();
return *
this; }
637 {
m_val = a; extend_sign();
return *
this; }
640 {
m_val = a; extend_sign();
return *
this; }
649 {
m_val += v; extend_sign();
return *
this; }
652 {
m_val -= v; extend_sign();
return *
this; }
655 {
m_val *= v; extend_sign();
return *
this; }
658 {
m_val /= v; extend_sign();
return *
this; }
661 {
m_val %= v; extend_sign();
return *
this; }
667 {
m_val &= v; extend_sign();
return *
this; }
670 {
m_val |= v; extend_sign();
return *
this; }
673 {
m_val ^= v; extend_sign();
return *
this; }
677 {
m_val <<= v; extend_sign();
return *
this; }
680 {
m_val >>= v;
return *
this; }
686 { ++
m_val; extend_sign();
return *
this; }
692 { --
m_val; extend_sign();
return *
this; }
754 #ifdef SC_DT_DEPRECATED
762 {
if ( xz_present_p ) *xz_present_p =
false;
return length(); }
804 {
return (
int)
m_val; }
807 {
return (
unsigned int)
m_val; }
810 {
return (
long)
m_val; }
813 {
return (
unsigned long)
m_val; }
841 void print( ::std::ostream& os = ::std::cout )
const
844 void scan( ::std::istream& is = ::std::cin );
874 sc_uint_bitref_r::operator
uint64 ()
const
876 return m_obj_p->test( m_index );
991 return ( (val & (~
UINT_ZERO >> uleft)) >> m_right );
1175 return ( *
this = aa = a );
1245 check_range( left, right );
1255 check_range( left, right );
1266 check_range( left, right );
1276 check_range( left, right );
sc_uint_base & operator^=(uint_type v)
sc_uint_base(uint_type v, int w)
virtual bool concat_get_ctrl(sc_digit *dst_p, int low_i) const
virtual ~sc_uint_bitref_r()
virtual void concat_set(int64 src, int low_i)
sc_uint_subref_r(const sc_uint_subref_r &init)
sc_uint_base & operator++()
friend class sc_uint_bitref_r
friend class sc_uint_signal
sc_uint_base & operator-=(uint_type v)
sc_uint_subref & range(int left, int right)
sc_uint_bitref & operator^=(bool b)
sc_uint_base & operator=(uint_type v)
virtual bool concat_get_data(sc_digit *dst_p, int low_i) const
bool operator<(const sc_int_base &a, const sc_int_base &b)
sc_logic_value_t nand_reduce(const sc_proxy< X > &a)
virtual bool concat_get_ctrl(sc_digit *dst_p, int low_i) const
sc_uint_subref & operator=(uint_type v)
static sc_core::sc_vpool< sc_uint_subref > m_pool
sc_uint_subref(const sc_uint_subref &init)
friend bool operator>=(const sc_uint_base &a, const sc_uint_base &b)
const std::string to_string(sc_numrep numrep=SC_DEC) const
sc_logic_value_t xor_reduce(const sc_proxy< X > &a)
bool sc_io_show_base(systemc_ostream &)
void initialize(const sc_uint_base *obj_p, int left_i, int right_i)
void print(::std::ostream &os=::std::cout) const
sc_uint_base & operator/=(uint_type v)
sc_uint_base & operator*=(uint_type v)
unsigned long to_ulong() const
sc_uint_base & operator&=(uint_type v)
virtual bool concat_get_data(sc_digit *dst_p, int low_i) const
uint64 const sc_uint_base int b
virtual uint64 concat_get_uint64() const
bool operator!=(const sc_bit &a, const sc_bit &b)
void initialize(const sc_uint_base *obj_p, int index_)
bool operator==(const sc_bit &a, const sc_bit &b)
sc_logic_value_t nor_reduce(const sc_proxy< X > &a)
sc_uint_bitref & operator|=(bool b)
sc_uint_subref & operator()(int left, int right)
virtual int concat_length(bool *xz_present_p) const
virtual void concat_set(int64 src, int low_i)
const uint_type mask_int[SC_INTWIDTH][SC_INTWIDTH]
friend class sc_uint_bitref
sc_numrep sc_io_base(systemc_ostream &, sc_numrep)
unsigned int to_uint() const
sc_uint_bitref & bit(int i)
const uint64 UINT64_32ONES
friend class sc_uint_subref_r
const std::string to_string(sc_numrep numrep=SC_DEC) const
sc_uint_base & operator|=(uint_type v)
virtual void concat_set(int64 src, int low_i)
unsigned long to_ulong() const
inline::std::istream & operator>>(::std::istream &is, sc_bit &a)
bool operator>=(const sc_int_base &a, const sc_int_base &b)
bool operator<=(const sc_int_base &a, const sc_int_base &b)
sc_uint_bitref & operator=(const sc_uint_bitref_r &b)
sc_logic_value_t or_reduce(const sc_proxy< X > &a)
virtual bool concat_get_ctrl(sc_digit *dst_p, int low_i) const
sc_uint_base & operator>>=(uint_type v)
sc_uint_base & operator+=(uint_type v)
friend bool operator<=(const sc_uint_base &a, const sc_uint_base &b)
void scan(::std::istream &is=::std::cin)
virtual int concat_length(bool *xz_present_p) const
sc_uint_base(int w=sc_length_param().len())
sc_uint_base(const sc_generic_base< T > &a)
virtual int concat_length(bool *xz_present_p) const
virtual uint64 concat_get_uint64() const
sc_uint_bitref_r(const sc_uint_bitref_r &init)
void print(::std::ostream &os=::std::cout) const
sc_uint_bitref & operator&=(bool b)
friend bool operator==(const sc_uint_base &a, const sc_uint_base &b)
virtual bool concat_get_data(sc_digit *dst_p, int low_i) const
sc_uint_base & operator<<=(uint_type v)
friend bool operator!=(const sc_uint_base &a, const sc_uint_base &b)
virtual ~sc_uint_subref_r()
sc_logic_value_t xnor_reduce(const sc_proxy< X > &a)
sc_uint_bitref & operator[](int i)
friend bool operator>(const sc_uint_base &a, const sc_uint_base &b)
void scan(::std::istream &is=::std::cin)
inline::std::ostream & operator<<(::std::ostream &os, const sc_bit &a)
sc_uint_base & operator--()
bool operator>(const sc_int_base &a, const sc_int_base &b)
sc_logic_value_t and_reduce(const sc_proxy< X > &a)
friend bool operator<(const sc_uint_base &a, const sc_uint_base &b)
double uint64_to_double(uint64 a)
friend class sc_uint_subref
sc_uint_base & operator%=(uint_type v)
static sc_core::sc_vpool< sc_uint_bitref > m_pool
sc_uint_base(const sc_uint_subref_r &a)
sc_uint_bitref(const sc_uint_bitref &init)
void print(::std::ostream &os=::std::cout) const
void scan(::std::istream &is=::std::cin)
unsigned int to_uint() const
virtual uint64 concat_get_uint64() const
sc_uint_base(const sc_uint_base &a)