索手锋芒的个人空间 https://blog.eetop.cn/calvin [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

vcs seed的产生技巧

已有 6801 次阅读| 2016-3-15 16:09 |个人分类:eda tool

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.


点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 1

    粉丝
  • 0

    好友
  • 4

    获赞
  • 4

    评论
  • 3176

    访问数
关闭

站长推荐 上一条 /1 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-5-10 07:15 , Processed in 0.017239 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部