Jump to content
Sign in to follow this  
VanTeo

Get period of sc_clock

Recommended Posts

Hello VanTeo,

 

 

Asuming your modue A have sc_in<bbol> port you can do something like :

 

 

SC_MODULE(A)
{
sc_in<bool> inPort;

.....

void before_end_of_elaboration()
{
sc_interface* i_f = clock.get_interface();
sc_clock* clk = dynamic_cast<sc_clock*>(i_f);
sc_time t = clk->period(); // Call method of clock object to which port is bound
...

}

...

};

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×