• Home
  • :
  • Community
  • :
  • Forums
  • :
  • Functional Verification
  • :
  • Randomization Failure from TB

Functional Verification Forums

Randomization Failure from TB

MaheshKumar
MaheshKumar 23 days 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,

  • Reply
  • Cancel
  • Cancel
  • muffi
    muffi 23 days 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
    • Up 0 Down
    • Reply
    • Cancel
  • MaheshKumar
    MaheshKumar 23 days 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
    • Up 0 Down
    • Reply
    • Cancel
  • muffi
    muffi 23 days 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
    • Up 0 Down
    • Reply
    • Cancel
  • MaheshKumar
    MaheshKumar 23 days ago in reply to muffi

    Thank you for your time

    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
    • Up 0 Down
    • Reply
    • Cancel
  • StephenH
    StephenH 23 days 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
    • Up 0 Down
    • Reply
    • 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.