クラス sc_core::vcd_trace

sc_core::vcd_traceに対する継承グラフ

Inheritance graph
[凡例]

すべてのメンバ一覧

Public メソッド

 vcd_trace (const std::string &name_, const std::string &vcd_name_)
virtual void write (FILE *f)=0
virtual void set_width ()
virtual bool changed ()=0
virtual void print_variable_declaration_line (FILE *f)
void compose_data_line (char *rawdata, char *compdata)
std::string compose_line (const std::string data)
virtual ~vcd_trace ()

Static Public メソッド

static const char * strip_leading_bits (const char *originalbuf)

Public 変数

const std::string name
const std::string vcd_name
const char * vcd_var_typ_name
int bit_width


説明

sc_vcd_trace.cpp88 行で定義されています。


コンストラクタとデストラクタ

sc_core::vcd_trace::vcd_trace ( const std::string &  name_,
const std::string &  vcd_name_ 
)

sc_vcd_trace.cpp120 行で定義されています。

00122 : name(name_),
00123   vcd_name(vcd_name_),
00124   bit_width(0)
00125 {
00126     /* Intentionally blank */
00127 }

sc_core::vcd_trace::~vcd_trace (  )  [virtual]

sc_vcd_trace.cpp239 行で定義されています。

00240 {
00241   /* Intentionally Blank */
00242 }


関数

virtual void sc_core::vcd_trace::write ( FILE *  f  )  [pure virtual]

void sc_core::vcd_trace::set_width (  )  [virtual]

sc_core::vcd_T_trace< T >, sc_core::vcd_sc_unsigned_trace, sc_core::vcd_sc_signed_trace, sc_core::vcd_sc_uint_base_trace, sc_core::vcd_sc_int_base_trace, sc_core::vcd_sc_fxnum_trace, と sc_core::vcd_sc_fxnum_fast_traceで再定義されています。

sc_vcd_trace.cpp201 行で定義されています。

00202 {
00203   /* Intentionally Blank, should be defined for each type separately */
00204 }

const char * sc_core::vcd_trace::strip_leading_bits ( const char *  originalbuf  )  [static]

sc_vcd_trace.cpp207 行で定義されています。

00208 {
00209     //*********************************************************************
00210     // - Remove multiple leading 0,z,x, and replace by only one
00211     // - For example,
00212     //    b000z100    -> b0z100
00213     //    b00000xxx   -> b0xxx
00214     //    b000        -> b0
00215     //    bzzzzz1     -> bz1
00216     //    bxxxz10     -> xz10
00217     // - For leading 0's followed by 1, remove all leading 0's
00218     //    b0000010101 -> b10101  
00219 
00220     const char* position = originalbuf;
00221 
00222     if( strlen(originalbuf) < 2 ||
00223         (originalbuf[0] != 'z' && originalbuf[0] != 'x' &&
00224          originalbuf[0] != '0' ))
00225       return originalbuf;
00226 
00227     char first_char = *position;
00228     while(*position == first_char)
00229     {
00230         position++;
00231     }
00232 
00233     if(first_char == '0' && *position == '1')
00234         return position;
00235     // else
00236     return position-1;
00237 }

virtual bool sc_core::vcd_trace::changed (  )  [pure virtual]

void sc_core::vcd_trace::print_variable_declaration_line ( FILE *  f  )  [virtual]

sc_vcd_trace.cpp165 行で定義されています。

00166 {
00167     char buf[2000];
00168 
00169     if ( bit_width <= 0 )
00170     {
00171         std::sprintf(buf, "Traced object \"%s\" has 0 Bits, cannot be traced.",
00172             name.c_str());
00173         put_error_message(buf, false);
00174     }
00175     else
00176     {
00177         std::string namecopy = name; 
00178         remove_vcd_name_problems(namecopy);
00179         if ( bit_width == 1 )
00180         {
00181             std::sprintf(buf, "$var %s  % 3d  %s  %s       $end\n",
00182                 vcd_var_typ_name,
00183                 bit_width,
00184                 vcd_name.c_str(),
00185                 namecopy.c_str());
00186         }
00187         else
00188         {
00189             std::sprintf(buf, "$var %s  % 3d  %s  %s [%d:0]  $end\n",
00190                 vcd_var_typ_name,
00191                 bit_width,
00192                 vcd_name.c_str(),
00193                 namecopy.c_str(),
00194                 bit_width-1);
00195         }
00196         std::fputs(buf, f);
00197     }
00198 }

void sc_core::vcd_trace::compose_data_line ( char *  rawdata,
char *  compdata 
)

sc_vcd_trace.cpp130 行で定義されています。

00131 {
00132     assert(rawdata != compdata);
00133 
00134     if(bit_width == 0)
00135     {
00136         compdata[0] = '\0';
00137     }
00138     else
00139     {
00140         if(bit_width == 1)
00141         {
00142             compdata[0] = rawdata[0];
00143             strcpy(&(compdata[1]), vcd_name.c_str());
00144         }
00145         else
00146         {
00147             const char* effective_begin = strip_leading_bits(rawdata);
00148             std::sprintf(compdata, "b%s %s", effective_begin, vcd_name.c_str());
00149         }
00150     }
00151 }

std::string sc_core::vcd_trace::compose_line ( const std::string  data  ) 

sc_vcd_trace.cpp155 行で定義されています。

00156 {
00157   if(bit_width == 0)
00158     return "";
00159   if(bit_width == 1)
00160     return data + vcd_name;
00161   return std::string("b")+strip_leading_bits(data.c_str())+" "+vcd_name;
00162 }


変数

const std::string sc_core::vcd_trace::name

sc_vcd_trace.cpp113 行で定義されています。

const std::string sc_core::vcd_trace::vcd_name

sc_vcd_trace.cpp114 行で定義されています。

sc_vcd_trace.cpp115 行で定義されています。

sc_vcd_trace.cpp116 行で定義されています。


このクラスの説明は次のファイルから生成されました:

SystemCに対してFri Jun 6 20:12:05 2008に生成されました。  doxygen 1.5.6