#include <sc_bit_proxies.h>
Public メソッド | |
sc_subref_r (const X &obj_, int hi_, int lo_) | |
sc_subref_r (const sc_subref_r< X > &a) | |
sc_subref_r< X > * | clone () const |
int | length () const |
int | size () const |
sc_logic_value_t | get_bit (int n) const |
void | set_bit (int n, sc_logic_value_t value) |
sc_digit | get_word (int i) const |
void | set_word (int i, sc_digit w) |
sc_digit | get_cword (int i) const |
void | set_cword (int i, sc_digit w) |
void | clean_tail () |
bool | is_01 () const |
bool | reversed () const |
Protected 変数 | |
X & | m_obj |
int | m_hi |
int | m_lo |
int | m_len |
Private メソッド | |
void | check_bounds () |
sc_subref_r () | |
sc_subref_r< X > & | operator= (const sc_subref_r< X > &) |
sc_bit_proxies.h の 659 行で定義されています。
sc_dt::sc_subref_r< X >::sc_subref_r | ( | const X & | obj_, | |
int | hi_, | |||
int | lo_ | |||
) | [inline] |
sc_bit_proxies.h の 668 行で定義されています。
00669 : m_obj( CCAST<X&>( obj_ ) ), m_hi( hi_ ), m_lo( lo_ ), m_len( 0 ) 00670 { check_bounds(); }
sc_dt::sc_subref_r< X >::sc_subref_r | ( | const sc_subref_r< X > & | a | ) | [inline] |
sc_dt::sc_subref_r< X >::sc_subref_r | ( | ) | [private] |
void sc_dt::sc_subref_r< X >::check_bounds | ( | ) | [inline, private] |
sc_bit_proxies.h の 2510 行で定義されています。
02511 { 02512 int len = m_obj.length(); 02513 if( m_hi < 0 || m_hi >= len || m_lo < 0 || m_lo >= len ) { 02514 SC_REPORT_ERROR( sc_core::SC_ID_OUT_OF_BOUNDS_, 0 ); 02515 } 02516 if( reversed() ) { 02517 m_len = m_lo - m_hi + 1; 02518 } else { 02519 m_len = m_hi - m_lo + 1; 02520 } 02521 }
sc_subref_r<X>* sc_dt::sc_subref_r< X >::clone | ( | ) | const [inline] |
int sc_dt::sc_subref_r< X >::length | ( | ) | const [inline] |
int sc_dt::sc_subref_r< X >::size | ( | ) | const [inline] |
sc_logic_value_t sc_dt::sc_subref_r< X >::get_bit | ( | int | n | ) | const [inline] |
void sc_dt::sc_subref_r< X >::set_bit | ( | int | n, | |
sc_logic_value_t | value | |||
) | [inline] |
sc_digit sc_dt::sc_subref_r< X >::get_word | ( | int | i | ) | const [inline] |
sc_bit_proxies.h の 2554 行で定義されています。
02555 { 02556 int n1 = 0; 02557 int n2 = 0; 02558 sc_digit result = 0; 02559 int k = 0; 02560 if( reversed() ) { 02561 n1 = m_lo - i * SC_DIGIT_SIZE; 02562 n2 = sc_max( n1 - SC_DIGIT_SIZE, m_hi - 1 ); 02563 for( int n = n1; n > n2; n -- ) { 02564 result |= (m_obj[n].value() & SC_DIGIT_ONE) << k ++; 02565 } 02566 } else { 02567 n1 = m_lo + i * SC_DIGIT_SIZE; 02568 n2 = sc_min( n1 + SC_DIGIT_SIZE, m_hi + 1 ); 02569 for( int n = n1; n < n2; n ++ ) { 02570 result |= (m_obj[n].value() & SC_DIGIT_ONE) << k ++; 02571 } 02572 } 02573 return result; 02574 }
void sc_dt::sc_subref_r< X >::set_word | ( | int | i, | |
sc_digit | w | |||
) | [inline] |
sc_bit_proxies.h の 2579 行で定義されています。
02580 { 02581 int n1 = 0; 02582 int n2 = 0; 02583 int k = 0; 02584 if( reversed() ) { 02585 n1 = m_lo - i * SC_DIGIT_SIZE; 02586 n2 = sc_max( n1 - SC_DIGIT_SIZE, m_hi - 1 ); 02587 for( int n = n1; n > n2; n -- ) { 02588 m_obj.set_bit( n, sc_logic_value_t( (w >> k ++) & SC_DIGIT_ONE | 02589 m_obj[n].value() & SC_DIGIT_TWO ) ); 02590 } 02591 } else { 02592 n1 = m_lo + i * SC_DIGIT_SIZE; 02593 n2 = sc_min( n1 + SC_DIGIT_SIZE, m_hi + 1 ); 02594 for( int n = n1; n < n2; n ++ ) { 02595 m_obj.set_bit( n, sc_logic_value_t( (w >> k ++) & SC_DIGIT_ONE | 02596 m_obj[n].value() & SC_DIGIT_TWO ) ); 02597 } 02598 } 02599 }
sc_digit sc_dt::sc_subref_r< X >::get_cword | ( | int | i | ) | const [inline] |
sc_bit_proxies.h の 2605 行で定義されています。
02606 { 02607 int n1 = 0; 02608 int n2 = 0; 02609 sc_digit result = 0; 02610 int k = 0; 02611 if( reversed() ) { 02612 n1 = m_lo - i * SC_DIGIT_SIZE; 02613 n2 = sc_max( n1 - SC_DIGIT_SIZE, m_hi - 1 ); 02614 for( int n = n1; n > n2; n -- ) { 02615 result |= ((m_obj[n].value() & SC_DIGIT_TWO) >> 1) << k ++; 02616 } 02617 } else { 02618 n1 = m_lo + i * SC_DIGIT_SIZE; 02619 n2 = sc_min( n1 + SC_DIGIT_SIZE, m_hi + 1 ); 02620 for( int n = n1; n < n2; n ++ ) { 02621 result |= ((m_obj[n].value() & SC_DIGIT_TWO) >> 1) << k ++; 02622 } 02623 } 02624 return result; 02625 }
void sc_dt::sc_subref_r< X >::set_cword | ( | int | i, | |
sc_digit | w | |||
) | [inline] |
sc_bit_proxies.h の 2630 行で定義されています。
02631 { 02632 int n1 = 0; 02633 int n2 = 0; 02634 int k = 0; 02635 if( reversed() ) { 02636 n1 = m_lo - i * SC_DIGIT_SIZE; 02637 n2 = sc_max( n1 - SC_DIGIT_SIZE, m_hi - 1 ); 02638 for( int n = n1; n > n2; n -- ) { 02639 m_obj.set_bit( n, sc_logic_value_t( ((w >> k ++) & SC_DIGIT_ONE) << 1 | 02640 m_obj[n].value() & SC_DIGIT_ONE ) ); 02641 } 02642 } else { 02643 n1 = m_lo + i * SC_DIGIT_SIZE; 02644 n2 = sc_min( n1 + SC_DIGIT_SIZE, m_hi + 1 ); 02645 for( int n = n1; n < n2; n ++ ) { 02646 m_obj.set_bit( n, sc_logic_value_t( ((w >> k ++) & SC_DIGIT_ONE) << 1 | 02647 m_obj[n].value() & SC_DIGIT_ONE ) ); 02648 } 02649 } 02650 }
void sc_dt::sc_subref_r< X >::clean_tail | ( | ) | [inline] |
bool sc_dt::sc_subref_r< X >::is_01 | ( | ) | const [inline] |
sc_bit_proxies.h の 2658 行で定義されています。
02659 { 02660 int sz = size(); 02661 for( int i = 0; i < sz; ++ i ) { 02662 if( get_cword( i ) != SC_DIGIT_ZERO ) { 02663 return false; 02664 } 02665 } 02666 return true; 02667 }
bool sc_dt::sc_subref_r< X >::reversed | ( | ) | const [inline] |
sc_subref_r<X>& sc_dt::sc_subref_r< X >::operator= | ( | const sc_subref_r< X > & | ) | [private] |
sc_dt::sc_subref< X >で再定義されています。
X& sc_dt::sc_subref_r< X >::m_obj [mutable, protected] |
sc_bit_proxies.h の 716 行で定義されています。
int sc_dt::sc_subref_r< X >::m_hi [protected] |
sc_bit_proxies.h の 717 行で定義されています。
int sc_dt::sc_subref_r< X >::m_lo [protected] |
sc_bit_proxies.h の 718 行で定義されています。
int sc_dt::sc_subref_r< X >::m_len [protected] |
sc_bit_proxies.h の 719 行で定義されています。