Jump to content
Sign in to follow this  
Dhaval_Shah_

Data sampling in SC?

Recommended Posts

Hi,

 

I have 3 components in system. Two in SC [Tx and Rx] and One in SV.

Two SC modules are connected in sc_main which is exported. SV is connected via UVM Connect.

 

Tx is driving clock and few signals to Rx. Rx is sampling signals on posedge of clock driven by Tx.

SV component is also sampling same set of signals on posedge of clock which is driven by Tx.

 

Tx is driving clock via sc_out<bool> and Rx is receiving clock via sc_in<bool>.

 

Problem is when Tx drives some signals on posedge of clock, Rx receives change in signals at the same time....where as SV component sees same change on next posedge.

 

Q - Is this how SC/SV event scheduler is expected?

Q - If not then what is the remedy?

 

Dhaval

Share this post


Link to post
Share on other sites

What you've described in SystemC sounds like expected behaviour - if you drive the clock and the signals at the same instant in the transmitter, then the receiver module will detect the clock and see the updated values of the signals - if I've understood you correctly.

 

Regarding connecting to SV, there's no standardisation of how multi-language simulation should behave, so you need to read your simulator documentation,

 

regards

Alan

Share this post


Link to post
Share on other sites

Hi Dhaval,

 what you're describing is just standard synchronous design good practice.

 

Instant summary: ideally all blocks have a common clock, communication between blocks uses signals; signals follow evaluate/update semantics, which guarantees that you always see the current value of a signal, not the future value. Hence no race hazards/hold time violations.

 

regards

Alan

Share this post


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

Sign in to follow this  

×
×
  • Create New...