クラス sc_core::sc_clock

#include <sc_clock.h>

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

Inheritance graph
[凡例]

すべてのメンバ一覧

Public メソッド

 sc_clock ()
 sc_clock (const char *name_)
 sc_clock (const char *name_, const sc_time &period_, double duty_cycle_=0.5, const sc_time &start_time_=SC_ZERO_TIME, bool posedge_first_=true)
 sc_clock (const char *name_, double period_v_, sc_time_unit period_tu_, double duty_cycle_=0.5)
 sc_clock (const char *name_, double period_v_, sc_time_unit period_tu_, double duty_cycle_, double start_time_v_, sc_time_unit start_time_tu_, bool posedge_first_=true)
 sc_clock (const char *name_, double period_, double duty_cycle_=0.5, double start_time_=0.0, bool posedge_first_=true)
virtual ~sc_clock ()
virtual void register_port (sc_port_base &, const char *if_type)
virtual void write (const bool &)
const sc_timeperiod () const
double duty_cycle () const
bool posedge_first () const
sc_time start_time () const
virtual const char * kind () const
sc_signal_in_if< bool > & signal ()
const sc_signal_in_if< bool > & signal () const

Static Public メソッド

static const sc_timetime_stamp ()
static void start (const sc_time &duration)
static void start (double v, sc_time_unit tu)
static void start (double duration=-1)
static void stop ()

Protected メソッド

void before_end_of_elaboration ()
void posedge_action ()
void negedge_action ()
void report_error (const char *id, const char *add_msg=0) const
void init (const sc_time &, double, const sc_time &, bool)
bool is_clock () const

Protected 変数

sc_time m_period
double m_duty_cycle
sc_time m_start_time
bool m_posedge_first
sc_time m_posedge_time
sc_time m_negedge_time
sc_event m_next_posedge_event
sc_event m_next_negedge_event

Private メソッド

 sc_clock (const sc_clock &)
sc_clockoperator= (const sc_clock &)

フレンド

class sc_clock_posedge_callback
class sc_clock_negedge_callback


説明

sc_clock.h84 行で定義されています。


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

sc_core::sc_clock::sc_clock (  ) 

sc_clock.cpp97 行で定義されています。

00098 : sc_signal<bool>( sc_gen_unique_name( "clock" ) )
00099 {
00100     init( sc_time( 1.0, true ),
00101           0.5,
00102           SC_ZERO_TIME,
00103           true );
00104 
00105     m_next_posedge_event.notify_internal( m_start_time );
00106 }

sc_core::sc_clock::sc_clock ( const char *  name_  )  [explicit]

sc_clock.cpp108 行で定義されています。

00109 : sc_signal<bool>( name_ )
00110 {
00111     init( sc_time( 1.0, true ),
00112           0.5,
00113           SC_ZERO_TIME,
00114           true );
00115 
00116     m_next_posedge_event.notify_internal( m_start_time );
00117 }

sc_core::sc_clock::sc_clock ( const char *  name_,
const sc_time period_,
double  duty_cycle_ = 0.5,
const sc_time start_time_ = SC_ZERO_TIME,
bool  posedge_first_ = true 
)

sc_clock.cpp119 行で定義されています。

00124 : sc_signal<bool>( name_ )
00125 {
00126     init( period_,
00127           duty_cycle_,
00128           start_time_,
00129           posedge_first_ );
00130 
00131     if( posedge_first_ ) {
00132         // posedge first
00133         m_next_posedge_event.notify_internal( m_start_time );
00134     } else {
00135         // negedge first
00136         m_next_negedge_event.notify_internal( m_start_time );
00137     }
00138 }

sc_core::sc_clock::sc_clock ( const char *  name_,
double  period_v_,
sc_time_unit  period_tu_,
double  duty_cycle_ = 0.5 
)

sc_clock.cpp140 行で定義されています。

00144 : sc_signal<bool>( name_ )
00145 {
00146     init( sc_time( period_v_, period_tu_, simcontext() ),
00147           duty_cycle_,
00148           SC_ZERO_TIME,
00149           true );
00150 
00151     // posedge first
00152     m_next_posedge_event.notify_internal( m_start_time );
00153 }

sc_core::sc_clock::sc_clock ( const char *  name_,
double  period_v_,
sc_time_unit  period_tu_,
double  duty_cycle_,
double  start_time_v_,
sc_time_unit  start_time_tu_,
bool  posedge_first_ = true 
)

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

00162 : sc_signal<bool>( name_ )
00163 {
00164     init( sc_time( period_v_, period_tu_, simcontext() ),
00165           duty_cycle_,
00166           sc_time( start_time_v_, start_time_tu_, simcontext() ),
00167           posedge_first_ );
00168 
00169     if( posedge_first_ ) {
00170         // posedge first
00171         m_next_posedge_event.notify_internal( m_start_time );
00172     } else {
00173         // negedge first
00174         m_next_negedge_event.notify_internal( m_start_time );
00175     }
00176 }

sc_core::sc_clock::sc_clock ( const char *  name_,
double  period_,
double  duty_cycle_ = 0.5,
double  start_time_ = 0.0,
bool  posedge_first_ = true 
)

sc_clock.cpp179 行で定義されています。

00184 : sc_signal<bool>( name_ )
00185 {
00186     static bool warn_sc_clock=true;
00187     if ( warn_sc_clock )
00188     {
00189         warn_sc_clock = false;
00190         SC_REPORT_INFO(SC_ID_IEEE_1666_DEPRECATION_, 
00191            "\n    sc_clock(const char*, double, double, double, bool)\n"
00192            "    is deprecated use a form that includes sc_time or\n"
00193            "    sc_time_unit");
00194     }
00195 
00196     init( sc_time( period_, true ),
00197           duty_cycle_,
00198           sc_time( start_time_, true ),
00199           posedge_first_ );
00200 
00201     if( posedge_first_ ) {
00202         // posedge first
00203         m_next_posedge_event.notify_internal( m_start_time );
00204     } else {
00205         // negedge first
00206         m_next_negedge_event.notify_internal( m_start_time );
00207     }
00208 }

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

sc_clock.cpp259 行で定義されています。

00260 {}

sc_core::sc_clock::sc_clock ( const sc_clock  )  [private]


関数

void sc_core::sc_clock::register_port ( sc_port_base port,
const char *  if_type 
) [virtual]

sc_core::sc_signal< bool >を再定義しています。

sc_clock.cpp262 行で定義されています。

00263 {
00264     std::string nm( if_typename_ );
00265     if( nm == typeid( sc_signal_inout_if<bool> ).name() ) {
00266             SC_REPORT_ERROR(SC_ID_ATTEMPT_TO_BIND_CLOCK_TO_OUTPUT_, "");
00267     }
00268 }

void sc_core::sc_clock::write ( const bool &  value  )  [virtual]

sc_core::sc_signal< bool >を再定義しています。

sc_clock.cpp271 行で定義されています。

00272 {
00273     SC_REPORT_ERROR(SC_ID_ATTEMPT_TO_WRITE_TO_CLOCK_, "");
00274 }

const sc_time& sc_core::sc_clock::period (  )  const [inline]

sc_clock.h131 行で定義されています。

00132         { return m_period; }

double sc_core::sc_clock::duty_cycle (  )  const [inline]

sc_clock.h135 行で定義されています。

00136         { return m_duty_cycle; }

bool sc_core::sc_clock::posedge_first (  )  const [inline]

sc_clock.h141 行で定義されています。

00142         { return m_posedge_first; }

sc_time sc_core::sc_clock::start_time (  )  const [inline]

sc_clock.h144 行で定義されています。

00145         { return m_start_time; }

const sc_time & sc_core::sc_clock::time_stamp (  )  [static]

sc_clock.cpp281 行で定義されています。

00282 {
00283     return sc_time_stamp();
00284 }

virtual const char* sc_core::sc_clock::kind (  )  const [inline, virtual]

sc_core::sc_signal< bool >を再定義しています。

sc_clock.h149 行で定義されています。

00150         { return "sc_clock"; }

sc_signal_in_if<bool>& sc_core::sc_clock::signal (  )  [inline]

sc_clock.h155 行で定義されています。

00156         { return *this; }

const sc_signal_in_if<bool>& sc_core::sc_clock::signal (  )  const [inline]

sc_clock.h158 行で定義されています。

00159         { return *this; }

static void sc_core::sc_clock::start ( const sc_time duration  )  [inline, static]

sc_clock.h161 行で定義されています。

00162         { sc_start( duration ); }

static void sc_core::sc_clock::start ( double  v,
sc_time_unit  tu 
) [inline, static]

sc_clock.h164 行で定義されています。

00165         { sc_start( v, tu ); }

static void sc_core::sc_clock::start ( double  duration = -1  )  [inline, static]

sc_clock.h167 行で定義されています。

00168         { sc_start( duration ); }

static void sc_core::sc_clock::stop (  )  [inline, static]

sc_clock.h170 行で定義されています。

00171         { sc_stop(); }

void sc_core::sc_clock::before_end_of_elaboration (  )  [protected, virtual]

sc_core::sc_prim_channelを再定義しています。

sc_clock.cpp229 行で定義されています。

00230 {
00231     std::string gen_base;
00232     sc_spawn_options posedge_options;   // Options for posedge process.
00233     sc_spawn_options negedge_options;   // Options for negedge process.
00234 
00235     posedge_options.spawn_method();
00236     posedge_options.dont_initialize();
00237     posedge_options.set_sensitivity(&m_next_posedge_event);
00238     gen_base = basename();
00239     gen_base += "_posedge_action";
00240     sc_spawn(sc_clock_posedge_callback(this),
00241         sc_gen_unique_name( gen_base.c_str() ), &posedge_options);
00242 
00243     negedge_options.spawn_method();
00244     negedge_options.dont_initialize();
00245     negedge_options.set_sensitivity(&m_next_negedge_event);
00246     gen_base = basename();
00247     gen_base += "_negedge_action";
00248     sc_spawn( sc_clock_negedge_callback(this),
00249         sc_gen_unique_name( gen_base.c_str() ), &negedge_options );
00250 }

void sc_core::sc_clock::posedge_action (  )  [inline, protected]

sc_clock.h216 行で定義されています。

00217 {
00218     m_next_negedge_event.notify_internal( m_negedge_time );
00219         m_new_val = true;
00220         request_update();
00221 }

void sc_core::sc_clock::negedge_action (  )  [inline, protected]

sc_clock.h225 行で定義されています。

00226 {
00227     m_next_posedge_event.notify_internal( m_posedge_time );
00228         m_new_val = false;
00229         request_update();
00230 }

void sc_core::sc_clock::report_error ( const char *  id,
const char *  add_msg = 0 
) const [protected]

sc_clock.cpp290 行で定義されています。

00291 {
00292     char msg[BUFSIZ];
00293     if( add_msg != 0 ) {
00294         std::sprintf( msg, "%s: clock '%s'", add_msg, name() );
00295     } else {
00296         std::sprintf( msg, "clock '%s'", name() );
00297     }
00298     SC_REPORT_ERROR( id, msg );
00299 }

void sc_core::sc_clock::init ( const sc_time period_,
double  duty_cycle_,
const sc_time start_time_,
bool  posedge_first_ 
) [protected]

sc_clock.cpp303 行で定義されています。

00307 {
00308     if( period_ == SC_ZERO_TIME ) {
00309         report_error( SC_ID_CLOCK_PERIOD_ZERO_,
00310                       "increase the period" );
00311     }
00312     m_period = period_;
00313     m_posedge_first = posedge_first_;
00314 
00315     if( duty_cycle_ <= 0.0 || duty_cycle_ >= 1.0 ) {
00316         m_duty_cycle = 0.5;
00317     } else {
00318         m_duty_cycle = duty_cycle_;
00319     }
00320 
00321     m_negedge_time = m_period * m_duty_cycle;
00322     m_posedge_time = m_period - m_negedge_time;
00323 
00324     if( m_negedge_time == SC_ZERO_TIME ) {
00325         report_error( SC_ID_CLOCK_HIGH_TIME_ZERO_,
00326                       "increase the period or increase the duty cycle" );
00327     }
00328     if( m_posedge_time == SC_ZERO_TIME ) {
00329         report_error( SC_ID_CLOCK_LOW_TIME_ZERO_,
00330                       "increase the period or decrease the duty cycle" );
00331     }
00332 
00333     if( posedge_first_ ) {
00334         this->m_cur_val = false;
00335         this->m_new_val = false;
00336     } else {
00337         this->m_cur_val = true;
00338         this->m_new_val = true;
00339     }
00340 
00341     m_start_time = start_time_;
00342 
00343 }

bool sc_core::sc_clock::is_clock (  )  const [inline, protected, virtual]

sc_core::sc_signal< bool >を再定義しています。

sc_clock.h188 行で定義されています。

00188 { return true; }

sc_clock& sc_core::sc_clock::operator= ( const sc_clock  )  [private]


フレンドと関連する関数

friend class sc_clock_posedge_callback [friend]

sc_clock.h89 行で定義されています。

friend class sc_clock_negedge_callback [friend]

sc_clock.h90 行で定義されています。


変数

sc_clock.h192 行で定義されています。

double sc_core::sc_clock::m_duty_cycle [protected]

sc_clock.h193 行で定義されています。

sc_clock.h194 行で定義されています。

sc_clock.h195 行で定義されています。

sc_clock.h196 行で定義されています。

sc_clock.h197 行で定義されています。

sc_clock.h199 行で定義されています。

sc_clock.h200 行で定義されています。


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

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