101 template <
class X,
class Y>
109 template <
class X,
class T>
178 , typename Y::traits_type::type >
183 , typename Y::traits_type::type >
209 {
return SCAST<X&>( *this ); }
212 {
return SCAST<const X&>( *this ); }
501 #ifdef SC_DT_DEPRECATED
503 int to_signed()
const
514 void print( ::std::ostream& os = ::std::cout )
const
524 void scan( ::std::istream& is = ::std::cin );
542 template <
class X,
class Y>
545 operator &= ( sc_proxy<X>& px,
const sc_proxy<Y>& py );
548 template <
class X,
class Y>
551 operator & (
const sc_proxy<X>& px,
const sc_proxy<Y>& py );
554 #define DECL_BITWISE_AND_OP_T(tp) \
558 operator & ( tp b, const sc_proxy<X>& px );
574 #undef DECL_BITWISE_AND_OP_T
579 template <
class X,
class Y>
582 operator |= ( sc_proxy<X>& px,
const sc_proxy<Y>& py );
585 template <
class X,
class Y>
588 operator | (
const sc_proxy<X>& px,
const sc_proxy<Y>& py );
591 #define DECL_BITWISE_OR_OP_T(tp) \
595 operator | ( tp a, const sc_proxy<X>& px );
611 #undef DECL_BITWISE_OR_OP_T
616 template <
class X,
class Y>
619 operator ^= ( sc_proxy<X>& px,
const sc_proxy<Y>& py );
622 template <
class X,
class Y>
625 operator ^ (
const sc_proxy<X>& px,
const sc_proxy<Y>& py );
628 #define DECL_BITWISE_XOR_OP_T(tp) \
632 operator ^ ( tp a, const sc_proxy<X>& px );
648 #undef DECL_BITWISE_XOR_OP_T
653 template <
class X,
class Y>
656 operator == (
const sc_proxy<X>& px,
const sc_proxy<Y>& py );
658 template <
class X,
class Y>
661 operator != (
const sc_proxy<X>& px,
const sc_proxy<Y>& py );
664 #define DECL_REL_OP_T(tp) \
668 operator == ( tp b, const sc_proxy<X>& px ); \
673 operator != ( const sc_proxy<X>& px, tp b ); \
678 operator != ( tp b, const sc_proxy<X>& px );
711 x_dw = x.get_word( wi );
712 x_cw = x.get_cword( wi );
720 x.set_word( wi, x_dw );
721 x.set_cword( wi, x_cw );
731 for(
int i = wi; i < sz; ++ i ) {
739 template <
class X,
class Y>
744 if( (
void*) &px != (
void*) &py ) {
748 int min_sz =
sc_min( sz, y.size() );
750 for( ; i < min_sz; ++ i ) {
751 set_words_( x, i, y.get_word( i ), y.get_cword( i ) );
765 template <
class X,
class T>
772 int len_x = x.length();
773 int len_a = a.length();
774 if ( len_a > len_x ) len_a = len_x;
775 for( i = 0 ; i < len_a; ++ i ) {
778 for( ; i < len_x; ++ i ) {
793 if ( len_a > len_x ) len_a = len_x;
794 for( i = 0 ; i < len_a; ++ i ) {
797 for( ; i < len_x; ++ i ) {
812 if ( len_a > len_x ) len_a = len_x;
813 for( i = 0 ; i < len_a; ++ i ) {
816 for( ; i < len_x; ++ i ) {
828 int len_x = x.length();
830 if ( len_a > len_x ) len_a = len_x;
831 for( i = 0 ; i < len_a; ++ i ) {
834 for( ; i < len_x; ++ i ) {
846 int len_x = x.length();
848 if ( len_a > len_x ) len_a = len_x;
849 for( i = 0 ; i < len_a; ++ i ) {
852 for( ; i < len_x; ++ i ) {
867 int len = x.length();
868 int s_len = s.length() - 1;
869 int min_len =
sc_min( len, s_len );
871 for( ; i < min_len; ++ i ) {
872 char c = s[s_len - i - 1];
878 for( ; i < len; ++ i ) {
879 x.set_bit( i, fill );
891 int len = x.length();
892 for(
int i = 0; i < len; ++ i ) {
905 int len = x.length();
906 for(
int i = 0; i < len; ++ i ) {
907 x.set_bit( i, a[i].
value() );
938 #if defined(SC_LONG_64)
1009 if( x.size() > 1 ) {
1027 if( x.size() > 1 ) {
1050 for(
int i = 0; i < sz; ++ i ) {
1053 x.set_word( i, x_cw | ~x_dw );
1062 template <
class X,
class Y>
1069 assert( x.length() == y.length() );
1071 for(
int i = 0; i < sz; ++ i ) {
1075 sc_digit cw = (x_dw & y_cw) | (x_cw & y_dw) | (x_cw & y_cw);
1086 template <
class X,
class Y>
1093 assert( x.length() == y.length() );
1095 for(
int i = 0; i < sz; ++ i ) {
1099 sc_digit cw = (x_cw & y_cw) | (x_cw & ~y_dw) | (~x_dw & y_cw);
1110 template <
class X,
class Y>
1117 assert( x.length() == y.length() );
1119 for(
int i = 0; i < sz; ++ i ) {
1143 "left shift operation is only allowed with positive "
1144 "shift values, shift value = %d", n );
1147 if( n >= x.length() ) {
1158 for( ; i >= wn; -- i ) {
1159 set_words_( x, i, x.get_word( i - wn ), x.get_cword( i - wn ) );
1161 for( ; i >= 0; -- i ) {
1167 for(
int i = sz - 1; i >= 1; -- i ) {
1199 "right shift operation is only allowed with positive "
1200 "shift values, shift value = %d", n );
1203 if( n >= x.length() ) {
1214 for( ; i < (sz - wn); ++ i ) {
1215 set_words_( x, i, x.get_word( i + wn ), x.get_cword( i + wn ) );
1217 for( ; i < sz; ++ i ) {
1223 for(
int i = 0; i < (sz - 1); ++ i ) {
1267 int len = x.length();
1268 int half_len = len / 2;
1269 for(
int i = 0, j = len - 1; i < half_len; ++ i, --j ) {
1271 x.set_bit( i, x.get_bit( j ) );
1290 const X& x = back_cast();
1292 int len = x.length();
1293 for(
int i = 0; i < len; ++ i ) {
1304 const X& x = back_cast();
1306 int len = x.length();
1307 for(
int i = 0; i < len; ++ i ) {
1318 const X& x = back_cast();
1320 int len = x.length();
1321 for(
int i = 0; i < len; ++ i ) {
1330 template <
class X,
class Y>
1335 return !( px == py );
1339 #define DEFN_REL_OP_T(tp) \
1340 template <class X> \
1343 operator == ( tp b, const sc_proxy<X>& px ) \
1345 return ( px == b ); \
1348 template <class X> \
1351 operator != ( const sc_proxy<X>& px, tp b ) \
1353 return !( px == b ); \
1356 template <class X> \
1359 operator != ( tp b, const sc_proxy<X>& px ) \
1361 return !( px == b ); \
1378 #undef DEFN_REL_OP_T
1388 const X& x = back_cast();
1389 int len = x.length();
1391 for(
int i = 0; i < len; ++ i ) {
1423 back_cast() = s.c_str();
1432 if( n < 0 || n >= back_cast().length() ) {
1442 if( n < 0 || n >= back_cast().size() ) {
1455 const X& x = back_cast();
1456 int len = x.length();
1474 const X& x = back_cast();
1475 int len = x.length();
1479 uint64 w = x.get_word( 0 );
1485 uint64 w1 = x.get_word( 1 );
1504 const X& x = back_cast();
1505 int len = x.length();
1524 return (
int64)( w & (~zero >> (64 - len)) );
1526 return (
int64)( w | (~zero << len) );
1589 operator << ( ::std::ostream& os, const sc_proxy<X>& a )
sc_subref_r< X > range(int hi, int lo) const
sc_logic_value_t xnor_reduce() const
X & b_and_assign_(sc_proxy< X > &px, const sc_proxy< Y > &py)
X & assign_(const sc_unsigned &a)
const X & back_cast() const
const sc_bit operator|(const sc_bit &a, const sc_bit &b)
#define SC_REPORT_ERROR(msg_type, msg)
X & operator^=(sc_proxy< X > &px, const sc_proxy< Y > &py)
const std::string convert_to_fmt(const std::string &s, sc_numrep numrep, bool)
#define DECL_BITWISE_AND_OP_T(tp)
const sc_bit operator^(const sc_bit &a, const sc_bit &b)
X & b_or_assign_(sc_proxy< X > &px, const sc_proxy< Y > &py)
void set_words_(X &x, int wi, sc_digit x_dw, sc_digit x_cw)
const sc_digit SC_DIGIT_TWO
const std::string to_string() const
sc_logic_value_t nand_reduce(const sc_proxy< X > &a)
X & assign_(const sc_int_base &a)
X & assign_(const sc_signed &a)
sc_logic_value_t xor_reduce(const sc_proxy< X > &a)
X & operator|=(sc_proxy< X > &px, const sc_proxy< Y > &py)
bool sc_io_show_base(systemc_ostream &)
sc_logic_value_t or_reduce() const
sc_subref< X > range(int hi, int lo)
static const char logic_to_char[4]
sc_digit to_anything_unsigned() const
#define SC_REPORT_WARNING(msg_type, msg)
uint64 const sc_uint_base int b
bool operator!=(const sc_bit &a, const sc_bit &b)
bool operator==(const sc_bit &a, const sc_bit &b)
sc_logic_value_t nor_reduce(const sc_proxy< X > &a)
unsigned int to_uint() const
X & operator&=(sc_proxy< X > &px, const sc_proxy< Y > &py)
#define DECL_BITWISE_XOR_OP_T(tp)
sc_numrep sc_io_base(systemc_ostream &, sc_numrep)
#define DECL_BITWISE_OR_OP_T(tp)
const sc_digit SC_DIGIT_ONE
sc_proxy_traits< sc_lv_base > traits_type
traits_type::bit_type bit_type
static const sc_logic_value_t xor_table[4][4]
inline::std::istream & operator>>(::std::istream &is, sc_bit &a)
void assign_v_(sc_proxy< X > &px, const T &a)
const sc_lv_base operator^(const char *b) const
const sc_lv_base operator~() const
sc_logic_value_t or_reduce(const sc_proxy< X > &a)
static const sc_logic_value_t or_table[4][4]
void get_words_(const X &x, int wi, sc_digit &x_dw, sc_digit &x_cw)
const T sc_min(const T &a, const T &b)
X & assign_(const sc_proxy< Y > &a)
const sc_digit SC_DIGIT_ZERO
sc_logic_value_t nor_reduce() const
unsigned long to_ulong() const
sc_subref< X > operator()(int hi, int lo)
sc_logic_value_t and_reduce() const
void assign_p_(sc_proxy< X > &px, const sc_proxy< Y > &py)
X & b_xor_assign_(sc_proxy< X > &a, const sc_proxy< Y > &b)
const sc_lv_base operator<<(int n) const
sc_proxy_traits< X >::type traits_type
sc_logic_value_t value_type
#define DEFN_REL_OP_T(tp)
int64 to_anything_signed() const
bool operator==(const char *b) const
sc_bitref< X > operator[](int i)
static const sc_logic_value_t char_to_logic[128]
void check_bounds(int n) const
X & operator|=(const char *b)
#define DECL_REL_OP_T(tp)
static const sc_logic_value_t and_table[4][4]
void print(::std::ostream &os=::std::cout) const
sc_logic_value_t nand_reduce() const
const std::string convert_to_bin(const char *s)
const sc_lv_base lrotate(const sc_proxy< X > &x, int n)
X & operator&=(const char *b)
sc_bitref_r< X > bit(int i) const
X & assign_(const sc_uint_base &a)
sc_logic_value_t xnor_reduce(const sc_proxy< X > &a)
void extend_sign_w_(X &x, int wi, bool sign)
sc_logic_value_t and_reduce(const sc_proxy< X > &a)
const char SC_ID_OUT_OF_BOUNDS_[]
const sc_lv_base operator&(const char *b) const
const sc_lv_base rrotate(const sc_proxy< X > &x, int n)
sc_clock period is zero sc_clock low time is zero sc_fifo< T > cannot have more than one writer bind interface to port failed complete binding failed remove port failed insert primitive channel failed sc_signal< T > cannot have more than one driver resolved port not bound to resolved signal sc_semaphore requires an initial value
X & operator^=(const char *b)
sc_logic_value_t xor_reduce() const
void scan(::std::istream &is=::std::cin)
static const sc_logic_value_t not_table[4]
const sc_lv_base operator|(const char *b) const
const sc_lv_base reverse(const sc_proxy< X > &x)
sc_bitref< X > bit(int i)
const sc_bit operator&(const sc_bit &a, const sc_bit &b)
const std::string to_string(sc_enc)
const sc_lv_base operator>>(int n) const
void check_wbounds(int n) const
sc_proxy_traits< sc_bv_base > traits_type