• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. Randomization Failure from TB

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 65
  • Views 20735
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Randomization Failure from TB

MaheshKumar
MaheshKumar over 4 years ago

Hi All,

In the UVM environment, received "The randomize method call failed, the unique ID of the randomize is xx."

I am driving one command and followed by two address from TB side, like;   CMD -> ADD1 -> ADD2

I am able to see CMD properly driven, but these addresses are taking a value as zero, hence randomization failure. I am expecting address values as non-zero value, but that is not happening; 

////////////////////////

class seq_1 extends seq_2;

......

virtual task body

....

foreach (i) begin

`uvm_do_with(seq_n, {seq_n.addr =='h10;})  //expecting 'h10, but it is coming as zero, hence failed

`uvm_do_with.....

end

///////////////////////////

-> I have tried with seed =1 and with random seed, still the result is same

-> How to use "SimVision constraint debugger", steps/link to refer

Kindly advice

Thank You,

  • Cancel
  • muffi
    muffi over 4 years ago

    A randomization failure occurs when there are conflicting constraints. In that case, it will assign the default value for that data type (0 in your situation). You should pay attention to the SVRNDF message when randomization failure occurs. It will list the conflicting constraints.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • MaheshKumar
    MaheshKumar over 4 years ago in reply to muffi

    Hi, Thank you for the reply. 

    I understood your explanation. In general, what are the ways we can debug this failure ?

    a) I printed respective variables in parent class, there also it is zero

    b) In driver/interface also, it is zero.  

    could you please tell in what way we can debug this ?

    For example, I have used Queue data type inside foreach loop, instead can I change to for loop sot hat issue may resolve. I Mean, what are the measures to be taken to debug and fix this ?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • muffi
    muffi over 4 years ago in reply to MaheshKumar

    The best way to debug this is to search your log for the SVRNDF warning related to this particular randomization failure. You should then look at the conflicting constraints on "seq.addr" which are listed along with the warning. If you can post the warning snippet, it will help.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • MaheshKumar
    MaheshKumar over 4 years ago in reply to muffi

    Thank you for your time Slight smile

    Could not take screenshots, so I am decribing;

    ///////////////////////////

    `uvm_do_with(seq_n, {seq_n.addr =='h10;})   //line100;

    ///////////////////////////

    xmsim: *W, SVRNDF (/user/project/.....sequence.sv, 100): The randomize method call failed, the unique ID of the randomize is xx."

    Observed simulation time:  YY...

    xmsim: *W: RNDOCS: These constraints contribute to the set of conflicting constraints;

    ..These variables contribute to the set of conflicting constraints. ...

    Let me know your opinion for this. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • StephenH
    StephenH over 4 years ago

    Hi Mahesh.

    Docs for using the SimVision constraint debugger: support.cadence.com/.../techpubDocViewerPage

    You will be seeing the addr == 0 because when randomisation fails, no values get assigned to the rand variables, so addr will stay at its default / previous value. You cannot infer anything about the bad constraint from the addr value itself, you need to look at all the constraints and state variables to see what causes the conflict.

    You probably have a different constraint on addr that excludes the value 'h10. For example if you have a dist constraint, recall that dist is also set membership, that means it works like an "inside" constraint as well as a biasing constraint, so if the values in the dist do not include 'h10, you would have to remove the dist constraint in order to get the value 'h10.

    If you could paste the full log from the solve failure, then we could probably tell you waht you did wrong, otherwise we're just playing guessing games...

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • MaheshKumar
    MaheshKumar over 4 years ago in reply to StephenH

    Good Information, thank you :)

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information