120 m_len_r = right.concat_length(&right_xz);
121 m_len = left.concat_length(&left_xz) + m_len_r;
122 m_flags = ( left_xz || right_xz ) ? cf_xz_present : cf_none;
134 m_len_r = right.concat_length(&right_xz);
135 m_len = left.concat_length(&left_xz) + m_len_r;
136 m_flags = ( left_xz || right_xz ) ? cf_xz_present : cf_none;
150#ifdef SC_DT_DEPRECATED
160 *xz_present_p = m_flags & cf_xz_present ? true :
false;
166 m_left_p->concat_clear_data(to_ones);
167 m_right_p->concat_clear_data(to_ones);
172 bool rnz = m_right_p->concat_get_ctrl( dst_p, low_i );
173 bool lnz = m_left_p->concat_get_ctrl( dst_p, low_i+m_len_r );
179 bool rnz = m_right_p->concat_get_data( dst_p, low_i );
180 bool lnz = m_left_p->concat_get_data( dst_p, low_i+m_len_r );
187 return m_right_p->concat_get_uint64();
190 return (m_left_p->concat_get_uint64() << m_len_r) |
191 m_right_p->concat_get_uint64();
197 m_right_p->concat_set( src, low_i );
198 m_left_p->concat_set( src, low_i+m_len_r);
203 m_right_p->concat_set( src, low_i );
204 m_left_p->concat_set( src, low_i+m_len_r);
209 m_right_p->concat_set( src, low_i );
210 m_left_p->concat_set( src, low_i+m_len_r);
215 m_right_p->concat_set( src, low_i );
216 m_left_p->concat_set( src, low_i+m_len_r);
227 result = m_right_p->concat_get_uint64();
231 result = (m_left_p->concat_get_uint64() << m_len_r) |
232 (result & ~(mask << m_len_r));
237 result = result & ~(mask << m_len);
246 result_p->
nbits = result_p->num_bits(m_len);
254 m_right_p->concat_get_data( result_p->
digit, 0 );
255 m_left_p->concat_get_data(result_p->
digit, m_len_r);
262 return (
int64)to_uint64();
265 {
return (
int)to_int64(); }
267 {
return (
unsigned int)to_uint64(); }
269 {
return (
long)to_int64(); }
271 {
return (
unsigned long)to_uint64(); }
273 {
return value().to_double(); }
276 { target =
value(); }
279 { target =
value(); }
284 {
return to_uint64(); }
303 {
return value().to_string(numrep); }
306 {
return value().to_string(numrep,w_prefix); }
315 m_left_p->concat_set((
int64)v, m_len_r);
322 m_left_p->concat_set((
int64)v, m_len_r);
329 m_left_p->concat_set(v, m_len_r);
336 m_left_p->concat_set((
uint64)v, m_len_r);
343 m_left_p->concat_set((
uint64)v, m_len_r);
350 m_left_p->concat_set(v, m_len_r);
359 m_left_p->concat_set(temp, m_len_r);
366 m_left_p->concat_set(v, m_len_r);
373 m_left_p->concat_set(v, m_len_r);
382 m_left_p->concat_set(v, m_len_r);
390 m_right_p->concat_set(temp, 0);
391 m_left_p->concat_set(temp, m_len_r);
399 m_right_p->concat_set(data, 0);
400 m_left_p->concat_set(data, m_len_r);
408 {
return value().and_reduce(); }
411 {
return value().nand_reduce(); }
414 {
return value().or_reduce(); }
417 {
return value().nor_reduce(); }
420 {
return value().xor_reduce(); }
423 {
return value().xnor_reduce(); }
427 void print( ::std::ostream& os = ::std::cout )
const
428 { os << this->
value(); }
430 void scan( ::std::istream& is )
452 sc_concatref() : m_left_p(0), m_right_p(0), m_len(0), m_len_r(0), m_flags()
511 return target.
value() << (int)shift;
516 return target.
value() << (int)shift;
522 return target.
value() << (int)shift;
528 return target.
value() << shift;
534 return target.
value() << (int)shift;
539 return target.
value() << (int)shift;
544 return target.
value() >> (int)shift;
549 return target.
value() >> (int)shift;
555 return target.
value() >> (int)shift;
561 return target.
value() >> shift;
567 return target.
value() >> (int)shift;
572 return target.
value() >> (int)shift;
582 return os << v.
value();
634 if ( xz_present_p ) *xz_present_p =
false;
642 dst_p[word_i] &= ~bit;
651 dst_p[word_i] |= bit;
653 dst_p[word_i] &= ~bit;
659 return m_value ? 1 : 0;
668#define SC_CONCAT_OP_TYPE(RESULT,OP,OTHER_TYPE) \
669 inline RESULT operator OP ( const sc_concatref& a, OTHER_TYPE b ) \
671 return a.value() OP b; \
673 inline RESULT operator OP ( OTHER_TYPE a, const sc_concatref& b ) \
675 return a OP b.value(); \
679#define SC_CONCAT_OP(RESULT,OP) \
680 inline RESULT operator OP ( const sc_concatref& a, const sc_concatref& b ) \
682 return a.value() OP b.value(); \
684 SC_CONCAT_OP_TYPE(const sc_signed,OP,int) \
685 SC_CONCAT_OP_TYPE(const sc_signed,OP,long) \
686 SC_CONCAT_OP_TYPE(const sc_signed,OP,int64) \
687 SC_CONCAT_OP_TYPE(RESULT,OP,unsigned int) \
688 SC_CONCAT_OP_TYPE(RESULT,OP,unsigned long) \
689 SC_CONCAT_OP_TYPE(RESULT,OP,uint64) \
690 SC_CONCAT_OP_TYPE(const sc_signed,OP,const sc_int_base&) \
691 SC_CONCAT_OP_TYPE(RESULT,OP,const sc_uint_base&) \
692 SC_CONCAT_OP_TYPE(const sc_signed,OP,const sc_signed&) \
693 SC_CONCAT_OP_TYPE(RESULT,OP,const sc_unsigned&) \
694 inline RESULT operator OP ( const sc_concatref& a, bool b ) \
696 return a.value() OP (int)b; \
698 inline RESULT operator OP ( bool a, const sc_concatref& b ) \
700 return (int)a OP b.value(); \
703#define SC_CONCAT_BOOL_OP(OP) \
704 inline bool operator OP ( const sc_concatref& a, const sc_concatref& b ) \
706 return a.value() OP b.value(); \
708 SC_CONCAT_OP_TYPE(bool,OP,int) \
709 SC_CONCAT_OP_TYPE(bool,OP,long) \
710 SC_CONCAT_OP_TYPE(bool,OP,int64) \
711 SC_CONCAT_OP_TYPE(bool,OP,unsigned int) \
712 SC_CONCAT_OP_TYPE(bool,OP,unsigned long) \
713 SC_CONCAT_OP_TYPE(bool,OP,uint64) \
714 SC_CONCAT_OP_TYPE(bool,OP,const sc_int_base&) \
715 SC_CONCAT_OP_TYPE(bool,OP,const sc_uint_base&) \
716 SC_CONCAT_OP_TYPE(bool,OP,const sc_signed&) \
717 SC_CONCAT_OP_TYPE(bool,OP,const sc_unsigned&) \
718 inline bool operator OP ( const sc_concatref& a, bool b ) \
720 return a.value() OP (int)b; \
722 inline bool operator OP ( bool a, const sc_concatref& b ) \
724 return (int)a OP b.value(); \
743#undef SC_CONCAT_OP_TYPE
#define SC_DIGIT_INDEX(BIT_INDEX)
#define SC_BIT_INDEX(BIT)
#define SC_BASE_VEC_DIGITS
#define SC_CONCAT_OP(RESULT, OP)
#define SC_CONCAT_BOOL_OP(OP)
sc_proxy< X >::value_type or_reduce(const sc_proxy< X > &a)
sc_proxy< X >::value_type xor_reduce(const sc_proxy< X > &a)
const sc_big_op_info< WL, true, WR, true >::add_result operator+(const sc_bigint< WL > &left, const sc_bigint< WR > &right)
sc_digit_heap SC_API sc_temporary_digits
static sc_dt::sc_concatref * temporary_concatref()
unsigned long long uint64
const sc_big_op_info< WL, true, WR, true >::sub_result operator-(const sc_bigint< WL > &left, const sc_bigint< WR > &right)
sc_concref_r< sc_bitref_r< T1 >, sc_bitref_r< T2 > > concat(sc_bitref_r< T1 >, sc_bitref_r< T2 >)
sc_concref_r< sc_bitref_r< T1 >, sc_bitref_r< T2 > > operator,(sc_bitref_r< T1 >, sc_bitref_r< T2 >)
sc_proxy< X >::value_type nor_reduce(const sc_proxy< X > &a)
inline::std::istream & operator>>(::std::istream &is, sc_bit &a)
sc_proxy< X >::value_type and_reduce(const sc_proxy< X > &a)
inline::std::ostream & operator<<(::std::ostream &os, const sc_bit &a)
uint64 const sc_uint_base int b
sc_proxy< X >::value_type xnor_reduce(const sc_proxy< X > &a)
sc_proxy< X >::value_type nand_reduce(const sc_proxy< X > &a)
sc_bit operator~(const sc_bit &a)
sc_core::sc_signal_in_if< T > & value(const T &val)
sc_digit * allocate(size_t digits_n)
virtual void concat_set(int64 src, int low_i)
static sc_unsigned * temporary()
sc_digit base_vec[SC_BASE_VEC_DIGITS >0?SC_BASE_VEC_DIGITS:1]
void scan(::std::istream &is=::std::cin)
void to_sc_signed(sc_signed &target) const
unsigned int to_uint() const
virtual bool concat_get_data(sc_digit *dst_p, int low_i) const
virtual uint64 concat_get_uint64() const
void initialize(sc_value_base &left, sc_value_base &right)
const std::string to_string(sc_numrep numrep=SC_DEC) const
virtual void concat_set(const sc_unsigned &src, int low_i)
virtual void concat_set(uint64 src, int low_i)
virtual int concat_length(bool *xz_present_p) const
virtual void concat_clear_data(bool to_ones)
void initialize(const sc_value_base &left, const sc_value_base &right)
sc_value_base * m_right_p
void scan(::std::istream &is)
const std::string to_string(sc_numrep numrep, bool w_prefix) const
unsigned long to_ulong() const
virtual bool concat_get_ctrl(sc_digit *dst_p, int low_i) const
void print(::std::ostream &os=::std::cout) const
virtual void concat_set(const sc_signed &src, int low_i)
virtual void concat_set(int64 src, int low_i)
void to_sc_unsigned(sc_unsigned &target) const
const sc_unsigned & value() const
unsigned int length() const
virtual uint64 concat_get_uint64() const
virtual int concat_length(bool *xz_present_p) const
virtual bool concat_get_ctrl(sc_digit *dst_p, int low_i) const
virtual bool concat_get_data(sc_digit *dst_p, int low_i) const
static sc_concat_bool * allocate(bool v)
virtual ~sc_concat_bool()