+ Post New Thread
Results 1 to 3 of 3
  1. #1
    Member level 2
    Points: 432, Level: 4

    Join Date
    May 2018
    Posts
    43
    Helped
    3 / 3
    Points
    432
    Level
    4

    $urandom_range is generating same values

    I am writing a test bench where I am randomizing few inputs using $urandom_range(max,min). However, every time I am running my test, it is returning same value. I would like to understand why I am getting this issue.

    Thanks!

    •   AltAdvertisement

        
       

  2. #2
    Advanced Member level 3
    Points: 6,489, Level: 19
    Achievements:
    Created Blog entry 7 years registered

    Join Date
    Dec 2011
    Location
    Fremont, CA, USA
    Posts
    785
    Helped
    355 / 355
    Points
    6,489
    Level
    19
    Blog Entries
    4

    Re: $urandom_range is generating same values

    That is the correct behavior - it's called random stability which allows you to debug your test should it fail. You need to change the initial seed if you want another set of random values. Using Modelsim/Questa, look up the vsim -sv_seed switch in the manual
    Dave Rich
    Senior Verification Consultant
    Mentor Graphics Corporation



    •   AltAdvertisement

        
       

  3. #3
    Member level 2
    Points: 432, Level: 4

    Join Date
    May 2018
    Posts
    43
    Helped
    3 / 3
    Points
    432
    Level
    4

    Re: $urandom_range is generating same values

    Quote Originally Posted by dave_59 View Post
    That is the correct behavior - it's called random stability which allows you to debug your test should it fail. You need to change the initial seed if you want another set of random values. Using Modelsim/Questa, look up the vsim -sv_seed switch in the manual
    Thank you for detailed explanation. This makes sense to me. I was able to use -seed random in Cadence xrun to get desired behavior.

    Thanks!



--[[ ]]--