jatin jatin 0 Report post Posted December 8, 2017 Hi all, i'm implementing a timer/counter(8-bit) that should not increment on every clock and i'm not supposed to provide any input clock port . But i need clock period in my design so my question is " How would i provide clock period(through constructor)?" here is the link to my working code on EDAplayground : http://www.edaplayground.com/x/4_dY if there is any problem in my code please feel free to tell me. regards, jatin Share this post Link to post Share on other sites
David Black 123 Report post Posted December 8, 2017 Seems like a lot more code than needed. Where's the specification? Why are you using sc_int<8> everywhere instead of std::uint8_t ? HINT: sc_int<W> slows down performance and is not needed for 8, 16, 32 or 64 bit types Passing time through the constructor is fine. Share this post Link to post Share on other sites
jatin jatin 0 Report post Posted December 9, 2017 Hello Sir, I am a noob i have just started learning systemC(It's been just 3 weeks) and i did not know about uint8_t, now i will try it and explore it. Sir please check the attached file for specification. also can you please give me a simple example in which time period has passed through constructor actually i want to see the syntax. In my design there is one more problem : "whenever i enable my constructor after disabling, it gives wrong output".!! regards, jatin up_timer.pdf Share this post Link to post Share on other sites
jatin jatin 0 Report post Posted December 10, 2017 @David Black Sir, i'm waiting for your reply. regards, jatin Share this post Link to post Share on other sites