27 #ifndef SC_BIT_PROXIES_H
28 #define SC_BIT_PROXIES_H
64 typedef typename traits_type::bit_type
bit_type;
131 void print( ::std::ostream& os = ::std::cout )
const
151 template <
class T1,
class T2>
159 template <
class T1,
class T2>
167 template <
class T1,
class T2>
175 template <
class T1,
class T2>
180 template <
class T1,
class T2>
188 template <
class T1,
class T2>
193 template <
class T1,
class T2>
198 template <
class T1,
class T2,
class T3>
203 template <
class T1,
class T2>
239 template <
class T1,
class T2>
244 template <
class T1,
class T2>
249 template <
class T1,
class T2,
class T3>
254 template <
class T1,
class T2>
290 #ifdef SC_DT_MIXED_COMMA_OPERATORS
292 template <
class T1,
class T2>
297 template <
class T1,
class T2>
302 template <
class T1,
class T2>
307 template <
class T1,
class T2>
312 template <
class T1,
class T2,
class T3>
317 template <
class T1,
class T2,
class T3>
322 template <
class T1,
class T2>
327 template <
class T1,
class T2>
363 template <
class T1,
class T2>
368 template <
class T1,
class T2>
373 template <
class T1,
class T2>
378 template <
class T1,
class T2>
383 template <
class T1,
class T2,
class T3>
388 template <
class T1,
class T2,
class T3>
393 template <
class T1,
class T2>
398 template <
class T1,
class T2>
480 { *
this =
sc_logic( v );
return *
this; }
483 { *
this =
sc_logic( a );
return *
this; }
486 { *
this =
sc_logic( a );
return *
this; }
489 { *
this =
sc_logic( a );
return *
this; }
492 { *
this =
sc_logic( a );
return *
this; }
501 { *
this &=
sc_logic( v );
return *
this; }
504 { *
this &=
sc_logic( a );
return *
this; }
507 { *
this &=
sc_logic( a );
return *
this; }
510 { *
this &=
sc_logic( a );
return *
this; }
517 { *
this |=
sc_logic( v );
return *
this; }
520 { *
this |=
sc_logic( a );
return *
this; }
523 { *
this |=
sc_logic( a );
return *
this; }
526 { *
this |=
sc_logic( a );
return *
this; }
533 { *
this ^=
sc_logic( v );
return *
this; }
536 { *
this ^=
sc_logic( a );
return *
this; }
539 { *
this ^=
sc_logic( a );
return *
this; }
542 { *
this ^=
sc_logic( a );
return *
this; }
560 { this->
m_obj.clean_tail(); }
565 void scan( ::std::istream& is = ::std::cin );
576 template <
class T1,
class T2>
578 sc_concref<sc_bitref<T1>,sc_bitref<T2> >
581 template <
class T1,
class T2>
583 sc_concref<sc_bitref<T1>,sc_subref<T2> >
586 template <
class T1,
class T2,
class T3>
588 sc_concref<sc_bitref<T1>,sc_concref<T2,T3> >
589 operator , ( sc_bitref<T1>, sc_concref<T2,T3> );
591 template <
class T1,
class T2>
593 sc_concref<sc_bitref<T1>,T2>
597 template <
class T1,
class T2>
599 sc_concref<sc_bitref<T1>,sc_bitref<T2> >
600 concat( sc_bitref<T1>, sc_bitref<T2> );
602 template <
class T1,
class T2>
604 sc_concref<sc_bitref<T1>,sc_subref<T2> >
605 concat( sc_bitref<T1>, sc_subref<T2> );
607 template <
class T1,
class T2,
class T3>
609 sc_concref<sc_bitref<T1>,sc_concref<T2,T3> >
610 concat( sc_bitref<T1>, sc_concref<T2,T3> );
612 template <
class T1,
class T2>
614 sc_concref<sc_bitref<T1>,T2>
615 concat( sc_bitref<T1>, sc_proxy<T2>& );
631 :
public sc_proxy<sc_subref_r<X> >
675 {
m_obj.clean_tail(); }
702 template <
class T1,
class T2>
707 template <
class T1,
class T2>
712 template <
class T1,
class T2,
class T3>
717 template <
class T1,
class T2>
753 template <
class T1,
class T2>
758 template <
class T1,
class T2>
763 template <
class T1,
class T2,
class T3>
768 template <
class T1,
class T2>
804 #ifdef SC_DT_MIXED_COMMA_OPERATORS
806 template <
class T1,
class T2>
811 template <
class T1,
class T2>
816 template <
class T1,
class T2>
821 template <
class T1,
class T2>
826 template <
class T1,
class T2,
class T3>
831 template <
class T1,
class T2,
class T3>
836 template <
class T1,
class T2>
841 template <
class T1,
class T2>
877 template <
class T1,
class T2>
882 template <
class T1,
class T2>
887 template <
class T1,
class T2>
892 template <
class T1,
class T2>
897 template <
class T1,
class T2,
class T3>
902 template <
class T1,
class T2,
class T3>
907 template <
class T1,
class T2>
912 template <
class T1,
class T2>
1038 void scan( ::std::istream& = ::std::cin );
1049 template <
class T1,
class T2>
1051 sc_concref<sc_subref<T1>,sc_bitref<T2> >
1054 template <
class T1,
class T2>
1056 sc_concref<sc_subref<T1>,sc_subref<T2> >
1059 template <
class T1,
class T2,
class T3>
1061 sc_concref<sc_subref<T1>,sc_concref<T2,T3> >
1062 operator , ( sc_subref<T1>, sc_concref<T2,T3> );
1064 template <
class T1,
class T2>
1066 sc_concref<sc_subref<T1>,T2>
1070 template <
class T1,
class T2>
1072 sc_concref<sc_subref<T1>,sc_bitref<T2> >
1073 concat( sc_subref<T1>, sc_bitref<T2> );
1075 template <
class T1,
class T2>
1077 sc_concref<sc_subref<T1>,sc_subref<T2> >
1078 concat( sc_subref<T1>, sc_subref<T2> );
1080 template <
class T1,
class T2,
class T3>
1082 sc_concref<sc_subref<T1>,sc_concref<T2,T3> >
1083 concat( sc_subref<T1>, sc_concref<T2,T3> );
1085 template <
class T1,
class T2>
1087 sc_concref<sc_subref<T1>,T2>
1088 concat( sc_subref<T1>, sc_proxy<T2>& );
1103 template <
class X,
class Y>
1105 :
public sc_proxy<sc_concref_r<X,Y> >
1179 template <
class T1,
class T2,
class T3>
1184 template <
class T1,
class T2,
class T3>
1189 template <
class T1,
class T2,
class T3,
class T4>
1194 template <
class T1,
class T2,
class T3>
1199 template <
class T1,
class T2>
1204 template <
class T1,
class T2>
1209 template <
class T1,
class T2>
1214 template <
class T1,
class T2>
1219 template <
class T1,
class T2>
1224 template <
class T1,
class T2>
1230 template <
class T1,
class T2,
class T3>
1235 template <
class T1,
class T2,
class T3>
1240 template <
class T1,
class T2,
class T3,
class T4>
1245 template <
class T1,
class T2,
class T3>
1250 template <
class T1,
class T2>
1255 template <
class T1,
class T2>
1260 template <
class T1,
class T2>
1265 template <
class T1,
class T2>
1270 template <
class T1,
class T2>
1275 template <
class T1,
class T2>
1281 #ifdef SC_DT_MIXED_COMMA_OPERATORS
1283 template <
class T1,
class T2,
class T3>
1288 template <
class T1,
class T2,
class T3>
1293 template <
class T1,
class T2,
class T3>
1298 template <
class T1,
class T2,
class T3>
1303 template <
class T1,
class T2,
class T3,
class T4>
1308 template <
class T1,
class T2,
class T3,
class T4>
1313 template <
class T1,
class T2,
class T3>
1318 template <
class T1,
class T2,
class T3>
1323 template <
class T1,
class T2>
1328 template <
class T1,
class T2>
1333 template <
class T1,
class T2>
1338 template <
class T1,
class T2>
1343 template <
class T1,
class T2>
1348 template <
class T1,
class T2>
1354 template <
class T1,
class T2,
class T3>
1359 template <
class T1,
class T2,
class T3>
1364 template <
class T1,
class T2,
class T3>
1369 template <
class T1,
class T2,
class T3>
1374 template <
class T1,
class T2,
class T3,
class T4>
1379 template <
class T1,
class T2,
class T3,
class T4>
1384 template <
class T1,
class T2,
class T3>
1389 template <
class T1,
class T2,
class T3>
1394 template <
class T1,
class T2>
1399 template <
class T1,
class T2>
1404 template <
class T1,
class T2>
1409 template <
class T1,
class T2>
1414 template <
class T1,
class T2>
1419 template <
class T1,
class T2>
1433 template <
class X,
class Y>
1515 void scan( ::std::istream& = ::std::cin );
1526 template <
class T1,
class T2,
class T3>
1528 sc_concref<sc_concref<T1,T2>,sc_bitref<T3> >
1529 operator , ( sc_concref<T1,T2>, sc_bitref<T3> );
1531 template <
class T1,
class T2,
class T3>
1533 sc_concref<sc_concref<T1,T2>,sc_subref<T3> >
1534 operator , ( sc_concref<T1,T2>, sc_subref<T3> );
1536 template <
class T1,
class T2,
class T3,
class T4>
1538 sc_concref<sc_concref<T1,T2>,sc_concref<T3,T4> >
1539 operator , ( sc_concref<T1,T2>, sc_concref<T3,T4> );
1541 template <
class T1,
class T2,
class T3>
1543 sc_concref<sc_concref<T1,T2>,T3>
1544 operator , ( sc_concref<T1,T2>, sc_proxy<T3>& );
1547 template <
class T1,
class T2,
class T3>
1549 sc_concref<sc_concref<T1,T2>,sc_bitref<T3> >
1550 concat( sc_concref<T1,T2>, sc_bitref<T3> );
1552 template <
class T1,
class T2,
class T3>
1554 sc_concref<sc_concref<T1,T2>,sc_subref<T3> >
1555 concat( sc_concref<T1,T2>, sc_subref<T3> );
1557 template <
class T1,
class T2,
class T3,
class T4>
1559 sc_concref<sc_concref<T1,T2>,sc_concref<T3,T4> >
1560 concat( sc_concref<T1,T2>, sc_concref<T3,T4> );
1562 template <
class T1,
class T2,
class T3>
1564 sc_concref<sc_concref<T1,T2>,T3>
1565 concat( sc_concref<T1,T2>, sc_proxy<T3>& );
1568 template <
class T1,
class T2>
1571 operator >> ( ::std::istream&, sc_concref<T1,T2> );
1583 template <
class T1,
class T2>
1585 sc_concref_r<T1,sc_bitref_r<T2> >
1586 operator , (
const sc_proxy<T1>&, sc_bitref_r<T2> );
1588 template <
class T1,
class T2>
1590 sc_concref_r<T1,sc_subref_r<T2> >
1591 operator , (
const sc_proxy<T1>&, sc_subref_r<T2> );
1593 template <
class T1,
class T2,
class T3>
1595 sc_concref_r<T1,sc_concref_r<T2,T3> >
1596 operator , (
const sc_proxy<T1>&, sc_concref_r<T2,T3> );
1598 template <
class T1,
class T2>
1601 operator , (
const sc_proxy<T1>&,
const sc_proxy<T2>& );
1605 sc_concref_r<T,sc_lv_base>
1606 operator , (
const sc_proxy<T>&,
const char* );
1610 sc_concref_r<sc_lv_base,T>
1611 operator , (
const char*,
const sc_proxy<T>& );
1615 sc_concref_r<T,sc_lv_base>
1616 operator , (
const sc_proxy<T>&,
const sc_logic& );
1620 sc_concref_r<sc_lv_base,T>
1621 operator , (
const sc_logic&,
const sc_proxy<T>& );
1625 sc_concref_r<T,sc_bv_base>
1630 sc_concref_r<sc_bv_base,T>
1634 template <
class T1,
class T2>
1636 sc_concref_r<T1,sc_bitref_r<T2> >
1637 concat(
const sc_proxy<T1>&, sc_bitref_r<T2> );
1639 template <
class T1,
class T2>
1641 sc_concref_r<T1,sc_subref_r<T2> >
1642 concat(
const sc_proxy<T1>&, sc_subref_r<T2> );
1644 template <
class T1,
class T2,
class T3>
1646 sc_concref_r<T1,sc_concref_r<T2,T3> >
1647 concat(
const sc_proxy<T1>&, sc_concref_r<T2,T3> );
1649 template <
class T1,
class T2>
1652 concat(
const sc_proxy<T1>&,
const sc_proxy<T2>& );
1656 sc_concref_r<T,sc_lv_base>
1657 concat(
const sc_proxy<T>&,
const char* );
1661 sc_concref_r<sc_lv_base,T>
1662 concat(
const char*,
const sc_proxy<T>& );
1666 sc_concref_r<T,sc_lv_base>
1667 concat(
const sc_proxy<T>&,
const sc_logic& );
1671 sc_concref_r<sc_lv_base,T>
1672 concat(
const sc_logic&,
const sc_proxy<T>& );
1676 sc_concref_r<T,sc_bv_base>
1677 concat(
const sc_proxy<T>&,
bool );
1681 sc_concref_r<sc_bv_base,T>
1682 concat(
bool,
const sc_proxy<T>& );
1685 #ifdef SC_DT_MIXED_COMMA_OPERATORS
1687 template <
class T1,
class T2>
1689 sc_concref_r<T1,sc_bitref_r<T2> >
1690 operator , (
const sc_proxy<T1>&, sc_bitref<T2> );
1692 template <
class T1,
class T2>
1694 sc_concref_r<T1,sc_bitref_r<T2> >
1695 operator , ( sc_proxy<T1>&, sc_bitref_r<T2> );
1697 template <
class T1,
class T2>
1699 sc_concref_r<T1,sc_subref_r<T2> >
1700 operator , (
const sc_proxy<T1>&, sc_subref<T2> );
1702 template <
class T1,
class T2>
1704 sc_concref_r<T1,sc_subref_r<T2> >
1705 operator , ( sc_proxy<T1>&, sc_subref_r<T2> );
1707 template <
class T1,
class T2,
class T3>
1709 sc_concref_r<T1,sc_concref_r<T2,T3> >
1710 operator , (
const sc_proxy<T1>&, sc_concref<T2,T3> );
1712 template <
class T1,
class T2,
class T3>
1714 sc_concref_r<T1,sc_concref_r<T2,T3> >
1715 operator , ( sc_proxy<T1>&, sc_concref_r<T2,T3> );
1717 template <
class T1,
class T2>
1720 operator , (
const sc_proxy<T1>&, sc_proxy<T2>& );
1722 template <
class T1,
class T2>
1725 operator , ( sc_proxy<T1>&,
const sc_proxy<T2>& );
1729 sc_concref_r<T,sc_lv_base>
1734 sc_concref_r<sc_lv_base,T>
1739 sc_concref_r<T,sc_lv_base>
1740 operator , ( sc_proxy<T>&,
const sc_logic& );
1744 sc_concref_r<sc_lv_base,T>
1745 operator , (
const sc_logic&, sc_proxy<T>& );
1749 sc_concref_r<T,sc_bv_base>
1754 sc_concref_r<sc_bv_base,T>
1758 template <
class T1,
class T2>
1760 sc_concref_r<T1,sc_bitref_r<T2> >
1761 concat(
const sc_proxy<T1>&, sc_bitref<T2> );
1763 template <
class T1,
class T2>
1765 sc_concref_r<T1,sc_bitref_r<T2> >
1766 concat( sc_proxy<T1>&, sc_bitref_r<T2> );
1768 template <
class T1,
class T2>
1770 sc_concref_r<T1,sc_subref_r<T2> >
1771 concat(
const sc_proxy<T1>&, sc_subref<T2> );
1773 template <
class T1,
class T2>
1775 sc_concref_r<T1,sc_subref_r<T2> >
1776 concat( sc_proxy<T1>&, sc_subref_r<T2> );
1778 template <
class T1,
class T2,
class T3>
1780 sc_concref_r<T1,sc_concref_r<T2,T3> >
1781 concat(
const sc_proxy<T1>&, sc_concref<T2,T3> );
1783 template <
class T1,
class T2,
class T3>
1785 sc_concref_r<T1,sc_concref_r<T2,T3> >
1786 concat( sc_proxy<T1>&, sc_concref_r<T2,T3> );
1788 template <
class T1,
class T2>
1791 concat(
const sc_proxy<T1>&, sc_proxy<T2>& );
1793 template <
class T1,
class T2>
1796 concat( sc_proxy<T1>&,
const sc_proxy<T2>& );
1800 sc_concref_r<T,sc_lv_base>
1801 concat( sc_proxy<T>&,
const char* );
1805 sc_concref_r<sc_lv_base,T>
1806 concat(
const char*, sc_proxy<T>& );
1810 sc_concref_r<T,sc_lv_base>
1811 concat( sc_proxy<T>&,
const sc_logic& );
1815 sc_concref_r<sc_lv_base,T>
1816 concat(
const sc_logic&, sc_proxy<T>& );
1820 sc_concref_r<T,sc_bv_base>
1821 concat( sc_proxy<T>&,
bool );
1825 sc_concref_r<sc_bv_base,T>
1826 concat(
bool, sc_proxy<T>& );
1833 template <
class T1,
class T2>
1835 sc_concref<T1,sc_bitref<T2> >
1838 template <
class T1,
class T2>
1840 sc_concref<T1,sc_subref<T2> >
1843 template <
class T1,
class T2,
class T3>
1845 sc_concref<T1,sc_concref<T2,T3> >
1846 operator , ( sc_proxy<T1>&, sc_concref<T2,T3> );
1848 template <
class T1,
class T2>
1854 template <
class T1,
class T2>
1856 sc_concref<T1,sc_bitref<T2> >
1857 concat( sc_proxy<T1>&, sc_bitref<T2> );
1859 template <
class T1,
class T2>
1861 sc_concref<T1,sc_subref<T2> >
1862 concat( sc_proxy<T1>&, sc_subref<T2> );
1864 template <
class T1,
class T2,
class T3>
1866 sc_concref<T1,sc_concref<T2,T3> >
1867 concat( sc_proxy<T1>&, sc_concref<T2,T3> );
1869 template <
class T1,
class T2>
1872 concat( sc_proxy<T1>&, sc_proxy<T2>& );
1887 template <
class T1,
class T2>
1898 template <
class T1,
class T2>
1909 template <
class T1,
class T2>
1920 template <
class T1,
class T2>
1928 template <
class T1,
class T2>
1945 return m_obj.get_bit( m_index );
1985 template <
class T1,
class T2>
1994 template <
class T1,
class T2>
1996 sc_concref_r<sc_bitref_r<T1>,sc_subref_r<T2> >
2000 *a.
clone(), *b.clone(), 3 );
2003 template <
class T1,
class T2,
class T3>
2005 sc_concref_r<sc_bitref_r<T1>,sc_concref_r<T2,T3> >
2009 *a.
clone(), *b.clone(), 3 );
2012 template <
class T1,
class T2>
2014 sc_concref_r<sc_bitref_r<T1>,T2>
2022 template <
class T1,
class T2>
2024 sc_concref_r<sc_bitref_r<T1>,sc_bitref_r<T2> >
2031 template <
class T1,
class T2>
2033 sc_concref_r<sc_bitref_r<T1>,sc_subref_r<T2> >
2037 *a.
clone(), *b.clone(), 3 );
2040 template <
class T1,
class T2,
class T3>
2042 sc_concref_r<sc_bitref_r<T1>,sc_concref_r<T2,T3> >
2046 *a.
clone(), *b.clone(), 3 );
2049 template <
class T1,
class T2>
2051 sc_concref_r<sc_bitref_r<T1>,T2>
2059 #ifdef SC_DT_MIXED_COMMA_OPERATORS
2061 template <
class T1,
class T2>
2063 sc_concref_r<sc_bitref_r<T1>,sc_bitref_r<T2> >
2070 template <
class T1,
class T2>
2072 sc_concref_r<sc_bitref_r<T1>,sc_bitref_r<T2> >
2079 template <
class T1,
class T2>
2081 sc_concref_r<sc_bitref_r<T1>,sc_subref_r<T2> >
2088 template <
class T1,
class T2>
2090 sc_concref_r<sc_bitref_r<T1>,sc_subref_r<T2> >
2094 *a.
clone(), *b.clone(), 3 );
2097 template <
class T1,
class T2,
class T3>
2099 sc_concref_r<sc_bitref_r<T1>,sc_concref_r<T2,T3> >
2106 template <
class T1,
class T2,
class T3>
2108 sc_concref_r<sc_bitref_r<T1>,sc_concref_r<T2,T3> >
2112 *a.
clone(), *b.clone(), 3 );
2115 template <
class T1,
class T2>
2117 sc_concref_r<sc_bitref_r<T1>,T2>
2124 template <
class T1,
class T2>
2126 sc_concref_r<sc_bitref_r<T1>,T2>
2134 template <
class T1,
class T2>
2136 sc_concref_r<sc_bitref_r<T1>,sc_bitref_r<T2> >
2143 template <
class T1,
class T2>
2145 sc_concref_r<sc_bitref_r<T1>,sc_bitref_r<T2> >
2152 template <
class T1,
class T2>
2154 sc_concref_r<sc_bitref_r<T1>,sc_subref_r<T2> >
2161 template <
class T1,
class T2>
2163 sc_concref_r<sc_bitref_r<T1>,sc_subref_r<T2> >
2167 *a.
clone(), *b.clone(), 3 );
2170 template <
class T1,
class T2,
class T3>
2172 sc_concref_r<sc_bitref_r<T1>,sc_concref_r<T2,T3> >
2179 template <
class T1,
class T2,
class T3>
2181 sc_concref_r<sc_bitref_r<T1>,sc_concref_r<T2,T3> >
2185 *a.
clone(), *b.clone(), 3 );
2188 template <
class T1,
class T2>
2190 sc_concref_r<sc_bitref_r<T1>,T2>
2197 template <
class T1,
class T2>
2199 sc_concref_r<sc_bitref_r<T1>,T2>
2222 this->m_obj.set_bit( this->m_index, a.
value() );
2232 this->m_obj.set_bit( this->m_index, a.
value() );
2246 this->m_obj.set_bit( this->m_index,
2257 this->m_obj.set_bit( this->m_index,
2269 this->m_obj.set_bit( this->m_index,
2280 this->m_obj.set_bit( this->m_index,
2292 this->m_obj.set_bit( this->m_index,
2303 this->m_obj.set_bit( this->m_index,
2318 this->m_obj.set_bit( this->m_index,
2332 this->m_obj.set_bit( this->m_index, value );
2343 unsigned int bi = this->m_index % (8*
sizeof(
sc_digit));
2345 unsigned int wi = this->m_index / (8*
sizeof(
sc_digit));
2347 temp = this->m_obj.get_word(wi);
2348 temp = (temp & ~(1 << bi)) | ((w&1) << bi);
2349 this->m_obj.set_word(wi, temp);
2361 unsigned int bi = this->m_index % (8*
sizeof(
sc_digit));
2363 unsigned int wi = this->m_index / (8*
sizeof(
sc_digit));
2365 temp = this->m_obj.get_cword(wi);
2366 temp = (temp & ~(1 << bi)) | ((w&1) << bi);
2367 this->m_obj.set_cword(wi, temp);
2388 template <
class T1,
class T2>
2397 template <
class T1,
class T2>
2399 sc_concref<sc_bitref<T1>,sc_subref<T2> >
2406 template <
class T1,
class T2,
class T3>
2408 sc_concref<sc_bitref<T1>,sc_concref<T2,T3> >
2415 template <
class T1,
class T2>
2417 sc_concref<sc_bitref<T1>,T2>
2425 template <
class T1,
class T2>
2427 sc_concref<sc_bitref<T1>,sc_bitref<T2> >
2434 template <
class T1,
class T2>
2436 sc_concref<sc_bitref<T1>,sc_subref<T2> >
2443 template <
class T1,
class T2,
class T3>
2445 sc_concref<sc_bitref<T1>,sc_concref<T2,T3> >
2452 template <
class T1,
class T2>
2454 sc_concref<sc_bitref<T1>,T2>
2481 sc_subref_r<X>::check_bounds()
2483 int len = m_obj.length();
2484 if( m_hi < 0 || m_hi >= len || m_lo < 0 || m_lo >= len ) {
2488 m_len = m_lo - m_hi + 1;
2490 m_len = m_hi - m_lo + 1;
2503 return m_obj.get_bit( m_lo - n );
2505 return m_obj.get_bit( m_lo + n );
2515 m_obj.set_bit( m_lo - n, value );
2517 m_obj.set_bit( m_lo + n, value );
2533 n2 =
sc_max( n1 - SC_DIGIT_SIZE, m_hi - 1 );
2534 for(
int n = n1; n > n2; n -- ) {
2539 n2 =
sc_min( n1 + SC_DIGIT_SIZE, m_hi + 1 );
2540 for(
int n = n1; n < n2; n ++ ) {
2557 n2 =
sc_max( n1 - SC_DIGIT_SIZE, m_hi - 1 );
2558 for(
int n = n1; n > n2; n -- ) {
2565 n2 =
sc_min( n1 + SC_DIGIT_SIZE, m_hi + 1 );
2566 for(
int n = n1; n < n2; n ++ ) {
2586 n2 =
sc_max( n1 - SC_DIGIT_SIZE, m_hi - 1 );
2587 for(
int n = n1; n > n2; n -- ) {
2588 result |= ((m_obj[n].value() &
SC_DIGIT_TWO) >> 1) << k ++;
2592 n2 =
sc_min( n1 + SC_DIGIT_SIZE, m_hi + 1 );
2593 for(
int n = n1; n < n2; n ++ ) {
2594 result |= ((m_obj[n].value() &
SC_DIGIT_TWO) >> 1) << k ++;
2610 n2 =
sc_max( n1 - SC_DIGIT_SIZE, m_hi - 1 );
2611 for(
int n = n1; n > n2; n -- ) {
2618 n2 =
sc_min( n1 + SC_DIGIT_SIZE, m_hi + 1 );
2619 for(
int n = n1; n < n2; n ++ ) {
2636 for(
int i = 0; i < sz; ++ i ) {
2647 template <
class T1,
class T2>
2653 *a.clone(), *b.
clone(), 3 );
2656 template <
class T1,
class T2>
2658 sc_concref_r<sc_subref_r<T1>,sc_subref_r<T2> >
2662 *a.clone(), *b.clone(), 3 );
2665 template <
class T1,
class T2,
class T3>
2667 sc_concref_r<sc_subref_r<T1>,sc_concref_r<T2,T3> >
2671 *a.clone(), *b.clone(), 3 );
2674 template <
class T1,
class T2>
2676 sc_concref_r<sc_subref_r<T1>,T2>
2684 template <
class T1,
class T2>
2686 sc_concref_r<sc_subref_r<T1>,sc_bitref_r<T2> >
2690 *a.clone(), *b.
clone(), 3 );
2693 template <
class T1,
class T2>
2695 sc_concref_r<sc_subref_r<T1>,sc_subref_r<T2> >
2699 *a.clone(), *b.clone(), 3 );
2702 template <
class T1,
class T2,
class T3>
2704 sc_concref_r<sc_subref_r<T1>,sc_concref_r<T2,T3> >
2708 *a.clone(), *b.clone(), 3 );
2711 template <
class T1,
class T2>
2713 sc_concref_r<sc_subref_r<T1>,T2>
2721 #ifdef SC_DT_MIXED_COMMA_OPERATORS
2723 template <
class T1,
class T2>
2725 sc_concref_r<sc_subref_r<T1>,sc_bitref_r<T2> >
2729 *a.clone(), *b.
clone(), 3 );
2732 template <
class T1,
class T2>
2734 sc_concref_r<sc_subref_r<T1>,sc_bitref_r<T2> >
2741 template <
class T1,
class T2>
2743 sc_concref_r<sc_subref_r<T1>,sc_subref_r<T2> >
2747 *a.clone(), *b.
clone(), 3 );
2750 template <
class T1,
class T2>
2752 sc_concref_r<sc_subref_r<T1>,sc_subref_r<T2> >
2756 *a.
clone(), *b.clone(), 3 );
2759 template <
class T1,
class T2,
class T3>
2761 sc_concref_r<sc_subref_r<T1>,sc_concref_r<T2,T3> >
2765 *a.clone(), *b.
clone(), 3 );
2768 template <
class T1,
class T2,
class T3>
2770 sc_concref_r<sc_subref_r<T1>,sc_concref_r<T2,T3> >
2774 *a.
clone(), *b.clone(), 3 );
2777 template <
class T1,
class T2>
2779 sc_concref_r<sc_subref_r<T1>,T2>
2786 template <
class T1,
class T2>
2788 sc_concref_r<sc_subref_r<T1>,T2>
2796 template <
class T1,
class T2>
2798 sc_concref_r<sc_subref_r<T1>,sc_bitref_r<T2> >
2802 *a.clone(), *b.
clone(), 3 );
2805 template <
class T1,
class T2>
2807 sc_concref_r<sc_subref_r<T1>,sc_bitref_r<T2> >
2814 template <
class T1,
class T2>
2816 sc_concref_r<sc_subref_r<T1>,sc_subref_r<T2> >
2820 *a.clone(), *b.
clone(), 3 );
2823 template <
class T1,
class T2>
2825 sc_concref_r<sc_subref_r<T1>,sc_subref_r<T2> >
2829 *a.
clone(), *b.clone(), 3 );
2832 template <
class T1,
class T2,
class T3>
2834 sc_concref_r<sc_subref_r<T1>,sc_concref_r<T2,T3> >
2838 *a.clone(), *b.
clone(), 3 );
2841 template <
class T1,
class T2,
class T3>
2843 sc_concref_r<sc_subref_r<T1>,sc_concref_r<T2,T3> >
2847 *a.
clone(), *b.clone(), 3 );
2850 template <
class T1,
class T2>
2852 sc_concref_r<sc_subref_r<T1>,T2>
2859 template <
class T1,
class T2>
2861 sc_concref_r<sc_subref_r<T1>,T2>
2898 template <
class T1,
class T2>
2907 template <
class T1,
class T2>
2909 sc_concref<sc_subref<T1>,sc_subref<T2> >
2916 template <
class T1,
class T2,
class T3>
2918 sc_concref<sc_subref<T1>,sc_concref<T2,T3> >
2925 template <
class T1,
class T2>
2927 sc_concref<sc_subref<T1>,T2>
2935 template <
class T1,
class T2>
2937 sc_concref<sc_subref<T1>,sc_bitref<T2> >
2944 template <
class T1,
class T2>
2946 sc_concref<sc_subref<T1>,sc_subref<T2> >
2953 template <
class T1,
class T2,
class T3>
2955 sc_concref<sc_subref<T1>,sc_concref<T2,T3> >
2962 template <
class T1,
class T2>
2964 sc_concref<sc_subref<T1>,T2>
2990 template <
class X,
class Y>
2994 if( -- m_refs == 0 ) {
2996 if( m_delete == 0 ) {
2999 if( m_delete & 1 ) {
3002 if( m_delete & 2 ) {
3011 template <
class X,
class Y>
3016 int r_len = m_right.length();
3018 return m_right.get_bit( n );
3019 }
else if( n < r_len + m_left.length() ) {
3020 return m_left.get_bit( n - r_len );
3028 template <
class X,
class Y>
3033 int r_len = m_right.length();
3035 m_right.set_bit( n, v );
3036 }
else if( n < r_len + m_left.length() ) {
3037 m_left.set_bit( n - r_len, v );
3044 template <
class X,
class Y>
3049 if( i < 0 || i >= size() ) {
3054 int r_len = r.length();
3057 return r.get_word( i );
3064 return l.get_word( j );
3070 return ( (r.get_word( i ) & rl_mask) | (l.get_word( 0 ) << shift) );
3074 return ( (l.get_word( j - 1 ) >> nshift) | (l.get_word( j ) << shift) );
3076 return (l.get_word( j - 1 ) >> nshift);
3079 template <
class X,
class Y>
3084 if( i < 0 || i >= size() ) {
3089 int r_len = r.length();
3108 r.set_word( i, w & rl_mask );
3109 l.set_word( 0, (l.get_word( 0 ) & lh_mask) | (w >> shift) );
3114 l.set_word( j - 1, (l.get_word( j - 1 ) & ll_mask) | (w << nshift) );
3116 l.set_word( j, (l.get_word( j ) & lh_mask) | (w >> shift) );
3120 template <
class X,
class Y>
3125 if( i < 0 || i >= size() ) {
3130 int r_len = r.length();
3133 return r.get_cword( i );
3140 return l.get_cword( j );
3146 return ( (r.get_cword( i ) & rl_mask) | (l.get_cword( 0 ) << shift) );
3150 return ( (l.get_cword(j - 1) >> nshift) | (l.get_cword(j) << shift) );
3152 return (l.get_cword( j - 1 ) >> nshift);
3155 template <
class X,
class Y>
3160 if( i < 0 || i >= size() ) {
3165 int r_len = r.length();
3168 r.set_cword( i, w );
3176 l.set_cword( j, w );
3184 r.set_cword( i, w & rl_mask );
3185 l.set_cword( 0, (l.get_cword( 0 ) & lh_mask) | (w >> shift) );
3190 l.set_cword( j - 1, (l.get_cword( j - 1 ) & ll_mask) | (w << nshift) );
3192 l.set_cword( j, (l.get_cword( j ) & lh_mask) | (w >> shift) );
3198 template <
class T1,
class T2,
class T3>
3204 *a.clone(), *b.
clone(), 3 );
3207 template <
class T1,
class T2,
class T3>
3209 sc_concref_r<sc_concref_r<T1,T2>,sc_subref_r<T3> >
3213 *a.clone(), *b.clone(), 3 );
3216 template <
class T1,
class T2,
class T3,
class T4>
3218 sc_concref_r<sc_concref_r<T1,T2>,sc_concref_r<T3,T4> >
3222 *a.clone(), *b.clone(), 3 );
3225 template <
class T1,
class T2,
class T3>
3227 sc_concref_r<sc_concref_r<T1,T2>,T3>
3235 template <
class T1,
class T2,
class T3>
3237 sc_concref_r<sc_concref_r<T1,T2>,sc_bitref_r<T3> >
3241 *a.clone(), *b.
clone(), 3 );
3244 template <
class T1,
class T2,
class T3>
3246 sc_concref_r<sc_concref_r<T1,T2>,sc_subref_r<T3> >
3250 *a.clone(), *b.clone(), 3 );
3253 template <
class T1,
class T2,
class T3,
class T4>
3255 sc_concref_r<sc_concref_r<T1,T2>,sc_concref_r<T3,T4> >
3259 *a.clone(), *b.clone(), 3 );
3262 template <
class T1,
class T2,
class T3>
3264 sc_concref_r<sc_concref_r<T1,T2>,T3>
3272 #ifdef SC_DT_MIXED_COMMA_OPERATORS
3274 template <
class T1,
class T2,
class T3>
3276 sc_concref_r<sc_concref_r<T1,T2>,sc_bitref_r<T3> >
3280 *a.clone(), *b.
clone(), 3 );
3283 template <
class T1,
class T2,
class T3>
3285 sc_concref_r<sc_concref_r<T1,T2>,sc_bitref_r<T3> >
3292 template <
class T1,
class T2,
class T3>
3294 sc_concref_r<sc_concref_r<T1,T2>,sc_subref_r<T3> >
3298 *a.clone(), *b.
clone(), 3 );
3301 template <
class T1,
class T2,
class T3>
3303 sc_concref_r<sc_concref_r<T1,T2>,sc_subref_r<T3> >
3307 *a.
clone(), *b.clone(), 3 );
3310 template <
class T1,
class T2,
class T3,
class T4>
3312 sc_concref_r<sc_concref_r<T1,T2>,sc_concref_r<T3,T4> >
3316 *a.clone(), *b.
clone(), 3 );
3319 template <
class T1,
class T2,
class T3,
class T4>
3321 sc_concref_r<sc_concref_r<T1,T2>,sc_concref_r<T3,T4> >
3325 *a.
clone(), *b.clone(), 3 );
3328 template <
class T1,
class T2,
class T3>
3330 sc_concref_r<sc_concref_r<T1,T2>,T3>
3337 template <
class T1,
class T2,
class T3>
3339 sc_concref_r<sc_concref_r<T1,T2>,T3>
3347 template <
class T1,
class T2,
class T3>
3349 sc_concref_r<sc_concref_r<T1,T2>,sc_bitref_r<T3> >
3353 *a.clone(), *b.
clone(), 3 );
3356 template <
class T1,
class T2,
class T3>
3358 sc_concref_r<sc_concref_r<T1,T2>,sc_bitref_r<T3> >
3365 template <
class T1,
class T2,
class T3>
3367 sc_concref_r<sc_concref_r<T1,T2>,sc_subref_r<T3> >
3371 *a.clone(), *b.
clone(), 3 );
3374 template <
class T1,
class T2,
class T3>
3376 sc_concref_r<sc_concref_r<T1,T2>,sc_subref_r<T3> >
3380 *a.
clone(), *b.clone(), 3 );
3383 template <
class T1,
class T2,
class T3,
class T4>
3385 sc_concref_r<sc_concref_r<T1,T2>,sc_concref_r<T3,T4> >
3389 *a.clone(), *b.
clone(), 3 );
3392 template <
class T1,
class T2,
class T3,
class T4>
3394 sc_concref_r<sc_concref_r<T1,T2>,sc_concref_r<T3,T4> >
3398 *a.
clone(), *b.clone(), 3 );
3401 template <
class T1,
class T2,
class T3>
3403 sc_concref_r<sc_concref_r<T1,T2>,T3>
3410 template <
class T1,
class T2,
class T3>
3412 sc_concref_r<sc_concref_r<T1,T2>,T3>
3430 template <
class T1,
class T2>
3443 template <
class T1,
class T2,
class T3>
3452 template <
class T1,
class T2,
class T3>
3454 sc_concref<sc_concref<T1,T2>,sc_subref<T3> >
3461 template <
class T1,
class T2,
class T3,
class T4>
3463 sc_concref<sc_concref<T1,T2>,sc_concref<T3,T4> >
3470 template <
class T1,
class T2,
class T3>
3472 sc_concref<sc_concref<T1,T2>,T3>
3480 template <
class T1,
class T2,
class T3>
3482 sc_concref<sc_concref<T1,T2>,sc_bitref<T3> >
3489 template <
class T1,
class T2,
class T3>
3491 sc_concref<sc_concref<T1,T2>,sc_subref<T3> >
3498 template <
class T1,
class T2,
class T3,
class T4>
3500 sc_concref<sc_concref<T1,T2>,sc_concref<T3,T4> >
3507 template <
class T1,
class T2,
class T3>
3509 sc_concref<sc_concref<T1,T2>,T3>
3517 template <
class X,
class Y>
3536 template <
class T1,
class T2>
3538 sc_concref_r<T1,sc_bitref_r<T2> >
3545 template <
class T1,
class T2>
3547 sc_concref_r<T1,sc_subref_r<T2> >
3554 template <
class T1,
class T2,
class T3>
3556 sc_concref_r<T1,sc_concref_r<T2,T3> >
3563 template <
class T1,
class T2>
3573 template <
class T1,
class T2>
3575 sc_concref_r<T1,sc_bitref_r<T2> >
3582 template <
class T1,
class T2>
3584 sc_concref_r<T1,sc_subref_r<T2> >
3591 template <
class T1,
class T2,
class T3>
3593 sc_concref_r<T1,sc_concref_r<T2,T3> >
3600 template <
class T1,
class T2>
3610 #ifdef SC_DT_MIXED_COMMA_OPERATORS
3612 template <
class T1,
class T2>
3614 sc_concref_r<T1,sc_bitref_r<T2> >
3621 template <
class T1,
class T2>
3623 sc_concref_r<T1,sc_bitref_r<T2> >
3630 template <
class T1,
class T2>
3632 sc_concref_r<T1,sc_subref_r<T2> >
3639 template <
class T1,
class T2>
3641 sc_concref_r<T1,sc_subref_r<T2> >
3648 template <
class T1,
class T2,
class T3>
3650 sc_concref_r<T1,sc_concref_r<T2,T3> >
3657 template <
class T1,
class T2,
class T3>
3659 sc_concref_r<T1,sc_concref_r<T2,T3> >
3666 template <
class T1,
class T2>
3675 template <
class T1,
class T2>
3685 template <
class T1,
class T2>
3687 sc_concref_r<T1,sc_bitref_r<T2> >
3694 template <
class T1,
class T2>
3696 sc_concref_r<T1,sc_bitref_r<T2> >
3703 template <
class T1,
class T2>
3705 sc_concref_r<T1,sc_subref_r<T2> >
3712 template <
class T1,
class T2>
3714 sc_concref_r<T1,sc_subref_r<T2> >
3721 template <
class T1,
class T2,
class T3>
3723 sc_concref_r<T1,sc_concref_r<T2,T3> >
3730 template <
class T1,
class T2,
class T3>
3732 sc_concref_r<T1,sc_concref_r<T2,T3> >
3739 template <
class T1,
class T2>
3748 template <
class T1,
class T2>
3762 template <
class T1,
class T2>
3764 sc_concref<T1,sc_bitref<T2> >
3771 template <
class T1,
class T2>
3773 sc_concref<T1,sc_subref<T2> >
3780 template <
class T1,
class T2,
class T3>
3782 sc_concref<T1,sc_concref<T2,T3> >
3789 template <
class T1,
class T2>
3799 template <
class T1,
class T2>
3801 sc_concref<T1,sc_bitref<T2> >
3808 template <
class T1,
class T2>
3810 sc_concref<T1,sc_subref<T2> >
3817 template <
class T1,
class T2,
class T3>
3819 sc_concref<T1,sc_concref<T2,T3> >
3826 template <
class T1,
class T2>
sc_digit get_cword(int i) const
sc_digit get_cword(int i) const
void set_bit(int n, sc_logic_value_t value)
sc_bitref< X > & operator=(const sc_bitref_r< X > &a)
traits_type::bit_type bit_type
const sc_bit operator|(const sc_bit &a, const sc_bit &b)
#define SC_REPORT_ERROR(msg_type, msg)
sc_subref_r< X > base_type
sc_logic_value_t get_bit(int n) const
const sc_bit operator^(const sc_bit &a, const sc_bit &b)
const bit_type operator~() const
void scan(::std::istream &=::std::cin)
sc_subref(const sc_subref< X > &a)
sc_bitref< X > & operator&=(const sc_bitref_r< X > &a)
const sc_digit SC_DIGIT_TWO
T::traits_type traits_type
sc_logic_value_t value() const
sc_digit get_word(int i) const
void set_cword(int i, sc_digit w)
sc_subref_r< X > * clone() const
sc_bitref_r(const sc_bitref_r< T > &a)
sc_bitref_r< T > * clone() const
sc_concref_r< X, Y > * clone() const
sc_bitref< X > & operator|=(const sc_bitref_r< X > &a)
sc_subref< X > * clone() const
sc_digit get_word(int i) const
void set_word(int i, sc_digit w)
void set_cword(int i, sc_digit w)
uint64 const sc_uint_base int b
sc_concref_r(const sc_concref_r< X, Y > &a)
bool operator!=(const sc_bit &a, const sc_bit &b)
sc_digit get_word(int i) const
bool operator==(const sc_bit &a, const sc_bit &b)
void set_word(int i, sc_digit w)
sc_subref(X &obj_, int hi_, int lo_)
void scan(::std::istream &is=::std::cin)
void print(::std::ostream &os=::std::cout) const
const sc_digit SC_DIGIT_ONE
static const sc_logic_value_t xor_table[4][4]
inline::std::istream & operator>>(::std::istream &is, sc_bit &a)
sc_bitref(X &obj_, int index_)
sc_subref< X > & operator=(const sc_proxy< Y > &a)
static const sc_logic_value_t or_table[4][4]
const T sc_min(const T &a, const T &b)
sc_subref_r< X > & assign_(const sc_proxy< Y > &a)
sc_concref(X &left_, Y &right_, int delete_=0)
const sc_digit SC_DIGIT_ZERO
sc_logic_value_t get_bit(int n) const
sc_bitref(const sc_bitref< X > &a)
void set_word(int i, sc_digit w)
sc_digit get_cword(int i) const
static const sc_logic_value_t and_table[4][4]
sc_logic_value_t value() const
sc_subref_r(const X &obj_, int hi_, int lo_)
sc_concref(const sc_concref< X, Y > &a)
sc_bitref_r(const T &obj_, int index_)
void set_bit(int n, sc_logic_value_t value)
const char SC_ID_OUT_OF_BOUNDS_[]
sc_clock period is zero sc_clock low time is zero sc_fifo< T > cannot have more than one writer bind interface to port failed complete binding failed remove port failed insert primitive channel failed sc_signal< T > cannot have more than one driver resolved port not bound to resolved signal sc_semaphore requires an initial value
sc_concref< X, Y > & operator=(const sc_proxy< Z > &a)
sc_subref_r(const sc_subref_r< X > &a)
static const sc_logic_value_t not_table[4]
sc_concref_r< sc_bitref_r< T1 >, sc_bitref_r< T2 > > concat(sc_bitref_r< T1 >, sc_bitref_r< T2 >)
const T sc_max(const T &a, const T &b)
const sc_bit operator&(const sc_bit &a, const sc_bit &b)
sc_concref< X, Y > * clone() const
sc_bitref< X > * clone() const
void set_bit(int n, sc_logic_value_t value)
sc_concref_r(const X &left_, const Y &right_, int delete_=0)
sc_concref_r< sc_bitref_r< T1 >, sc_bitref_r< T2 > > operator,(sc_bitref_r< T1 >, sc_bitref_r< T2 >)
sc_logic_value_t get_bit(int n) const
sc_concref_r< X, Y > base_type
void scan(::std::istream &=::std::cin)
sc_bitref< X > & operator^=(const sc_bitref_r< X > &a)
void set_cword(int i, sc_digit w)