78 template class sc_vpool<sc_dt::sc_uint_bitref>;
79 template class sc_vpool<sc_dt::sc_uint_subref>;
91 std::stringstream msg;
92 msg <<
"sc_uint_concref<T1,T2> initialization: length = " << length <<
112 sc_uint_bitref::concat_set(
int64 src,
int low_i)
115 *
this = aa = (low_i < 64) ? src >> low_i : src >> 63;
119 sc_uint_bitref::concat_set(
const sc_signed &src,
int low_i)
123 *
this = aa = 1 & (src >> low_i);
125 *
this = aa = (src < 0) ? (
int_type)-1 : 0;
133 *
this = aa = 1 & (src >> low_i);
139 sc_uint_bitref::concat_set(
uint64 src,
int low_i)
142 *
this = aa = (low_i < 64) ? src >> low_i : 0;
148 sc_uint_bitref::scan(::std::istream &
is)
163 sc_uint_subref_r::concat_get_ctrl(
sc_digit *dst_p,
int low_i)
const 175 dst_p[dst_i] = (
sc_digit)((dst_p[dst_i] & mask));
178 for (; dst_i <= end_i; dst_i++)
185 sc_uint_subref_r::concat_get_data(
sc_digit *dst_p,
int low_i)
const 197 high_i = low_i + (m_left-m_right);
200 val = (m_obj_p->m_val &
mask) >> m_right;
205 dst_p[dst_i] = (
sc_digit)(((dst_p[dst_i] & mask)) |
208 switch (end_i - dst_i) {
229 dst_p[dst_i++] = (
sc_digit)(val & DIGIT_MASK);
231 dst_p[dst_i++] = (
sc_digit)(val & DIGIT_MASK);
255 val |= (v << m_right) & ~mask;
256 m_obj_p->m_val =
val;
257 m_obj_p->extend_sign();
265 return (*
this = aa = a);
272 return (*
this = aa = a);
279 return (*
this = aa = a);
286 return (*
this = aa = a);
293 sc_uint_subref::concat_set(
int64 src,
int low_i)
296 *
this = aa = (low_i < 64) ? src >> low_i : src >> 63;
300 sc_uint_subref::concat_set(
const sc_signed &src,
int low_i)
304 *
this = aa = src >> low_i;
306 *
this = aa = (src < 0) ? (
int_type)-1 : 0;
314 *
this = aa = src >> low_i;
320 sc_uint_subref::concat_set(
uint64 src,
int low_i)
323 *
this = aa = (low_i < 64) ? src >> low_i : 0;
328 sc_uint_subref::scan(::std::istream &
is)
345 sc_uint_base::invalid_length()
const 347 std::stringstream msg;
348 msg <<
"sc_uint[_base] initialization: length = " << m_len <<
355 sc_uint_base::invalid_index(
int i)
const 357 std::stringstream msg;
358 msg <<
"sc_uint[_base] bit selection: index = " << i <<
359 " violates 0 <= index <= " << (m_len - 1);
365 sc_uint_base::invalid_range(
int l,
int r)
const 367 std::stringstream msg;
368 msg <<
"sc_uint[_base] part selection: " <<
369 "left = " << l <<
", right = " << r <<
" violates " <<
370 (m_len - 1) <<
" >= left >= right >= 0";
377 sc_uint_base::check_value()
const 381 std::stringstream msg;
382 msg <<
"sc_uint[_base]: value does not fit into a length of " << m_len;
441 for (; i < minlen; ++
i) {
458 for (; i < minlen; ++
i) {
475 for (; i < minlen; ++
i) {
491 for (; i < minlen; ++
i) {
507 "character string is zero");
508 }
else if (*a == 0) {
510 "character string is empty");
516 std::stringstream msg;
517 msg <<
"character string '" << a <<
"' is not valid";
564 val = ((val & (mask << n)) >>
n) ^ (val & mask);
584 dst_p[dst_i] = (
sc_digit)((dst_p[dst_i] & mask));
587 for (; dst_i <= end_i; dst_i++)
620 high_i = low_i + (
m_len - 1);
633 dst_p[dst_i] = (
sc_digit)(((dst_p[dst_i] & mask)) |
636 switch (end_i - dst_i) {
657 dst_p[dst_i++] = (
sc_digit)(val & DIGIT_MASK);
659 dst_p[dst_i++] = (
sc_digit)(val & DIGIT_MASK);
671 *
this = (low_i < 64) ? src >> low_i : src >> 63;
678 *
this = src >> low_i;
680 *
this = (src < 0) ? (
int_type)-1 : 0;
687 *
this = src >> low_i;
695 *
this = (low_i < 64) ? src >> low_i : 0;
virtual bool concat_get_data(sc_digit *dst_p, int low_i) const
const char SC_ID_CONVERSION_FAILED_[]
bool to_bool(const std::string &value, bool &retval)
Turn a string representation of a boolean into a boolean value.
virtual bool concat_get_ctrl(sc_digit *dst_p, int low_i) const
sc_uint_base(int w=sc_length_param().len())
void sc_uint_concref_invalid_length(int length)
static const uint64 UINT_ZERO
const T sc_min(const T &a, const T &b)
void check_length() const
#define SC_REPORT_WARNING(msg_type, msg)
const std::string to_string() const
const char SC_ID_OUT_OF_BOUNDS_[]
virtual void concat_set(int64 src, int low_i)
value_type get_bit(int i) const
value_type get_bit(int i) const
const std::string to_string(sc_numrep numrep=SC_DEC) const
const uint_type mask_int[SC_INTWIDTH][SC_INTWIDTH]
BitfieldType< SegDescriptorLimit > limit
#define SC_REPORT_ERROR(msg_type, msg)
sc_uint_base & operator=(uint_type v)
void scan(::std::istream &is=::std::cin)