Jump to content

Recommended Posts

Hi,

I was having few questions regarding clock usage in tlm.These are as folllows:-

1.I wanted to know whether we can supply clock to initiator and target modules.

2.If it can be used ,then how to do we need need to connect to modules.Like instantiate clock in top module and how should we do port or named mapping ?

   If not,then why its not used ? Because i havent come across any examples in tlm which uses clocks.

3.If we are using blocking interface then using wait statement,just that data doesnot get overidden. And if its a case of nb_interface then we are using  delay statements .

My question here would be,can i create system clock input port and connect them ?

I had tried but i had got a failed port mapping error message.

 

Thanks & regards,

Shubham

Share this post


Link to post
Share on other sites
  1.  Yes, you can supply clocks to TLM, but this is a very bad idea in general. Clocks will slow down your simulations
  2. There are many ways to insert clocks: ports, local instances, global references.
  3. The best b_transport implementations find ways to avoid calling wait. More precisely, we attempt to reduce context switching to a minimum and its associated overhead.

Share this post


Link to post
Share on other sites

Adding to Davids answer:

you can supply clocks to the modules having initiator and/or target sockets. This is can be done using the usual signal/sc_in/sc_out means as David mentioned. There is also the option to have 'tick-less' clock  as David presented many years ago (http://www.nascug.org/events/12th/nascug12_david_black.pdf). This can also be achieved by distributing a signal just carrying the clock period as sc_time and caculating the time points in the modules. This way it is even possible to model timers or PWM (e.g. https://git.minres.com/DBT-RISE/DBT-RISE-RISCV/src/branch/develop/platform/incl/sysc/SiFive/pwm.h). This modelling style avoids the many context switches implied by toggling clocks.

All this holds true for LT and PV modelling, if you think about AT modelling the story becomes different. But this is as usual: you trade speed for accuracy.

BR

Share this post


Link to post
Share on other sites

thank you david,eyck.

I will try again to implement a simple example in tlm with the usage of clocks.

But if there is a spec. condition to declare clocks ,then what would be the approach ?

Should i go back to systemc interfaces or continue with the tlm ?

 

Regards,

Shubham 

 

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

×