Go to the documentation of this file.
92 #ifndef __SYSTEMC_EXT_DT_INT_SC_SIGNED_HH__
93 #define __SYSTEMC_EXT_DT_INT_SC_SIGNED_HH__
97 #include "../misc/sc_value_base.hh"
98 #include "../sc_temporary.hh"
109 class sc_signed_bitref_r;
110 class sc_signed_bitref;
111 class sc_signed_subref_r;
112 class sc_signed_subref;
121 class sc_int_subref_r;
122 class sc_uint_subref_r;
125 class sc_unsigned_subref_r;
137 extern template class sc_vpool<sc_dt::sc_signed_bitref>;
138 extern template class sc_vpool<sc_dt::sc_signed_subref>;
156 int vnb,
int vnd,
const sc_digit *vd);
160 int vnb,
int vnd,
const sc_digit *vd);
164 int vnb,
int vnd,
const sc_digit *vd);
185 sc_signed
operator + (
const sc_unsigned &
u,
const sc_signed &
v);
186 sc_signed
operator + (
const sc_signed &
u,
const sc_unsigned &
v);
190 inline sc_signed
operator + (
const sc_unsigned &
u,
int v);
194 inline sc_signed
operator + (
int u,
const sc_unsigned &
v);
196 sc_signed
operator + (
const sc_signed &
u,
const sc_signed &
v);
200 sc_signed
operator + (
const sc_signed &
u,
unsigned long v);
201 inline sc_signed
operator + (
const sc_signed &
u,
int v);
202 inline sc_signed
operator + (
const sc_signed &
u,
unsigned int v);
207 sc_signed
operator + (
unsigned long u,
const sc_signed &
v);
208 inline sc_signed
operator + (
int u,
const sc_signed &
v);
209 inline sc_signed
operator + (
unsigned int u,
const sc_signed &
v);
211 sc_signed
operator + (
const sc_unsigned &
u,
const sc_int_base &
v);
212 sc_signed
operator + (
const sc_int_base &
u,
const sc_unsigned &
v);
213 sc_signed
operator + (
const sc_signed &
u,
const sc_int_base &
v);
214 sc_signed
operator + (
const sc_signed &
u,
const sc_uint_base &
v);
215 sc_signed
operator + (
const sc_int_base &
u,
const sc_signed &
v);
216 sc_signed
operator + (
const sc_uint_base &
u,
const sc_signed &
v);
220 sc_signed
operator - (
const sc_unsigned &
u,
const sc_signed &
v);
221 sc_signed
operator - (
const sc_signed &
u,
const sc_unsigned &
v);
223 sc_signed
operator - (
const sc_unsigned &
u,
const sc_unsigned &
v);
227 sc_signed
operator - (
const sc_unsigned &
u,
unsigned long v);
228 inline sc_signed
operator - (
const sc_unsigned &
u,
int v);
229 inline sc_signed
operator - (
const sc_unsigned &
u,
unsigned int v);
234 sc_signed
operator - (
unsigned long u,
const sc_unsigned &
v);
235 inline sc_signed
operator - (
int u,
const sc_unsigned &
v);
236 inline sc_signed
operator - (
unsigned int u,
const sc_unsigned &
v);
238 sc_signed
operator - (
const sc_signed &
u,
const sc_signed &
v);
242 sc_signed
operator - (
const sc_signed &
u,
unsigned long v);
243 inline sc_signed
operator - (
const sc_signed &
u,
int v);
244 inline sc_signed
operator - (
const sc_signed &
u,
unsigned int v);
249 sc_signed
operator - (
unsigned long u,
const sc_signed &
v);
250 inline sc_signed
operator - (
int u,
const sc_signed &
v);
251 inline sc_signed
operator - (
unsigned int u,
const sc_signed &
v);
254 sc_signed
operator - (
const sc_unsigned &
u,
const sc_int_base &
v);
255 sc_signed
operator - (
const sc_unsigned &
u,
const sc_uint_base &
v);
256 sc_signed
operator - (
const sc_int_base &
u,
const sc_unsigned &
v);
257 sc_signed
operator - (
const sc_uint_base &
u,
const sc_unsigned &
v);
258 sc_signed
operator - (
const sc_signed &
u,
const sc_int_base &
v);
259 sc_signed
operator - (
const sc_signed &
u,
const sc_uint_base &
v);
260 sc_signed
operator - (
const sc_int_base &
u,
const sc_signed &
v);
261 sc_signed
operator - (
const sc_uint_base &
u,
const sc_signed &
v);
265 sc_signed
operator * (
const sc_unsigned &
u,
const sc_signed &
v);
266 sc_signed
operator * (
const sc_signed &
u,
const sc_unsigned &
v);
270 inline sc_signed
operator * (
const sc_unsigned &
u,
int v);
274 inline sc_signed
operator * (
int u,
const sc_unsigned &
v);
276 sc_signed
operator * (
const sc_signed &
u,
const sc_signed &
v);
280 sc_signed
operator * (
const sc_signed &
u,
unsigned long v);
281 inline sc_signed
operator * (
const sc_signed &
u,
int v);
282 inline sc_signed
operator * (
const sc_signed &
u,
unsigned int v);
287 sc_signed
operator * (
unsigned long u,
const sc_signed &
v);
288 inline sc_signed
operator * (
int u,
const sc_signed &
v);
289 inline sc_signed
operator * (
unsigned int u,
const sc_signed &
v);
291 sc_signed
operator * (
const sc_unsigned &
u,
const sc_int_base &
v);
292 sc_signed
operator * (
const sc_int_base &
u,
const sc_unsigned &
v);
293 sc_signed
operator * (
const sc_signed &
u,
const sc_int_base &
v);
294 sc_signed
operator * (
const sc_signed &
u,
const sc_uint_base &
v);
295 sc_signed
operator * (
const sc_int_base &
u,
const sc_signed &
v);
296 sc_signed
operator * (
const sc_uint_base &
u,
const sc_signed &
v);
300 sc_signed
operator / (
const sc_unsigned &
u,
const sc_signed &
v);
301 sc_signed
operator / (
const sc_signed &
u,
const sc_unsigned &
v);
305 inline sc_signed
operator / (
const sc_unsigned &
u,
int v);
309 inline sc_signed
operator / (
int u,
const sc_unsigned &
v);
311 sc_signed
operator / (
const sc_signed &
u,
const sc_signed &
v);
315 sc_signed
operator / (
const sc_signed &
u,
unsigned long v);
316 inline sc_signed
operator / (
const sc_signed &
u,
int v);
317 inline sc_signed
operator / (
const sc_signed &
u,
unsigned int v);
322 sc_signed
operator / (
unsigned long u,
const sc_signed &
v);
323 inline sc_signed
operator / (
int u,
const sc_signed &
v);
324 inline sc_signed
operator / (
unsigned int u,
const sc_signed &
v);
326 sc_signed
operator / (
const sc_unsigned &
u,
const sc_int_base &
v);
327 sc_signed
operator / (
const sc_int_base &
u,
const sc_unsigned &
v);
328 sc_signed
operator / (
const sc_signed &
u,
const sc_int_base &
v);
329 sc_signed
operator / (
const sc_signed &
u,
const sc_uint_base &
v);
330 sc_signed
operator / (
const sc_int_base &
u,
const sc_signed &
v);
331 sc_signed
operator / (
const sc_uint_base &
u,
const sc_signed &
v);
335 sc_signed
operator % (
const sc_unsigned &
u,
const sc_signed &
v);
336 sc_signed
operator % (
const sc_signed &
u,
const sc_unsigned &
v);
340 inline sc_signed
operator % (
const sc_unsigned &
u,
int v);
344 inline sc_signed
operator % (
int u,
const sc_unsigned &
v);
346 sc_signed
operator % (
const sc_signed &
u,
const sc_signed &
v);
350 sc_signed
operator % (
const sc_signed &
u,
unsigned long v);
351 inline sc_signed
operator % (
const sc_signed &
u,
int v);
352 inline sc_signed
operator % (
const sc_signed &
u,
unsigned int v);
357 sc_signed
operator % (
unsigned long u,
const sc_signed &
v);
358 inline sc_signed
operator % (
int u,
const sc_signed &
v);
359 inline sc_signed
operator % (
unsigned int u,
const sc_signed &
v);
361 sc_signed
operator % (
const sc_unsigned &
u,
const sc_int_base &
v);
362 sc_signed
operator % (
const sc_int_base &
u,
const sc_unsigned &
v);
363 sc_signed
operator % (
const sc_signed &
u,
const sc_int_base &
v);
364 sc_signed
operator % (
const sc_signed &
u,
const sc_uint_base &
v);
365 sc_signed
operator % (
const sc_int_base &
u,
const sc_signed &
v);
366 sc_signed
operator % (
const sc_uint_base &
u,
const sc_signed &
v);
372 sc_signed
operator & (
const sc_unsigned &
u,
const sc_signed &
v);
373 sc_signed
operator & (
const sc_signed &
u,
const sc_unsigned &
v);
377 inline sc_signed
operator & (
const sc_unsigned &
u,
int v);
381 inline sc_signed
operator & (
int u,
const sc_unsigned &
v);
383 sc_signed
operator & (
const sc_signed &
u,
const sc_signed &
v);
387 sc_signed
operator & (
const sc_signed &
u,
unsigned long v);
388 inline sc_signed
operator & (
const sc_signed &
u,
int v);
389 inline sc_signed
operator & (
const sc_signed &
u,
unsigned int v);
394 sc_signed
operator & (
unsigned long u,
const sc_signed &
v);
395 inline sc_signed
operator & (
int u,
const sc_signed &
v);
396 inline sc_signed
operator & (
unsigned int u,
const sc_signed &
v);
398 sc_signed
operator & (
const sc_unsigned &
u,
const sc_int_base &
v);
399 sc_signed
operator & (
const sc_int_base &
u,
const sc_unsigned &
v);
400 sc_signed
operator & (
const sc_signed &
u,
const sc_int_base &
v);
401 sc_signed
operator & (
const sc_signed &
u,
const sc_uint_base &
v);
402 sc_signed
operator & (
const sc_int_base &
u,
const sc_signed &
v);
403 sc_signed
operator & (
const sc_uint_base &
u,
const sc_signed &
v);
407 sc_signed
operator | (
const sc_unsigned &
u,
const sc_signed &
v);
408 sc_signed
operator | (
const sc_signed &
u,
const sc_unsigned &
v);
412 inline sc_signed
operator | (
const sc_unsigned &
u,
int v);
416 inline sc_signed
operator | (
int u,
const sc_unsigned &
v);
418 sc_signed
operator | (
const sc_signed &
u,
const sc_signed &
v);
422 sc_signed
operator | (
const sc_signed &
u,
unsigned long v);
423 inline sc_signed
operator | (
const sc_signed &
u,
int v);
424 inline sc_signed
operator | (
const sc_signed &
u,
unsigned int v);
429 sc_signed
operator | (
unsigned long u,
const sc_signed &
v);
430 inline sc_signed
operator | (
int u,
const sc_signed &
v);
431 inline sc_signed
operator | (
unsigned int u,
const sc_signed &
v);
433 sc_signed
operator | (
const sc_unsigned &
u,
const sc_int_base &
v);
434 sc_signed
operator | (
const sc_int_base &
u,
const sc_unsigned &
v);
435 sc_signed
operator | (
const sc_signed &
u,
const sc_int_base &
v);
436 sc_signed
operator | (
const sc_signed &
u,
const sc_uint_base &
v);
437 sc_signed
operator | (
const sc_int_base &
u,
const sc_signed &
v);
438 sc_signed
operator | (
const sc_uint_base &
u,
const sc_signed &
v);
442 sc_signed
operator ^ (
const sc_unsigned &
u,
const sc_signed &
v);
443 sc_signed
operator ^ (
const sc_signed &
u,
const sc_unsigned &
v);
447 inline sc_signed
operator ^ (
const sc_unsigned &
u,
int v);
451 inline sc_signed
operator ^ (
int u,
const sc_unsigned &
v);
453 sc_signed
operator ^ (
const sc_signed &
u,
const sc_signed &
v);
457 sc_signed
operator ^ (
const sc_signed &
u,
unsigned long v);
458 inline sc_signed
operator ^ (
const sc_signed &
u,
int v);
459 inline sc_signed
operator ^ (
const sc_signed &
u,
unsigned int v);
464 sc_signed
operator ^ (
unsigned long u,
const sc_signed &
v);
465 inline sc_signed
operator ^ (
int u,
const sc_signed &
v);
466 inline sc_signed
operator ^ (
unsigned int u,
const sc_signed &
v);
468 sc_signed
operator ^ (
const sc_unsigned &
u,
const sc_int_base &
v);
469 sc_signed
operator ^ (
const sc_int_base &
u,
const sc_unsigned &
v);
470 sc_signed
operator ^ (
const sc_signed &
u,
const sc_int_base &
v);
471 sc_signed
operator ^ (
const sc_signed &
u,
const sc_uint_base &
v);
472 sc_signed
operator ^ (
const sc_int_base &
u,
const sc_signed &
v);
473 sc_signed
operator ^ (
const sc_uint_base &
u,
const sc_signed &
v);
478 sc_unsigned
operator << (
const sc_unsigned &
u,
const sc_signed &
v);
479 sc_signed
operator << (
const sc_signed &
u,
const sc_unsigned &
v);
481 sc_signed
operator << (
const sc_signed &
u,
const sc_signed &
v);
487 inline sc_signed
operator << (
const sc_signed &
u,
unsigned int v);
489 sc_signed
operator << (
const sc_signed &
u,
const sc_int_base &
v);
490 sc_signed
operator << (
const sc_signed &
u,
const sc_uint_base &
v);
494 sc_unsigned
operator >> (
const sc_unsigned &
u,
const sc_signed &
v);
495 sc_signed
operator >> (
const sc_signed &
u,
const sc_unsigned &
v);
497 sc_signed
operator >> (
const sc_signed &
u,
const sc_signed &
v);
503 inline sc_signed
operator >> (
const sc_signed &
u,
unsigned int v);
505 sc_signed
operator >> (
const sc_signed &
u,
const sc_int_base &
v);
506 sc_signed
operator >> (
const sc_signed &
u,
const sc_uint_base &
v);
527 inline bool operator == (
const sc_signed &
u,
unsigned int v);
534 inline bool operator == (
unsigned int u,
const sc_signed &
v);
537 bool operator == (
const sc_signed &
u,
const sc_uint_base &
v);
539 bool operator == (
const sc_uint_base &
u,
const sc_signed &
v);
551 inline bool operator != (
const sc_signed &
u,
unsigned int v);
558 inline bool operator != (
unsigned int u,
const sc_signed &
v);
561 bool operator != (
const sc_signed &
u,
const sc_uint_base &
v);
563 bool operator != (
const sc_uint_base &
u,
const sc_signed &
v);
566 bool operator < (
const sc_unsigned &
u,
const sc_signed &
v);
567 bool operator < (
const sc_signed &
u,
const sc_unsigned &
v);
569 bool operator < (
const sc_signed &
u,
const sc_signed &
v);
575 inline bool operator < (
const sc_signed &
u,
unsigned int v);
582 inline bool operator < (
unsigned int u,
const sc_signed &
v);
584 bool operator < (
const sc_signed &
u,
const sc_int_base &
v);
585 bool operator < (
const sc_signed &
u,
const sc_uint_base &
v);
586 bool operator < (
const sc_int_base &
u,
const sc_signed &
v);
587 bool operator < (
const sc_uint_base &
u,
const sc_signed &
v);
599 inline bool operator <= (
const sc_signed &
u,
unsigned int v);
606 inline bool operator <= (
unsigned int u,
const sc_signed &
v);
609 bool operator <= (
const sc_signed &
u,
const sc_uint_base &
v);
611 bool operator <= (
const sc_uint_base &
u,
const sc_signed &
v);
614 bool operator > (
const sc_unsigned &
u,
const sc_signed &
v);
615 bool operator > (
const sc_signed &
u,
const sc_unsigned &
v);
617 bool operator > (
const sc_signed &
u,
const sc_signed &
v);
623 inline bool operator > (
const sc_signed &
u,
unsigned int v);
630 inline bool operator > (
unsigned int u,
const sc_signed &
v);
632 bool operator > (
const sc_signed &
u,
const sc_int_base &
v);
633 bool operator > (
const sc_signed &
u,
const sc_uint_base &
v);
634 bool operator > (
const sc_int_base &
u,
const sc_signed &
v);
635 bool operator > (
const sc_uint_base &
u,
const sc_signed &
v);
647 inline bool operator >= (
const sc_signed &
u,
unsigned int v);
654 inline bool operator >= (
unsigned int u,
const sc_signed &
v);
657 bool operator >= (
const sc_signed &
u,
const sc_uint_base &
v);
659 bool operator >= (
const sc_uint_base &
u,
const sc_signed &
v);
699 bool operator ! ()
const;
713 *xz_present_p =
false;
727 dst_p[word_i] &= ~bit_mask;
738 dst_p[word_i] |= bit_mask;
741 dst_p[word_i] &= ~bit_mask;
793 virtual void concat_set(
int64 src,
int low_i);
794 virtual void concat_set(
const sc_signed &src,
int low_i);
795 virtual void concat_set(
const sc_unsigned &src,
int low_i);
796 virtual void concat_set(
uint64 src,
int low_i);
799 void scan(::std::istream &
is=::std::cin);
828 m_obj_p = (
const_cast<sc_signed*
>(obj_p));
847 return m_left >= m_right ? (m_left-m_right + 1) : (m_right-m_left + 1);
855 unsigned int to_uint()
const;
856 long to_long()
const;
857 unsigned long to_ulong()
const;
858 int64 to_int64()
const;
860 double to_double()
const;
871 *xz_present_p =
false;
872 return m_left - m_right + 1;
874 virtual uint64 concat_get_uint64()
const;
875 virtual bool concat_get_ctrl(
sc_digit *dst_p,
int low_i)
const;
876 virtual bool concat_get_data(
sc_digit *dst_p,
int low_i)
const;
937 a->to_sc_unsigned(temp);
938 return operator = (temp);
945 operator = (
unsigned int a)
947 return operator = ((
unsigned long)
a);
953 return operator = ((
long)
a);
963 virtual void concat_set(
int64 src,
int low_i);
964 virtual void concat_set(
const sc_signed &src,
int low_i);
965 virtual void concat_set(
const sc_unsigned &src,
int low_i);
966 virtual void concat_set(
uint64 src,
int low_i);
969 void scan(::std::istream &
is=::std::cin);
997 void invalid_init(
const char *type_name,
int nb)
const;
1021 a->to_sc_signed(*
this);
1032 const sc_signed &operator = (
unsigned long v);
1037 operator = (
unsigned int v)
1039 return operator=((
unsigned long)
v);
1057 #ifndef SC_MAX_NBITS
1068 *xz_present_p =
false;
1071 virtual bool concat_get_ctrl(
sc_digit *dst_p,
int low_i)
const;
1072 virtual bool concat_get_data(
sc_digit *dst_p,
int low_i)
const;
1073 virtual uint64 concat_get_uint64()
const;
1074 virtual void concat_set(
int64 src,
int low_i);
1075 virtual void concat_set(
const sc_signed &src,
int low_i);
1076 virtual void concat_set(
const sc_unsigned &src,
int low_i);
1077 virtual void concat_set(
uint64 src,
int low_i);
1091 if (i < 0 || i >= nbits)
1095 void invalid_index(
int i)
const;
1107 operator [] (
int i)
const
1148 if (l < 0 || r >= nbits)
1149 invalid_range(
l,
r);
1151 if (r < 0 || l >= nbits)
1152 invalid_range(
l,
r);
1156 void invalid_range(
int l,
int r)
const;
1177 operator () (
int i,
int j)
1186 operator () (
int i,
int j)
const
1197 unsigned int to_uint()
const;
1198 long to_long()
const;
1199 unsigned long to_ulong()
const;
1200 int64 to_int64()
const;
1201 uint64 to_uint64()
const;
1202 double to_double()
const;
1217 void scan(::std::istream &
is=::std::cin);
1219 void dump(::std::ostream &
os=::std::cout)
const;
1223 bool iszero()
const;
1235 bool test(
int i)
const;
1258 void get_packed_rep(
sc_digit *buf)
const;
1259 void set_packed_rep(
sc_digit *buf);
1305 friend sc_signed
operator + (
long u,
const sc_unsigned &
v);
1312 friend sc_signed
operator + (
const sc_signed &
u,
const sc_signed &
v);
1315 friend sc_signed
operator + (
const sc_signed &
u,
long v);
1316 friend sc_signed
operator + (
const sc_signed &
u,
unsigned long v);
1330 friend sc_signed
operator + (
long u,
const sc_signed &
v);
1331 friend sc_signed
operator + (
unsigned long u,
const sc_signed &
v);
1343 const sc_signed &operator += (
const sc_signed &
v);
1344 const sc_signed &operator += (
const sc_unsigned &
v);
1345 const sc_signed &operator += (
int64 v);
1346 const sc_signed &operator += (
uint64 v);
1347 const sc_signed &operator += (
long v);
1348 const sc_signed &operator += (
unsigned long v);
1352 return operator += ((
long)
v);
1355 operator += (
unsigned int v)
1357 return operator += ((
unsigned long)
v);
1391 friend sc_signed
operator - (
long u,
const sc_unsigned &
v);
1392 friend sc_signed
operator - (
unsigned long u,
const sc_unsigned &
v);
1404 friend sc_signed
operator - (
const sc_signed &
u,
const sc_signed &
v);
1407 friend sc_signed
operator - (
const sc_signed &
u,
long v);
1408 friend sc_signed
operator - (
const sc_signed &
u,
unsigned long v);
1422 friend sc_signed
operator - (
long u,
const sc_signed &
v);
1423 friend sc_signed
operator - (
unsigned long u,
const sc_signed &
v);
1435 const sc_signed &operator -= (
const sc_signed &
v);
1436 const sc_signed &operator -= (
const sc_unsigned &
v);
1437 const sc_signed &operator -= (
int64 v);
1438 const sc_signed &operator -= (
uint64 v);
1439 const sc_signed &operator -= (
long v);
1440 const sc_signed &operator -= (
unsigned long v);
1444 return operator -= ((
long)
v);
1447 operator -= (
unsigned int v)
1449 return operator -= ((
unsigned long)
v);
1476 friend sc_signed
operator * (
long u,
const sc_unsigned &
v);
1483 friend sc_signed
operator * (
const sc_signed &
u,
const sc_signed &
v);
1486 friend sc_signed
operator * (
const sc_signed &
u,
long v);
1487 friend sc_signed
operator * (
const sc_signed &
u,
unsigned long v);
1501 friend sc_signed
operator * (
long u,
const sc_signed &
v);
1502 friend sc_signed
operator * (
unsigned long u,
const sc_signed &
v);
1514 const sc_signed &operator *= (
const sc_signed &
v);
1515 const sc_signed &operator *= (
const sc_unsigned &
v);
1516 const sc_signed &operator *= (
int64 v);
1517 const sc_signed &operator *= (
uint64 v);
1518 const sc_signed &operator *= (
long v);
1519 const sc_signed &operator *= (
unsigned long v);
1523 return operator *= ((
long)
v);
1526 operator *= (
unsigned int v)
1528 return operator *= ((
unsigned long)
v);
1553 friend sc_signed
operator / (
long u,
const sc_unsigned &
v);
1560 friend sc_signed
operator / (
const sc_signed &
u,
const sc_signed &
v);
1563 friend sc_signed
operator / (
const sc_signed &
u,
long v);
1564 friend sc_signed
operator / (
const sc_signed &
u,
unsigned long v);
1578 friend sc_signed
operator / (
long u,
const sc_signed &
v);
1579 friend sc_signed
operator / (
unsigned long u,
const sc_signed &
v);
1591 const sc_signed &operator /= (
const sc_signed &
v);
1592 const sc_signed &operator /= (
const sc_unsigned &
v);
1593 const sc_signed &operator /= (
int64 v);
1594 const sc_signed &operator /= (
uint64 v);
1595 const sc_signed &operator /= (
long v);
1596 const sc_signed &operator /= (
unsigned long v);
1600 return operator /= ((
long)
v);
1603 operator /= (
unsigned int v)
1605 return operator /= ((
unsigned long)
v);
1630 friend sc_signed
operator % (
long u,
const sc_unsigned &
v);
1637 friend sc_signed
operator % (
const sc_signed &
u,
const sc_signed &
v);
1640 friend sc_signed
operator % (
const sc_signed &
u,
long v);
1641 friend sc_signed
operator % (
const sc_signed &
u,
unsigned long v);
1655 friend sc_signed
operator % (
long u,
const sc_signed &
v);
1656 friend sc_signed
operator % (
unsigned long u,
const sc_signed &
v);
1668 const sc_signed &operator %= (
const sc_signed &
v);
1669 const sc_signed &operator %= (
const sc_unsigned &
v);
1670 const sc_signed &operator %= (
int64 v);
1671 const sc_signed &operator %= (
uint64 v);
1672 const sc_signed &operator %= (
long v);
1673 const sc_signed &operator %= (
unsigned long v);
1677 return operator %= ((
long)
v);
1680 operator %= (
unsigned int v)
1682 return operator %= ((
unsigned long)
v);
1709 friend sc_signed
operator & (
long u,
const sc_unsigned &
v);
1716 friend sc_signed
operator & (
const sc_signed &
u,
const sc_signed &
v);
1719 friend sc_signed
operator & (
const sc_signed &
u,
long v);
1720 friend sc_signed
operator & (
const sc_signed &
u,
unsigned long v);
1734 friend sc_signed
operator & (
long u,
const sc_signed &
v);
1735 friend sc_signed
operator & (
unsigned long u,
const sc_signed &
v);
1780 friend sc_signed
operator | (
long u,
const sc_unsigned &
v);
1787 friend sc_signed
operator | (
const sc_signed &
u,
const sc_signed &
v);
1790 friend sc_signed
operator | (
const sc_signed &
u,
long v);
1791 friend sc_signed
operator | (
const sc_signed &
u,
unsigned long v);
1805 friend sc_signed
operator | (
long u,
const sc_signed &
v);
1806 friend sc_signed
operator | (
unsigned long u,
const sc_signed &
v);
1857 friend sc_signed
operator ^ (
long u,
const sc_unsigned &
v);
1864 friend sc_signed
operator ^ (
const sc_signed &
u,
const sc_signed &
v);
1867 friend sc_signed
operator ^ (
const sc_signed &
u,
long v);
1868 friend sc_signed
operator ^ (
const sc_signed &
u,
unsigned long v);
1882 friend sc_signed
operator ^ (
long u,
const sc_signed &
v);
1883 friend sc_signed
operator ^ (
unsigned long u,
const sc_signed &
v);
1943 const sc_signed &operator <<= (
const sc_signed &
v);
1944 const sc_signed &operator <<= (
const sc_unsigned &
v);
1945 const sc_signed &operator <<= (
int64 v);
1946 const sc_signed &operator <<= (
uint64 v);
1947 const sc_signed &operator <<= (
long v);
1948 const sc_signed &operator <<= (
unsigned long v);
1950 operator <<= (
int v)
1952 return operator <<= ((
long)
v);
1955 operator <<= (
unsigned int v)
1957 return operator <<= ((
unsigned long)
v);
1985 const sc_signed &operator >>= (
const sc_signed &
v);
1986 const sc_signed &operator >>= (
const sc_unsigned &
v);
1987 const sc_signed &operator >>= (
int64 v);
1988 const sc_signed &operator >>= (
uint64 v);
1989 const sc_signed &operator >>= (
long v);
1990 const sc_signed &operator >>= (
unsigned long v);
1992 operator >>= (
int v)
1994 return operator >>= ((
long)
v);
1997 operator >>= (
unsigned int v)
1999 return operator >>= ((
unsigned long)
v);
2037 friend bool operator == (
unsigned long u,
const sc_signed &
v);
2049 friend bool operator == (
const sc_signed &
u,
const sc_int_base &
v);
2050 friend bool operator == (
const sc_signed &
u,
const sc_uint_base &
v);
2051 friend bool operator == (
const sc_int_base &
u,
const sc_signed &
v);
2052 friend bool operator == (
const sc_uint_base &
u,
const sc_signed &
v);
2055 friend bool operator != (
const sc_unsigned &
u,
const sc_signed &
v);
2056 friend bool operator != (
const sc_signed &
u,
const sc_unsigned &
v);
2058 friend bool operator != (
const sc_signed &
u,
const sc_signed &
v);
2062 friend bool operator != (
const sc_signed &
u,
unsigned long v);
2077 friend bool operator != (
unsigned long u,
const sc_signed &
v);
2089 friend bool operator != (
const sc_signed &
u,
const sc_int_base &
v);
2090 friend bool operator != (
const sc_signed &
u,
const sc_uint_base &
v);
2091 friend bool operator != (
const sc_int_base &
u,
const sc_signed &
v);
2092 friend bool operator != (
const sc_uint_base &
u,
const sc_signed &
v);
2095 friend bool operator < (
const sc_unsigned &
u,
const sc_signed &
v);
2096 friend bool operator < (
const sc_signed &
u,
const sc_unsigned &
v);
2098 friend bool operator < (
const sc_signed &
u,
const sc_signed &
v);
2102 friend bool operator < (
const sc_signed &
u,
unsigned long v);
2111 friend bool operator < (
unsigned long u,
const sc_signed &
v);
2123 friend bool operator < (
const sc_signed &
u,
const sc_int_base &
v);
2124 friend bool operator < (
const sc_signed &
u,
const sc_uint_base &
v);
2125 friend bool operator < (
const sc_int_base &
u,
const sc_signed &
v);
2126 friend bool operator < (
const sc_uint_base &
u,
const sc_signed &
v);
2129 friend bool operator <= (
const sc_unsigned &
u,
const sc_signed &
v);
2130 friend bool operator <= (
const sc_signed &
u,
const sc_unsigned &
v);
2132 friend bool operator <= (
const sc_signed &
u,
const sc_signed &
v);
2136 friend bool operator <= (
const sc_signed &
u,
unsigned long v);
2151 friend bool operator <= (
unsigned long u,
const sc_signed &
v);
2163 friend bool operator <= (
const sc_signed &
u,
const sc_int_base &
v);
2164 friend bool operator <= (
const sc_signed &
u,
const sc_uint_base &
v);
2165 friend bool operator <= (
const sc_int_base &
u,
const sc_signed &
v);
2166 friend bool operator <= (
const sc_uint_base &
u,
const sc_signed &
v);
2169 friend bool operator > (
const sc_unsigned &
u,
const sc_signed &
v);
2170 friend bool operator > (
const sc_signed &
u,
const sc_unsigned &
v);
2172 friend bool operator > (
const sc_signed &
u,
const sc_signed &
v);
2176 friend bool operator > (
const sc_signed &
u,
unsigned long v);
2191 friend bool operator > (
unsigned long u,
const sc_signed &
v);
2203 friend bool operator > (
const sc_signed &
u,
const sc_int_base &
v);
2204 friend bool operator > (
const sc_signed &
u,
const sc_uint_base &
v);
2205 friend bool operator > (
const sc_int_base &
u,
const sc_signed &
v);
2206 friend bool operator > (
const sc_uint_base &
u,
const sc_signed &
v);
2209 friend bool operator >= (
const sc_unsigned &
u,
const sc_signed &
v);
2210 friend bool operator >= (
const sc_signed &
u,
const sc_unsigned &
v);
2212 friend bool operator >= (
const sc_signed &
u,
const sc_signed &
v);
2216 friend bool operator >= (
const sc_signed &
u,
unsigned long v);
2231 friend bool operator >= (
unsigned long u,
const sc_signed &
v);
2243 friend bool operator >= (
const sc_signed &
u,
const sc_int_base &
v);
2244 friend bool operator >= (
const sc_signed &
u,
const sc_uint_base &
v);
2245 friend bool operator >= (
const sc_int_base &
u,
const sc_signed &
v);
2246 friend bool operator >= (
const sc_uint_base &
u,
const sc_signed &
v);
2262 int vnb,
int vnd,
const sc_digit *vd);
2266 int vnb,
int vnd,
const sc_digit *vd);
2270 int vnb,
int vnd,
const sc_digit *vd);
2315 bool check_if_outside(
int bit_num)
const;
2346 inline ::std::ostream &
operator << (::std::ostream &,
const sc_signed &);
2348 inline ::std::istream &
operator >> (::std::istream &, sc_signed &);
2350 inline ::std::ostream &
2358 inline ::std::istream &
2379 for (
int i = m_right;
i <= m_left;
i++)
2380 if (!target_p->
test(
i))
2395 for (
int i = m_right;
i <= m_left;
i++)
2396 if (target_p->
test(
i))
2413 for (
int i = m_right;
i <= m_left;
i++)
2414 if (target_p->
test(
i)) odd = ~odd;
2415 return odd ? true :
false;
2424 inline ::std::ostream &
2440 inline const sc_signed_subref &
2441 sc_signed_subref::operator = (
const char *
a)
2444 return (*
this =
aa =
a);
2450 inline ::std::istream &
2468 int nb =
v->length();
2469 sgn = default_sign();
2471 nbits = num_bits(nb);
2473 invalid_init(
"sc_generic_base<T>", nb);
2477 # ifdef SC_MAX_NBITS
2483 v->to_sc_signed(*
this);
2488 inline ::std::ostream &
2495 inline ::std::istream &
2504 #endif // __SYSTEMC_EXT_DT_INT_SC_SIGNED_HH__
void copy_digits(int nb, int nd, const sc_digit *d)
sc_signed_subref & range(int i, int j)
void print(::std::ostream &os=::std::cout) const
bool to_bool(const std::string &value, bool &retval)
Turn a string representation of a boolean into a boolean value.
sc_signed_subref(const sc_signed_subref &a)
sc_signed div_signed_friend(small_type s, int unb, int und, const sc_digit *ud, int vnb, int vnd, const sc_digit *vd)
friend class sc_signed_signal
inline ::std::istream & operator>>(::std::istream &, sc_signed &)
const sc_signed_subref_r & range(int i, int j) const
sc_signed operator+(unsigned int u, const sc_signed &v)
static sc_core::sc_vpool< sc_signed_subref > m_pool
sc_signed sub_signed_friend(small_type us, int unb, int und, const sc_digit *ud, small_type vs, int vnb, int vnd, const sc_digit *vd)
X & operator|=(sc_proxy< X > &px, const sc_proxy< Y > &py)
friend class sc_unsigned_subref
sc_signed_bitref & bit(int i)
void convert_signed_SM_to_2C(small_type s, int nd, sc_digit *d)
small_type default_sign() const
friend class sc_signed_bitref
bool operator>(unsigned int u, const sc_signed &v)
virtual ~sc_signed_subref_r()
sc_signed_subref_r(const sc_signed_subref_r &a)
sc_signed operator&(unsigned int u, const sc_signed &v)
const std::string to_string(sc_enc enc)
Time operator-(const Time &l, const Time &r)
bool operator==(unsigned int u, const sc_signed &v)
friend class sc_concatref
bool operator<(unsigned int u, const sc_signed &v)
X & operator&=(sc_proxy< X > &px, const sc_proxy< Y > &py)
bool sc_io_show_base(::std::ostream &os)
sc_proxy< X >::value_type xor_reduce(const sc_proxy< X > &a)
sc_signed_bitref(const sc_signed_bitref &a)
sc_signed operator^(unsigned int u, const sc_signed &v)
const sc_signed & operator=(int v)
sc_signed operator%(unsigned int u, const sc_signed &v)
bool operator>=(unsigned int u, const sc_signed &v)
sc_proxy< X >::value_type xnor_reduce(const sc_proxy< X > &a)
sc_proxy< X >::value_type or_reduce(const sc_proxy< X > &a)
void copy_digits_signed(small_type &us, int unb, int und, sc_digit *ud, int vnb, int vnd, const sc_digit *vd)
void initialize(const sc_signed *obj_p, int left_, int right_)
virtual ~sc_signed_bitref_r()
virtual int concat_length(bool *xz_present_p) const
sc_signed or_signed_friend(small_type us, int unb, int und, const sc_digit *ud, small_type vs, int vnb, int vnd, const sc_digit *vd)
const sc_signed_bitref_r & bit(int i) const
virtual bool concat_get_ctrl(sc_digit *dst_p, int low_i) const
sc_proxy< X >::value_type nand_reduce(const sc_proxy< X > &a)
bool operator<=(unsigned int u, const sc_signed &v)
sc_numrep sc_io_base(::std::ostream &os, sc_numrep def_base)
int num_bits(int nb) const
sc_signed operator~(const sc_signed &u)
void check_range(int l, int r) const
sc_signed operator*(unsigned int u, const sc_signed &v)
virtual bool concat_get_data(sc_digit *dst_p, int low_i) const
const sc_lv_base reverse(const sc_proxy< X > &x)
void check_index(int i) const
friend class sc_signed_subref_r
sc_signed_bitref_r(const sc_signed_bitref_r &a)
sc_proxy< X >::value_type nor_reduce(const sc_proxy< X > &a)
sc_signed xor_signed_friend(small_type us, int unb, int und, const sc_digit *ud, small_type vs, int vnb, int vnd, const sc_digit *vd)
virtual int concat_length(bool *xz_present_p) const
small_type convert_signed_2C_to_SM(int nb, int nd, sc_digit *d)
small_type convert_signed_SM_to_2C_to_SM(small_type s, int nb, int nd, sc_digit *d)
sc_signed operator|(unsigned int u, const sc_signed &v)
inline ::std::ostream & operator<<(::std::ostream &, const sc_signed &)
sc_signed operator/(unsigned int u, const sc_signed &v)
virtual uint64 concat_get_uint64() const
sc_digit * get_raw() const
void print(::std::ostream &os=::std::cout) const
virtual int concat_length(bool *xz_present_p) const
void dump()
Dump all statistics data to the registered outputs.
sc_signed mul_signed_friend(small_type s, int unb, int und, const sc_digit *ud, int vnb, int vnd, const sc_digit *vd)
sc_proxy< X >::value_type and_reduce(const sc_proxy< X > &a)
X & operator^=(sc_proxy< X > &px, const sc_proxy< Y > &py)
sc_signed and_signed_friend(small_type us, int unb, int und, const sc_digit *ud, small_type vs, int vnb, int vnd, const sc_digit *vd)
bool operator!=(unsigned int u, const sc_signed &v)
small_type make_zero(int nd, sc_digit *d)
sc_signed add_signed_friend(small_type us, int unb, int und, const sc_digit *ud, small_type vs, int vnb, int vnd, const sc_digit *vd)
void convert_SM_to_2C_to_SM()
static sc_core::sc_vpool< sc_signed_bitref > m_pool
sc_signed mod_signed_friend(small_type us, int unb, int und, const sc_digit *ud, int vnb, int vnd, const sc_digit *vd)
void print(::std::ostream &os=::std::cout) const
void initialize(const sc_signed *obj_p, int index_)
friend class sc_signed_bitref_r
friend class sc_signed_subref
Generated on Wed Sep 30 2020 14:02:16 for gem5 by doxygen 1.8.17