77#ifndef __SYSTEMC_EXT_DT_MISC_SC_CONCATREF_HH__
78#define __SYSTEMC_EXT_DT_MISC_SC_CONCATREF_HH__
119class sc_concatref :
public sc_generic_base<sc_concatref>,
public sc_value_base
169 m_left_p->concat_clear_data(to_ones);
176 bool rnz =
m_right_p->concat_get_ctrl(dst_p, low_i);
184 bool rnz =
m_right_p->concat_get_data(dst_p, low_i);
243 result = result & ~(mask <<
m_len);
262 if (left_non_zero || right_non_zero)
296 return value().to_string(numrep);
302 return value().to_string(numrep,w_prefix);
331 operator = (
unsigned int v)
339 operator = (
unsigned long v)
381 operator = (
const char *v_p)
419 void print(::std::ostream &os=::std::cout)
const { os << this->
value(); }
470 return target.
value() << (int)shift;
476 return target.
value() << (int)shift;
482 return target.
value() << (int)shift;
488 return target.
value() << shift;
494 return target.
value() << (int)shift;
500 return target.
value() << (int)shift;
506 return target.
value() >> (int)shift;
512 return target.
value() >> (int)shift;
518 return target.
value() >> (int)shift;
524 return target.
value() >> shift;
530 return target.
value() >> (int)shift;
536 return target.
value() >> (int)shift;
540inline ::std::ostream &
543 return os << v.value();
546inline ::std::istream &
589 *xz_present_p =
false;
598 dst_p[word_i] &= ~bit;
608 dst_p[word_i] |= bit;
610 dst_p[word_i] &= ~bit;
626#define SC_CONCAT_OP_TYPE(RESULT, OP, OTHER_TYPE) \
628 operator OP (const sc_concatref &a, OTHER_TYPE b) \
630 return a.value() OP b; \
633 operator OP (OTHER_TYPE a, const sc_concatref &b) \
635 return a OP b.value(); \
639#define SC_CONCAT_OP(RESULT, OP) \
641 operator OP (const sc_concatref &a, const sc_concatref &b) \
643 return a.value() OP b.value(); \
645 SC_CONCAT_OP_TYPE(const sc_signed, OP, int) \
646 SC_CONCAT_OP_TYPE(const sc_signed, OP, long) \
647 SC_CONCAT_OP_TYPE(const sc_signed, OP, int64) \
648 SC_CONCAT_OP_TYPE(RESULT, OP, unsigned int) \
649 SC_CONCAT_OP_TYPE(RESULT, OP, unsigned long) \
650 SC_CONCAT_OP_TYPE(RESULT, OP, uint64) \
651 SC_CONCAT_OP_TYPE(const sc_signed, OP, const sc_int_base &) \
652 SC_CONCAT_OP_TYPE(RESULT, OP, const sc_uint_base &) \
653 SC_CONCAT_OP_TYPE(const sc_signed, OP, const sc_signed &) \
654 SC_CONCAT_OP_TYPE(RESULT, OP, const sc_unsigned &) \
656 operator OP (const sc_concatref &a, bool b) \
658 return a.value() OP (int)b; \
661 operator OP (bool a, const sc_concatref &b) \
663 return (int)a OP b.value(); \
666#define SC_CONCAT_BOOL_OP(OP) \
668 operator OP (const sc_concatref &a, const sc_concatref &b) \
670 return a.value() OP b.value(); \
672 SC_CONCAT_OP_TYPE(bool, OP, int) \
673 SC_CONCAT_OP_TYPE(bool, OP, long) \
674 SC_CONCAT_OP_TYPE(bool, OP, int64) \
675 SC_CONCAT_OP_TYPE(bool, OP, unsigned int) \
676 SC_CONCAT_OP_TYPE(bool, OP, unsigned long) \
677 SC_CONCAT_OP_TYPE(bool, OP, uint64) \
678 SC_CONCAT_OP_TYPE(bool, OP, const sc_int_base &) \
679 SC_CONCAT_OP_TYPE(bool, OP, const sc_uint_base &) \
680 SC_CONCAT_OP_TYPE(bool, OP, const sc_signed &) \
681 SC_CONCAT_OP_TYPE(bool, OP, const sc_unsigned &) \
683 operator OP (const sc_concatref &a, bool b) \
685 return a.value() OP (int)b; \
688 operator OP (bool a, const sc_concatref &b) \
690 return (int)a OP b.value(); \
709#undef SC_CONCAT_OP_TYPE
sc_concatref(const sc_concatref &)
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_core::sc_vpool< sc_concat_bool > m_pool
static sc_concat_bool * allocate(bool v)
virtual ~sc_concat_bool()
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
static sc_core::sc_vpool< sc_concatref > m_pool
sc_concatref(const sc_concatref &)
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
static sc_core::sc_vpool< sc_unsigned > m_pool
void scan(::std::istream &is=::std::cin)
int num_bits(int nb) const
virtual int concat_length(bool *xz_present_p=0) const
sc_byte_heap sc_temp_heap(0x300000)
sc_proxy< X >::value_type or_reduce(const sc_proxy< X > &a)
sc_proxy< X >::value_type xor_reduce(const sc_proxy< X > &a)
sc_concref_r< sc_bitref_r< T1 >, sc_bitref_r< T2 > > concat(sc_bitref_r< T1 >, sc_bitref_r< T2 >)
sc_proxy< X >::value_type nor_reduce(const sc_proxy< X > &a)
sc_proxy< X >::value_type and_reduce(const sc_proxy< X > &a)
sc_proxy< X >::value_type xnor_reduce(const sc_proxy< X > &a)
sc_proxy< X >::value_type nand_reduce(const sc_proxy< X > &a)
std::ostream & operator<<(std::ostream &os, gem5::RiscvISA::PrivilegeMode pm)
#define SC_CONCAT_OP(RESULT, OP)
#define SC_CONCAT_BOOL_OP(OP)