微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微电子和IC设计 > IC验证交流 > 问两个sv中关于event的语法

问两个sv中关于event的语法

时间:10-02 整理:3721RD 点击:
1. @和wait有啥区别么
2. ->和->>的区别是啥
谢谢大家

1.edge-sensitive vs level-sensitive;
2.Named events triggered via the -> operator unblock all processes currently waiting on that event. When triggered, named events behave like a one shot, i.e., the trigger state itself is not observable, only its effect. This is similar to the way in which an edge can trigger a flip-flop, but the state of the edge cannot be ascertained, i.e., if (posedge clock) is illegal.
Nonblocking events are triggered using the ->> operator. The effect of the ->> operator is that the statement executes without blocking, and it creates a nonblocking assign update event in the time in which the delay control expires or the event control occurs. The effect of this update event shall be to trigger the referenced event in the nonblocking assignment region of the simulation cycle.

Named events are triggered via the -> operator.
Triggering an event unblocks all processes currently waiting on that event. When triggered, named events
behave like a one-shot, that is, the trigger state itself is not observable, only its effect. This is similar to the way
in which an edge can trigger a flip-flop but the state of the edge cannot be ascertained, i.e., if (posedge
clock) is illegal.
Nonblocking events are triggered using the ->> operator.
The effect of the ->> operator is that the statement executes without blocking and it creates a nonblocking
assign update event in the time in which the delay control expires, or the event-control occurs. The effect of
this update event shall be to trigger the referenced event in the nonblocking assignment region of the simulation
cycle.
The @ operator blocks the calling process until the given event is triggered.
For a trigger to unblock a process waiting on an event, the waiting process must execute the @ statement before
the triggering process executes the trigger operator, ->. If the trigger executes first, then the waiting process
remains blocked.
wait ( hierarchical_event_identifier.triggered )
Using this mechanism, an event trigger shall unblock the waiting process whether the wait executes before or
at the same simulation time as the trigger operation. The triggered event property, thus, helps eliminate a
common race condition that occurs when both the trigger and the wait happen at the same time. A process that
blocks waiting for an event might or might not unblock, depending on the execution order of the waiting and
triggering processes. However, a process that waits on the triggered state always unblocks, regardless of the
order of execution of the wait and trigger operations.
这是我从sv的Language Reference Manual上摘录出来的,就不翻译了

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top