Jump to content

Recommended Posts

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

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

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

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

×