80 template class sc_vpool<sc_dt::sc_int_bitref>;
81 template class sc_vpool<sc_dt::sc_int_subref>;
93 std::stringstream msg;
94 msg <<
"sc_int_concref<T1,T2> initialization: length = " <<
length <<
112 void sc_int_bitref::concat_set(
int64 src,
int low_i)
115 *
this =
aa = (low_i < 64) ? src >> low_i : src >> 63;
118 void sc_int_bitref::concat_set(
const sc_signed &src,
int low_i)
122 *
this =
aa = 1 & (src >> low_i);
131 *
this =
aa = 1 & (src >> low_i);
136 void sc_int_bitref::concat_set(
uint64 src,
int low_i)
139 *
this =
aa = (low_i < 64) ? src >> low_i : 0;
145 sc_int_bitref::scan(::std::istream &
is)
160 sc_int_subref_r::concat_get_ctrl(
sc_digit *dst_p,
int low_i)
const
168 high_i = low_i + (m_left - m_right);
174 switch (end_i - dst_i) {
200 sc_int_subref_r::concat_get_data(
sc_digit *dst_p,
int low_i)
const
212 high_i = low_i + (m_left-m_right);
215 val = (m_obj_p->m_val &
mask) >> m_right;
223 switch (end_i - dst_i) {
271 m_obj_p->m_val =
val;
272 m_obj_p->extend_sign();
280 return (*
this =
aa =
a);
287 return (*
this =
aa =
a);
294 return (*
this =
aa =
a);
301 return (*
this =
aa =
a);
308 sc_int_subref::concat_set(
int64 src,
int low_i)
311 *
this =
aa = (low_i < 64) ? src >> low_i : src >> 63;
315 sc_int_subref::concat_set(
const sc_signed &src,
int low_i)
319 *
this =
aa = src >> low_i;
321 *
this = (src < 0) ? (
int_type)-1 : 0;
329 *
this =
aa = src >> low_i;
335 sc_int_subref::concat_set(
uint64 src,
int low_i)
338 *
this =
aa = (low_i < 64) ? src >> low_i : 0;
344 sc_int_subref::scan(::std::istream &
is)
360 sc_int_base::invalid_length()
const
362 std::stringstream msg;
363 msg <<
"sc_int[_base] initialization: length = " << m_len <<
370 sc_int_base::invalid_index(
int i)
const
372 std::stringstream msg;
373 msg <<
"sc_int[_base] bit selection: index = " <<
i <<
374 " violates 0 <= index <= " << (m_len - 1);
380 sc_int_base::invalid_range(
int l,
int r)
const
382 std::stringstream msg;
383 msg <<
"sc_int[_base] part selection: " <<
384 "left = " <<
l <<
", right = " <<
r <<
" violates " <<
385 (m_len-1) <<
" >= left >= right >= 0";
391 sc_int_base::check_value()
const
394 if (m_val < -limit || m_val >=
limit) {
395 std::stringstream msg;
396 msg <<
"sc_int[_base]: value does not fit into a length of " << m_len;
419 *
this =
v.to_uint64();
425 *
this =
v.to_uint64();
431 *
this =
v.to_uint64();
438 *
this =
a.to_int64();
445 *
this =
a.to_int64();
455 for (;
i < minlen; ++
i) {
472 for (;
i < minlen; ++
i) {
489 for (;
i < minlen; ++
i) {
505 for (;
i < minlen; ++
i) {
521 "character string is zero");
522 }
else if (*
a == 0) {
524 "character string is empty");
530 std::stringstream msg;
531 msg <<
"character string '" <<
a <<
"' is not valid";
543 return aa.to_string(numrep);
551 return aa.to_string(numrep, w_prefix);
588 for (; dst_i <= end_i; dst_i++)
621 high_i = low_i + (
m_len - 1);
636 switch (end_i - dst_i) {
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;