[vcs] seed 產生

testbench一切随机变量都是和vcs的 +ntb_random_seed 变量相关。这个option的值相当于所有random var的种子,有几种比较差的做法:
1. 从一个固定数开始递增或递增, 这样,seed之间相差不大,testbench中的随机数其实变化不是特别大,所以达不到很随机去验证的目的。如果有10个rand int var, seed =1 和seed = 2两次仿真的结束可能只有一个 var不一样,而且还是相差不大
2.使用年月日时分秒,和1有同样的问题。



比较好的做法

  • 每一个seed都是随机产生的,来保证每一次测试都足够random,如在makefile中产生强随机数
SEED=$(shell head -4 /dev/urandom | od -N 4 -D -A n |awk '{gsub(/ /,"")}1')

+ntb_random_seed=${SEED}
  • vcs提供 +ntb_random_seed_automatic

+ntb_random_seed_automatic


Picks a unique value to supply as the first seed used by a testbench. The value is determined by combining the time of day, host name and process id. This ensures that no two simulations have the same starting seed.
The +ntb_random_seed_automatic seed appears in both the simulation log and the coverage report.

When you enter both +ntb_random_seed_automatic and +ntb_random_seed,  VCS MX displays a warning message and uses the +ntb_random_seed value.
 

  • 5
    点赞
  • 43
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值