我正在编写一个i2c主模块,并且我有Microchip提供的AT24C02D的Verilog模型用于测试平台。我在代码中看到一些“->”;这是什么意思?
//************************************************************************
//********************* S_START and S_STOP conditions ********************
//************************************************************************
// Start trigger allows latency between start condition and falling edge
// of SCL. If stop occurs in this interval the machine ignores the start
// condition and awaits a subsequent start condition.
// START Condition Detection
always @ (negedge SDA_in)
if(SCL == 1) begin
if (VERBOSE) $display("START condition detected", $time);
S_STOP = 0;
S_START = 1;
-> START_condition; // Start condition event
if (VERBOSE) $display ("Got START condtion event");
@(STOP_condition or negedge SCL)
if (SCL == 0) begin
if (VERBOSE) $display ("First negedge of SCL after START", $time);
Valid_Address_flag = 0;
if(VERBOSE) $display("START event triggered");
-> START_trigger; // Start trigger event
@ (posedge SCL) S_START = 0; // Waits until cycle ends
end
else begin // STOP condition detected under same clock
if (VERBOSE) $display ("STOP under same clock as START");
S_START = 0;
S_STOP = 1;
end
end
我使用
iverilog
成功编译了文件。
在链接中的
AT24C02D.v
文件中,我搜索了START_condition
并在第535行发现了这个event
声明:
event START_condition;
->
语法用于触发事件。零时间触发事件; START_condition
不会是具有任何持续时间的信号脉冲。
该文件中没有
START_condition
的其他用途;也许代码作者将其添加为波形调试辅助工具。某些波形查看器将允许您直观地看到事件被触发的时间。
请参阅 IEEE Std 1800-2017,第 6.17 节 事件数据类型