我在Verilog中搜索VHDL属性my_signal'last_event
的verilog等价物。我用google搜索没有成功。有人知道怎么做吗?
'last_event
属性用于了解自信号上次事件以来的时间。
例如,如果在15us时,信号toto从0到1。
然后在20us时,toto'last_event
返回5us。
答案 0 :(得分:0)
您是否尝试过查看一些verilog系统任务?具体如下:
$time; // Return current simulation time in 64-bit integer
$monitor("format", v1, v2, ...); // Invoke only once, and execute (
// automatically when any of the
// variables change value.
您可以查看“嵌套 - 如果 - 其他 - 如果'例如,http://www.asic-world.com/verilog/vbehave2.html示例了解使用这些的测试工作台。
答案 1 :(得分:0)
您可以创建时间变量,并在信号发生变化时更新
time my_signal_last_change;
always @(my_signal) begin
my_signal_last_change = $time;
end
这适用于SystemVerilog;不确定它是否会在verilog中(你可以尝试将时间更改为reg [63:0]以防万一)