クラス sc_core::wif_signed_char_trace

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

Inheritance graph
[凡例]

すべてのメンバ一覧

Public メソッド

 wif_signed_char_trace (const char &object_, const std::string &name_, const std::string &wif_name_, int width_)
void write (FILE *f)
bool changed ()

Protected 変数

const char & object
char old_value
unsigned char mask


説明

sc_wif_trace.cpp1233 行で定義されています。


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

sc_core::wif_signed_char_trace::wif_signed_char_trace ( const char &  object_,
const std::string &  name_,
const std::string &  wif_name_,
int  width_ 
)

sc_wif_trace.cpp1249 行で定義されています。

01253 : wif_trace(name_, wif_name_), object(object_)
01254 {
01255     bit_width = width_;
01256     if (bit_width < 8) {
01257         mask = ~(-1 << bit_width);
01258     } else {
01259         mask = 0xff;
01260     }
01261 
01262     old_value = object;
01263     wif_type = "BIT";
01264 }


関数

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

sc_core::wif_traceを実装しています。

sc_wif_trace.cpp1273 行で定義されています。

01274 {
01275     char buf[1000];
01276     int bitindex;
01277 
01278     // Check for overflow
01279     if (((unsigned char) object & mask) != (unsigned char) object) {
01280         for (bitindex = 0; bitindex < bit_width; bitindex++){
01281             buf[bitindex]='0';
01282         }
01283     }
01284     else{
01285         unsigned bit_mask = 1 << (bit_width-1);
01286         for (bitindex = 0; bitindex < bit_width; bitindex++) {
01287             buf[bitindex] = (object & bit_mask)? '1' : '0';
01288             bit_mask = bit_mask >> 1;
01289         }
01290     }
01291     buf[bitindex] = '\0';
01292     std::fprintf(f, "assign %s \"%s\" ;\n", wif_name.c_str(), buf); 
01293     old_value = object;
01294 }

bool sc_core::wif_signed_char_trace::changed (  )  [virtual]

sc_core::wif_traceを実装しています。

sc_wif_trace.cpp1267 行で定義されています。

01268 {
01269     return object != old_value;
01270 }


変数

const char& sc_core::wif_signed_char_trace::object [protected]

sc_wif_trace.cpp1243 行で定義されています。

sc_wif_trace.cpp1244 行で定義されています。

unsigned char sc_core::wif_signed_char_trace::mask [protected]

sc_wif_trace.cpp1245 行で定義されています。


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

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