Pruthvi Reddy G Posted July 12, 2016 Report Share Posted July 12, 2016 Hi All, How to know the time period of clock in design module at ZERO simulation time i.e at end of elaboration .Is their any API is available to know it ?? Thanks & Regards Pruthvi Reddy Quote Link to comment Share on other sites More sharing options...
Roman Popov Posted July 12, 2016 Report Share Posted July 12, 2016 If you use sc_clock to generate clock signal, it has a period() method that returns sc_time value for clock period: sc_clock clk {"clk", 12, SC_NS}; cout << clk.period() << endl; will print: 12 ns If you design a clock source manually, you will need to create your own API for such queries. Quote Link to comment Share on other sites More sharing options...
Pruthvi Reddy G Posted July 13, 2016 Author Report Share Posted July 13, 2016 Hi, Thanks for replay. If i bind that clk to my sc_in<bool> clk. i tried to print the clk.period(); it's giving error because sc_in don't have property of period function. sudo code:: design.h -> sc_in<bool> clk void func(){ cout<<clk.period()<<endl; } in main file sc_clock clk{"clk",10,SC_NS) object.clk(clk) i tried this one..But it's giving error i.e period is not a member function Thanks Pruthvi Reddy Quote Link to comment Share on other sites More sharing options...
Roman Popov Posted July 13, 2016 Report Share Posted July 13, 2016 sc_in<bool> is just a port, it has nothing to do with clock periods. You will need to pass a clock period value to your object some other way. Quote Link to comment Share on other sites More sharing options...
Pruthvi Reddy G Posted July 13, 2016 Author Report Share Posted July 13, 2016 Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.