92 static void invalid_value(
char );
93 static void invalid_value(
int );
95 static bool to_value(
char c )
97 if( c !=
'0' && c !=
'1' ) {
100 return ( c ==
'0' ?
false :
true );
103 static bool to_value(
int i )
105 if( i != 0 && i != 1 ) {
108 return ( i == 0 ?
false :
true );
110 static bool to_value(
bool b )
113#define DEFN_TO_VALUE_T(tp) \
114 static bool to_value( tp i ) \
115 { return to_value( (int) i); }
123#undef DEFN_TO_VALUE_T
136#define DEFN_CTOR_T(tp) \
137 explicit sc_bit( tp a ) \
138 : m_val( to_value(a) ) \
139 { sc_deprecated_sc_bit(); }
174 { m_val =
b.
m_val;
return *
this; }
176#define DEFN_ASN_OP_T(op,tp) \
177 sc_bit& operator op( tp b ) \
178 { return ( *this op sc_bit( b ) ); }
179#define DEFN_ASN_OP(op) \
180 DEFN_ASN_OP_T(op,int) \
181 DEFN_ASN_OP_T(op,bool) \
182 DEFN_ASN_OP_T(op,char)
196 { m_val = ( m_val &&
b.
m_val );
return *
this; }
199 { m_val = ( m_val ||
b.
m_val );
return *
this; }
202 { m_val = ( m_val !=
b.
m_val );
return *
this; }
216 operator bool ()
const
219 bool operator ! () const
229 {
return ( m_val ?
'1' :
'0' ); }
250 { m_val = ( ! m_val );
return *
this; }
260 void print( ::std::ostream& os = ::std::cout )
const
263 void scan( ::std::istream& = ::std::cin );
272#define DEFN_BIN_FUN_T(ret,fun,tp) \
273 inline ret fun( const sc_bit& a, tp b ) \
274 { return fun(a, sc_bit(b) ); } \
275 inline ret fun( tp b, const sc_bit& a ) \
276 { return fun( sc_bit(a), b ); }
278#define DEFN_BIN_FUN(ret,fun) \
279 DEFN_BIN_FUN_T(ret,fun,bool) \
280 DEFN_BIN_FUN_T(ret,fun,char) \
281 DEFN_BIN_FUN_T(ret,fun,int)
286 {
return ( a.m_val ==
b.
m_val ); }
289 {
return ( a.m_val !=
b.
m_val ); }
297 {
return ( a ==
b ); }
300 {
return ( a !=
b ); }
313 {
return sc_bit( ! a.m_val ); }
361#define DEFN_TRN_FUN_T(fun,tp) \
362 inline void fun( sc_bit& r, const sc_bit& a, tp b ) \
363 { r = fun( a, sc_bit(b) ); } \
364 inline void fun( sc_bit& r, tp a, const sc_bit& b ) \
365 { r = fun( sc_bit(a), b ); }
367#define DEFN_TRN_FUN(fun) \
368 inline void fun( sc_bit& r, const sc_bit& a, const sc_bit& b ) \
369 { r = fun( a , b ); } \
370 DEFN_TRN_FUN_T(fun,int) \
371 DEFN_TRN_FUN_T(fun,bool) \
372 DEFN_TRN_FUN_T(fun,char)
#define DEFN_BIN_FUN(ret, fun)
#define DEFN_TRN_FUN(fun)
#define DEFN_ASN_OP_T(op, tp)
#define DEFN_TO_VALUE_T(tp)
sc_bit b_and(const sc_bit &a, const sc_bit &b)
X & operator|=(sc_proxy< X > &px, const sc_proxy< Y > &py)
sc_bit operator&(const sc_bit &a, const sc_bit &b)
sc_bit operator^(const sc_bit &a, const sc_bit &b)
sc_bit b_or(const sc_bit &a, const sc_bit &b)
X & operator^=(sc_proxy< X > &px, const sc_proxy< Y > &py)
unsigned long long uint64
bool operator==(const sc_bit &a, const sc_bit &b)
bool equal(const sc_bit &a, const sc_bit &b)
void sc_deprecated_sc_bit()
bool not_equal(const sc_bit &a, const sc_bit &b)
sc_bit b_not(const sc_bit &a)
sc_bit b_xor(const sc_bit &a, const sc_bit &b)
bool operator!=(const sc_bit &a, const sc_bit &b)
inline::std::istream & operator>>(::std::istream &is, sc_bit &a)
inline::std::ostream & operator<<(::std::ostream &os, const sc_bit &a)
uint64 const sc_uint_base int b
sc_bit operator~(const sc_bit &a)
sc_bit operator|(const sc_bit &a, const sc_bit &b)
void print(::std::ostream &os=::std::cout) const
sc_bit(const sc_logic &a)
void scan(::std::istream &=::std::cin)