• 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. Custom IC SKILL
  3. $urandom not so random when working with "force" in Ver...

Stats

  • Locked Locked
  • Replies 0
  • Subscribers 143
  • Views 1423
  • 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

$urandom not so random when working with "force" in Verilog

DavidLou
DavidLou over 2 years ago

hello experts,

suppose $urandom always giving us different random values every time called in verilog but I noticed sometime it's not so random, i.e., "force" can almost freeze its random capability. e.g., see my displayed results after example code:

        $display("$urandom=%h",$urandom);
        $display("$urandom=%h",$urandom);

    aaa=$urandom;         $display("aaa=$urandom=%h",aaa);
    aaa=$urandom;         $display("aaa=$urandom=%h",aaa);

    force aaa=$urandom;         $display("force aaa=$urandom=%h",aaa);
    force aaa=$urandom;         $display("force aaa=$urandom=%h",aaa);

=================

$urandom=119e3f23
$urandom=617da7c2

aaa=$urandom=1782d52f
aaa=$urandom=4ac07d95

force aaa=$urandom=80010e00
force aaa=$urandom=80010e00

and if I vary different seed, the "force"-ed urandom doesn't vary too many bits, majority of its bits stay 0s.

----seed 2---

force aaa=$urandom=80021c00
force aaa=$urandom=80021c00

-seed 3----

force aaa=$urandom=80032a00
force aaa=$urandom=80032a00

not big deal, but very curious why "force" having anything to do with random? P.S., I'm using irun or xrun for pure (system)verilog, or even in VerilogAMS.

thanks,

David

  • 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