Jump to content

SystemC and constrained random support in scv.h


Recommended Posts

I am trying to use constrained randomness using macros such as SCV_CONSTRAINT, SCV_SOFT_CONSTRAINT and the class scv_extensions. I need to know about other structures available to manage these constraints. For example, randomize a variable that control the constraint of other variable first. Or, constraint a variable inside a set or range of values such as in system verilog using inside operator ... etc. Where can I find the document that describes all  of this? The examples only show the use of SCV_CONSTRAINT, SCV_SOFT_CONSTRAINT. 

Pls help! 

Link to comment
Share on other sites


There are documents included in the SCV package.

This includes a Specification doc:
  docs/scv/scvref/vwg_1_0e.pdf

However, I recommend looking through this document for answers to your questions:
  docs/scv/scv_random_white_paper4.pdf

The white paper presents several examples that are relevant, such as constraining to a list of values, similar to "inside" in SystemVerilog.

I don't think SCV has a specific "solve before" feature like SystemVerilog, but you can achieve similar with customized next() functions, or perhaps soft constraints in some cases.

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