Jump to content
Sign in to follow this  
katang

What is the relation between Next_trigger and Clock?

Recommended Posts

Is some situations (say when simulating memory access) using simple clocking is in most cases just wasting time during simulation, only a small fraction of invocations results in real action. From this point on, it would be advantageous to use next_trigger(). Some other modules, however, make actions on every clock tick.

Is there any way to distinguish whether a member function is called as the result of the Clock or next_trigger()? What happens if I mix them? (I mean using one for one module and another for another module)

I guess that using Clock is synthesizable, and next_trigger() is not. Is there some standard methodology to develop a source that supports both? (BTW: is there some support in SystemC which supports using synthesizable constructions only? I mean it flags non-synthetizable constructs with a warning?)

Share this post


Link to post
Share on other sites

In general, SystemC models should avoid using clocks altogether. This is good for many reasons assuming your goal is high speed behavioral models. SystemC is often used for implementing functionally accurate virtual platforms that allow software to be designed well ahead of hardware delivery. Thus appropriate use of next_trigger() is actually a great idea.

There is no way to distinguish between static and dynamic triggering at the point of invocation.

Clock is synthesizable and if that particular mode of design is your goal, then sc_clock is appropriate.

There are no features of SystemC itself that will tell you if the code itself is synthesizable. The answer to that is highly tool dependent. I know synthesis tools that require no clock at all, and others that insist a clock be specified. Always keep in mind: SystemC is simply C++ syntax used with a library and a methodology to model hardware and software. C++ has no concept of synthesizability. You have to go beyond GCC/LLVM to find out if your code is synthesizable with a given synthesis tool.

 

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  

×