在线咨询 切换到宽版
eetop公众号 创芯大讲堂 创芯人才网

 找回密码
 注册

手机号码,快捷登录

手机号码,快捷登录

搜帖子
查看: 2360|回复: 2

[求助] verilogA设计

[复制链接]
发表于 2023-8-25 16:59:58 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
b93ca725d347afa3caef54f9f686cda.png 这是一段用verilogA语言设计的压控振荡器的代码,有人知道标红处的seed是什么意思吗?还有,有大佬知道$rdist_normal的用法吗?
发表于 2023-8-25 17:35:49 | 显示全部楼层
复制别人写的一段,可以解决你的问题
Normal (Gaussian) Distribution
Use the $rdist_normal function to generate random real numbers (or the $dist_normal
function to generate integer numbers) that are normally distributed. The $rdist_normal
function is not supported in digital contexts.
$rdist_normal ( seed , mean , standard_deviation ) ;
$dist_normal ( seed , mean , standard_deviation ) ;
seed is a scalar integer variable used to initialize the sequence of generated numbers. seed
must be a variable because the function updates the value of seed at each iteration. To
ensure generation of a normal distribution, change the value of seed only when you initialize
the sequence.
mean is an integer or real expression that specifies the value to be approached by the mean
value of the generated numbers.
standard_deviation is an integer or real expression that determines the width of
spread of the generated values around mean. Using a larger standard_deviation
spreads the generated values over a wider range.
To generate a gaussian distribution, use a mean of 0 and a standard_deviation of 1.
For example, the following module returns a series of real numbers that together form a
gaussian distribution.
module distcheck (pinout) ;
electrical pinout ;
integer seed ;
real rrandnum ;
analog begin
@ (initial_step) begin
seed = 23 ;
end
rrandnum = $rdist_normal( seed, 0, 1 ) ;
$display ("Random number is %g", rrandnum ) ;
V(pinout) <+ rrandnum ;
end // of analog block
endmodul
回复 支持 1 反对 0

使用道具 举报

发表于 2023-8-26 12:25:41 | 显示全部楼层
seed是产生随机数的种子,指定某个seed后则每次仿真都是同样的随机数序列。$rdist_normal函数用来产生正态分布的随机数序列,输入参数是seed、均值、方差。
回复 支持 0 反对 1

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

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

GMT+8, 2025-8-23 13:14 , Processed in 0.011551 second(s), 4 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表