Quantcast
Channel: SystemC Language Forum RSS Feed
Viewing all articles
Browse latest Browse all 595

When the method to_default_time_units() returns 0?

$
0
0

Hi,

I see the below code snippet from an example. I wonder that when sc_time_stamp().to_default_time_units() returns 0.

 

 

 

     static bool first = true;

    if (first || sc_time_stamp().to_default_time_units() == 0)
    {
        first = false;
        clock.write(0);
    }

 

 

I have found its origin definition:

 

00161 // conversion functions
00162
00163 double
00164 sc_time::to_default_time_units() const
00165 {
00166 sc_time_params* time_params = sc_get_curr_simcontext()->m_time_params;
00167 return ( sc_dt::uint64_to_double( m_value ) /
00168 sc_dt::uint64_to_double( time_params->default_time_unit ) );
00169 }
00170

 

I think that if  sc_time_stamp().to_default_time_units() returns non-zero, it is equivalent to 1. It returns 0 when m_value is 0. My question is what does m_value is 0 mean?

 

 

 

Thanks,


Viewing all articles
Browse latest Browse all 595

Trending Articles