How to debug "Randomization failed" error in Questa

Hi All,
I need help to debug the randomization failure from random generator due to constraints, I would like to know due to which constraints, failure is occuring. . Is there any method or procedure to debug it in Questa? I am using ovm for my verificaiton env.

thanks in advance.

regards,
Lal

Hello,

Try to add the switch “-solvefaildebug” to vsim. Example :

vsim -sv_seed random -solvefaildebug -do vsim.do top

Regards

In reply to jsleroy:

Hello,

This post is really useful.
But further I have a question.
This switch can show upto 1 failed occurrence in log and will tell you how many total number of occurrence has been failed.

Is there any other option with this switch so that we can come to know all the failed randomization occurrence ?

Thanks & Regards,
Dhaval

In reply to Dhaval P:


Dear Lalkumar,

try this,

assert(handle.randomize());

In reply to Tanajirao:

Never use an assert() statement around a randomize call. This can lead to unintended behavior if assertions are disabled for a simulation run.

Instead, you should check the return value of the randomize() call and generate an error or fatal message as required.