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

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 206|回复: 8

[求助] 断言如何实现检测信号A两次上升沿之间的时间要大于20ns??

[复制链接]
发表于 2024-4-17 16:14:16 | 显示全部楼层 |阅读模式

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

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

x

1.在没有时钟情况如何检测?


2.在有时钟情况如何检测?且每次仿真的时钟频率都变化。
感觉断言是依据时钟上升沿进行检测,对这种固定延迟的好像不太行吧。
都说断言check时序简单,但是这种固定延迟的check好难实现呀。
发表于 2024-4-17 17:21:08 | 显示全部楼层
我觉得你通过$skew 或者 $nochange 系统函数应该可以满足你的要求,不需要通过assertion
 楼主| 发表于 2024-4-18 08:33:32 | 显示全部楼层


phoenixson 发表于 2024-4-17 17:21
我觉得你通过$skew 或者 $nochange 系统函数应该可以满足你的要求,不需要通过assertion ...


了解了一下,$skew 是定义一个limit时间,大于该时间会报错。可是我想要的是小于20ns报错。$skew可以取反吗(bushi)
发表于 2024-4-18 09:28:54 | 显示全部楼层
哦,看错题目了,你这个更简单了,如果只检测一个信号,那就用$width就好了
发表于 2024-4-18 10:10:33 | 显示全部楼层
本帖最后由 yorkt 于 2024-4-18 10:11 编辑




  1. property detect_A;
  2. time leading;
  3. @(posedge A) (1'b1, leading=$time) |=> (($time - leading) > 20ns);
  4. endproperty: detect_A

  5. assert property (detect_A) else $display("Error");


复制代码

 楼主| 发表于 2024-4-18 15:45:33 | 显示全部楼层
 楼主| 发表于 2024-4-19 09:20:44 | 显示全部楼层


再请问一下,如何想要实现等待addr发送变化时进行后续操作如何实现(没有clk时钟)?我直接写


property p1;
      ($changed(addr) , addr_chg=$realtime) )|-> xxxxxxx ;
endproperty
然后会报错,说必须要有时钟去采样,于是我就这样写

property p1;
      @(posedge $changed(addr) ) (1,addr_chg=$realtime) |-> xxxxxxx ;
endproperty

也是会报相同错误。
但如果写成@(posedge addr),这只会检测addr的bit[0]发生上升沿就触发,不符合我的需求。
请问,这种等待多bit发生变化如何实现?或者如何实现我的需求?,感谢
发表于 2024-4-19 11:14:13 | 显示全部楼层
本帖最后由 yorkt 于 2024-4-19 12:54 编辑

just use @(addr), which will detect changes of any bit inside addr.

An edge event shall be detected only on the LSB of the expression. So @(posedge addr) only detects addr[0].
An implicit event shall be detected on any change in the value of the expression. So @(addr) detects the change of any bits of addr.

$changed() is used inside antecedent and the consequent in the assertion sequence to see whether the sampled value changed. So it needs a sampling clock before.
You cannot use it in the expression inside the event control statement like @($change(addr)) because there are no clock domain for $change(addr) to refer to.

 楼主| 发表于 2024-4-19 13:12:13 | 显示全部楼层


yorkt 发表于 2024-4-19 11:14
just use @(addr), which will detect changes of any bit inside addr.

An edge event shall be detected ...


再次感谢回答
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

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

GMT+8, 2024-5-2 04:08 , Processed in 0.026185 second(s), 7 queries , Gzip On, Redis On.

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