Jump to content

Relationship between module timestep and sca_sampling tracing mode

Recommended Posts

Hi all,

I have a doubt about the sca_sampling tracing mode.

I have implemented a TDF module that performs an approximate integral of an input signal with the rectangle method and another TDF module that generates the input signal values with a timestep of 1US.

I tried to trace the integrated signal using a tabular format and the function sca_sampling with a sampling time of 50NS(smaller than the TDF timestep), and I was expecting the samples having the same values between each US. On the contrary, I obtained the signal behavior as it has been sampled each 50NS.


Does it mean that the TDF modules are activated every 50NS rather than every 1US?

Does it happen like that because the time resolution is 1PS, smaller than both TDF and trace sampling timesteps?


Thank you very much.



Link to comment
Share on other sites

No, the TDF modules don't get activated every 50 ns, but every 1 us as you specified with set_timestep. However, Fraunhofer SystemC-AMS interpolates by default between floating point samples. You can control this behaviour by passing an object of type sca_util::sca_multirate to set_mode of the trace file object. The sca_multirate object can take any of three values SCA_INTERPOLATE, SCA_DONT_INTERPOLATE, or SCA_HOLD_SAMPLE. For details, cf. to clause in the SystemC AMS 2.0 LRM.

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.

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...