TE检查两个事件是否同时发生或延迟 [英] TE to check two events coinciding or delayed

查看:83
本文介绍了TE检查两个事件是否同时发生或延迟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个事件@A和@B.我想检查在发生@A时,@ B是在同一时间发出还是在以后的某个周期发出.

I have two events @A and @B. I want to check that at occurrence of @A, @B is either emitted at the same time or some cycles later.

expect my_check is ((@A and @B) or (@A => {[0..N]; @B}))@clk exec { 
  message(NONE, "my_check");
};

但是,从消息中我可以看到TE从仿真开始的每个时钟周期都成功.令人费解的是,在该时间范围内,A和B均未出现.任何想法出什么事了吗?禁止将布尔值和时间产量算子混合使用吗?

However, I can see (from the message) that the TE succeeds every clock cycle from the start of the simulation. This is puzzling, as neither A nor B occur in that timeframe. Any ideas what's wrong? Is it forbidden to mix boolean and temporal yield operator?

推荐答案

您在这里看到的是空洞通行证.第一个子表达式为FALSE,评估前进到下一个子表达式.第二个子表达式的计算结果为TRUE,因为前提条件@A不会发生(在这种情况下,隐含的内容不会太在乎RHS表达式).因此,OR满足并且exec块被激活.

What you see here is a vacuous pass. The first sub expression is FALSE, and evaluation advances to the next sub expression. That second sub expression evaluates to TRUE since the prerequisite @A does not occur (in which case the implication couldn't care less about the RHS expression). Hence, the OR is satisfied and the exec block is activated.

这篇关于TE检查两个事件是否同时发生或延迟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆