#include <sc_bv_base.h>
Public 型 | |
typedef sc_proxy< sc_bv_base > | base_type |
Public メソッド | |
sc_bv_base (int length_=sc_length_param().len()) | |
sc_bv_base (bool a, int length_=sc_length_param().len()) | |
sc_bv_base (const char *a) | |
sc_bv_base (const char *a, int length_) | |
template<class X> | |
sc_bv_base (const sc_proxy< X > &a) | |
sc_bv_base (const sc_bv_base &a) | |
virtual | ~sc_bv_base () |
template<class X> | |
sc_bv_base & | operator= (const sc_proxy< X > &a) |
sc_bv_base & | operator= (const sc_bv_base &a) |
sc_bv_base & | operator= (const char *a) |
sc_bv_base & | operator= (const bool *a) |
sc_bv_base & | operator= (const sc_logic *a) |
sc_bv_base & | operator= (const sc_unsigned &a) |
sc_bv_base & | operator= (const sc_signed &a) |
sc_bv_base & | operator= (const sc_uint_base &a) |
sc_bv_base & | operator= (const sc_int_base &a) |
sc_bv_base & | operator= (unsigned long a) |
sc_bv_base & | operator= (long a) |
sc_bv_base & | operator= (unsigned int a) |
sc_bv_base & | operator= (int a) |
sc_bv_base & | operator= (uint64 a) |
sc_bv_base & | operator= (int64 a) |
int | length () const |
int | size () const |
sc_logic_value_t | get_bit (int i) const |
void | set_bit (int i, 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 |
Protected 変数 | |
int | m_len |
int | m_size |
sc_digit * | m_data |
Private メソッド | |
void | init (int length_, bool init_value=false) |
void | assign_from_string (const std::string &) |
フレンド | |
class | sc_lv_base |
sc_bv_base.h の 68 行で定義されています。
sc_bv_base.h の 82 行で定義されています。
sc_dt::sc_bv_base::sc_bv_base | ( | int | length_ = sc_length_param().len() |
) | [inline, explicit] |
sc_dt::sc_bv_base::sc_bv_base | ( | bool | a, | |
int | length_ = sc_length_param().len() | |||
) | [inline, explicit] |
sc_dt::sc_bv_base::sc_bv_base | ( | const char * | a | ) |
sc_bv_base.cpp の 113 行で定義されています。
00114 : m_len( 0 ), m_size( 0 ), m_data( 0 ) 00115 { 00116 std::string s = convert_to_bin( a ); 00117 init( s.length() - 1 ); 00118 assign_from_string( s ); 00119 }
sc_dt::sc_bv_base::sc_bv_base | ( | const char * | a, | |
int | length_ | |||
) |
sc_bv_base.cpp の 121 行で定義されています。
00122 : m_len( 0 ), m_size( 0 ), m_data( 0 ) 00123 { 00124 init( length_ ); 00125 assign_from_string( convert_to_bin( a ) ); 00126 }
sc_dt::sc_bv_base::sc_bv_base | ( | const sc_proxy< X > & | a | ) | [inline] |
sc_bv_base.h の 101 行で定義されています。
00102 : m_len( 0 ), m_size( 0 ), m_data( 0 ) 00103 { init( a.back_cast().length() ); base_type::assign_( a ); }
sc_dt::sc_bv_base::sc_bv_base | ( | const sc_bv_base & | a | ) |
virtual sc_dt::sc_bv_base::~sc_bv_base | ( | ) | [inline, virtual] |
void sc_dt::sc_bv_base::init | ( | int | length_, | |
bool | init_value = false | |||
) | [private] |
sc_bv_base.cpp の 66 行で定義されています。
00067 { 00068 // check the length 00069 if( length_ <= 0 ) { 00070 SC_REPORT_ERROR( sc_core::SC_ID_ZERO_LENGTH_, 0 ); 00071 } 00072 // allocate memory for the data and control words 00073 m_len = length_; 00074 m_size = (m_len - 1) / SC_DIGIT_SIZE + 1; 00075 m_data = new sc_digit[m_size]; 00076 // initialize the bits to 'init_value' 00077 sc_digit dw = init_value ? ~SC_DIGIT_ZERO : SC_DIGIT_ZERO; 00078 int sz = m_size; 00079 for( int i = 0; i < sz; ++ i ) { 00080 m_data[i] = dw; 00081 } 00082 clean_tail(); 00083 }
void sc_dt::sc_bv_base::assign_from_string | ( | const std::string & | s | ) | [private] |
sc_bv_base.cpp の 87 行で定義されています。
00088 { 00089 // s must have been converted to bin 00090 int len = m_len; 00091 int s_len = s.length() - 1; 00092 int min_len = sc_min( len, s_len ); 00093 int i = 0; 00094 for( ; i < min_len; ++ i ) { 00095 char c = s[s_len - i - 1]; 00096 if( c != '0' && c != '1' ) { 00097 SC_REPORT_ERROR( sc_core::SC_ID_CANNOT_CONVERT_, 00098 "string can contain only '0' and '1' characters" ); 00099 } 00100 set_bit( i, sc_logic_value_t( c - '0' ) ); 00101 } 00102 // if formatted, fill the rest with sign(s), otherwise fill with zeros 00103 sc_logic_value_t fill = (s[s_len] == 'F' ? sc_logic_value_t( s[0] - '0' ) 00104 : sc_logic_value_t( 0 )); 00105 for( ; i < len; ++ i ) { 00106 set_bit( i, fill ); 00107 } 00108 }
sc_bv_base& sc_dt::sc_bv_base::operator= | ( | const sc_proxy< X > & | a | ) | [inline] |
sc_dt::sc_bv< W >で再定義されています。
sc_bv_base.h の 137 行で定義されています。
00138 { assign_p_( *this, a ); return *this; }
sc_bv_base& sc_dt::sc_bv_base::operator= | ( | const sc_bv_base & | a | ) | [inline] |
sc_bv_base & sc_dt::sc_bv_base::operator= | ( | const char * | a | ) |
sc_dt::sc_bv< W >で再定義されています。
sc_bv_base.cpp の 144 行で定義されています。
00145 { 00146 assign_from_string( convert_to_bin( a ) ); 00147 return *this; 00148 }
sc_bv_base& sc_dt::sc_bv_base::operator= | ( | const bool * | a | ) | [inline] |
sc_dt::sc_bv< W >で再定義されています。
sc_bv_base.h の 145 行で定義されています。
00146 { base_type::assign_( a ); return *this; }
sc_bv_base& sc_dt::sc_bv_base::operator= | ( | const sc_logic * | a | ) | [inline] |
sc_dt::sc_bv< W >で再定義されています。
sc_bv_base.h の 148 行で定義されています。
00149 { base_type::assign_( a ); return *this; }
sc_bv_base& sc_dt::sc_bv_base::operator= | ( | const sc_unsigned & | a | ) | [inline] |
sc_dt::sc_bv< W >で再定義されています。
sc_bv_base.h の 151 行で定義されています。
00152 { base_type::assign_( a ); return *this; }
sc_bv_base& sc_dt::sc_bv_base::operator= | ( | const sc_signed & | a | ) | [inline] |
sc_dt::sc_bv< W >で再定義されています。
sc_bv_base.h の 154 行で定義されています。
00155 { base_type::assign_( a ); return *this; }
sc_bv_base& sc_dt::sc_bv_base::operator= | ( | const sc_uint_base & | a | ) | [inline] |
sc_dt::sc_bv< W >で再定義されています。
sc_bv_base.h の 157 行で定義されています。
00158 { base_type::assign_( a ); return *this; }
sc_bv_base& sc_dt::sc_bv_base::operator= | ( | const sc_int_base & | a | ) | [inline] |
sc_dt::sc_bv< W >で再定義されています。
sc_bv_base.h の 160 行で定義されています。
00161 { base_type::assign_( a ); return *this; }
sc_bv_base& sc_dt::sc_bv_base::operator= | ( | unsigned long | a | ) | [inline] |
sc_dt::sc_bv< W >で再定義されています。
sc_bv_base.h の 163 行で定義されています。
00164 { base_type::assign_( a ); return *this; }
sc_bv_base& sc_dt::sc_bv_base::operator= | ( | long | a | ) | [inline] |
sc_dt::sc_bv< W >で再定義されています。
sc_bv_base.h の 166 行で定義されています。
00167 { base_type::assign_( a ); return *this; }
sc_bv_base& sc_dt::sc_bv_base::operator= | ( | unsigned int | a | ) | [inline] |
sc_dt::sc_bv< W >で再定義されています。
sc_bv_base.h の 169 行で定義されています。
00170 { base_type::assign_( a ); return *this; }
sc_bv_base& sc_dt::sc_bv_base::operator= | ( | int | a | ) | [inline] |
sc_dt::sc_bv< W >で再定義されています。
sc_bv_base.h の 172 行で定義されています。
00173 { base_type::assign_( a ); return *this; }
sc_bv_base& sc_dt::sc_bv_base::operator= | ( | uint64 | a | ) | [inline] |
sc_dt::sc_bv< W >で再定義されています。
sc_bv_base.h の 175 行で定義されています。
00176 { base_type::assign_( a ); return *this; }
sc_bv_base& sc_dt::sc_bv_base::operator= | ( | int64 | a | ) | [inline] |
sc_dt::sc_bv< W >で再定義されています。
sc_bv_base.h の 178 行で定義されています。
00179 { base_type::assign_( a ); return *this; }
int sc_dt::sc_bv_base::length | ( | ) | const [inline] |
int sc_dt::sc_bv_base::size | ( | ) | const [inline] |
sc_logic_value_t sc_dt::sc_bv_base::get_bit | ( | int | i | ) | const [inline] |
sc_bv_base.h の 290 行で定義されています。
00291 { 00292 int wi = i / SC_DIGIT_SIZE; 00293 int bi = i % SC_DIGIT_SIZE; 00294 return sc_logic_value_t( m_data[wi] >> bi & SC_DIGIT_ONE ); 00295 }
void sc_dt::sc_bv_base::set_bit | ( | int | i, | |
sc_logic_value_t | value | |||
) | [inline] |
sc_bv_base.h の 299 行で定義されています。
00300 { 00301 int wi = i / SC_DIGIT_SIZE; 00302 int bi = i % SC_DIGIT_SIZE; 00303 sc_digit mask = SC_DIGIT_ONE << bi; 00304 m_data[wi] |= mask; // set bit to 1 00305 m_data[wi] &= value << bi | ~mask; 00306 }
sc_digit sc_dt::sc_bv_base::get_word | ( | int | i | ) | const [inline] |
void sc_dt::sc_bv_base::set_word | ( | int | i, | |
sc_digit | w | |||
) | [inline] |
sc_digit sc_dt::sc_bv_base::get_cword | ( | int | i | ) | const [inline] |
void sc_dt::sc_bv_base::set_cword | ( | int | i, | |
sc_digit | w | |||
) | [inline] |
sc_bv_base.h の 311 行で定義されています。
00312 { 00313 if( w ) { 00314 SC_REPORT_WARNING( sc_core::SC_ID_SC_BV_CANNOT_CONTAIN_X_AND_Z_, 0 ); 00315 } 00316 }
void sc_dt::sc_bv_base::clean_tail | ( | ) | [inline] |
sc_bv_base.h の 321 行で定義されています。
00322 { 00323 int wi = m_size - 1; 00324 int bi = m_len % SC_DIGIT_SIZE; 00325 if ( bi != 0 ) m_data[wi] &= ~SC_DIGIT_ZERO >> (SC_DIGIT_SIZE - bi); 00326 }
bool sc_dt::sc_bv_base::is_01 | ( | ) | const [inline] |
friend class sc_lv_base [friend] |
sc_bv_base.h の 71 行で定義されています。
int sc_dt::sc_bv_base::m_len [protected] |
sc_bv_base.h の 252 行で定義されています。
int sc_dt::sc_bv_base::m_size [protected] |
sc_bv_base.h の 253 行で定義されています。
sc_digit* sc_dt::sc_bv_base::m_data [protected] |
sc_bv_base.h の 254 行で定義されています。