Jump to content

What is the relation between Next_trigger and Clock?


katang

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?)

Link to comment
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.

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...