Public メソッド | |
vcd_enum_trace (const unsigned &object_, const std::string &name_, const std::string &vcd_name_, const char **enum_literals) | |
void | write (FILE *f) |
bool | changed () |
Protected 変数 | |
const unsigned & | object |
unsigned | old_value |
unsigned | mask |
const char ** | literals |
unsigned | nliterals |
sc_vcd_trace.cpp の 1630 行で定義されています。
sc_core::vcd_enum_trace::vcd_enum_trace | ( | const unsigned & | object_, | |
const std::string & | name_, | |||
const std::string & | vcd_name_, | |||
const char ** | enum_literals | |||
) |
sc_vcd_trace.cpp の 1648 行で定義されています。
01652 : vcd_trace(name_, vcd_name_), object(object_), literals(enum_literals_) 01653 { 01654 // find number of bits required to represent enumeration literal - counting loop 01655 for (nliterals = 0; enum_literals_[nliterals]; nliterals++); 01656 01657 // Figure out number of bits required to represent the number of literals 01658 bit_width = 0; 01659 unsigned shifted_maxindex = nliterals-1; 01660 while(shifted_maxindex != 0){ 01661 shifted_maxindex >>= 1; 01662 bit_width++; 01663 } 01664 01665 // Set the mask 01666 if (bit_width < 32) { 01667 mask = ~(-1 << bit_width); 01668 } else { 01669 mask = 0xffffffff; 01670 } 01671 01672 vcd_var_typ_name = "wire"; 01673 old_value = object; 01674 }
void sc_core::vcd_enum_trace::write | ( | FILE * | f | ) | [virtual] |
sc_core::vcd_traceを実装しています。
sc_vcd_trace.cpp の 1681 行で定義されています。
01682 { 01683 char rawdata[1000]; 01684 char compdata[1000]; 01685 int bitindex; 01686 01687 // Check for overflow 01688 if ((object & mask) != object) { 01689 for (bitindex = 0; bitindex < bit_width; bitindex++){ 01690 rawdata[bitindex] = 'x'; 01691 } 01692 } else { 01693 unsigned bit_mask = 1 << (bit_width-1); 01694 for (bitindex = 0; bitindex < bit_width; bitindex++) { 01695 rawdata[bitindex] = (object & bit_mask)? '1' : '0'; 01696 bit_mask = bit_mask >> 1; 01697 } 01698 } 01699 rawdata[bitindex] = '\0'; 01700 compose_data_line(rawdata, compdata); 01701 std::fputs(compdata, f); 01702 old_value = object; 01703 }
bool sc_core::vcd_enum_trace::changed | ( | ) | [virtual] |
sc_core::vcd_traceを実装しています。
sc_vcd_trace.cpp の 1676 行で定義されています。
01677 { 01678 return object != old_value; 01679 }
const unsigned& sc_core::vcd_enum_trace::object [protected] |
sc_vcd_trace.cpp の 1640 行で定義されています。
unsigned sc_core::vcd_enum_trace::old_value [protected] |
sc_vcd_trace.cpp の 1641 行で定義されています。
unsigned sc_core::vcd_enum_trace::mask [protected] |
sc_vcd_trace.cpp の 1642 行で定義されています。
const char** sc_core::vcd_enum_trace::literals [protected] |
sc_vcd_trace.cpp の 1643 行で定義されています。
unsigned sc_core::vcd_enum_trace::nliterals [protected] |
sc_vcd_trace.cpp の 1644 行で定義されています。