tudor.timi Posted May 15, 2014 Report Share Posted May 15, 2014 Hi everyone, I'm not sure if this is the right place to post this. I have question regarding the usage of $past(...) and the other members of that family inside procedural code. The SV 2012 standard says the following: "The use of these functions is not limited to assertion features; they may be used as expressions in procedural code as well." I've tried using a call to $past(...) with an explicit clocking event inside a class task. One of our simulators complained that this is only allowed in assertions and procedural blocks. The other one we use allows it. The standard is rather vague here. What constitutes procedural code? Hopefully someone from the SV Committee hangs out in this forum. Here's the code I'm trying. module top; bit clk; bit some_signal; always #1 clk = ~clk; class some_class; task some_task(); bit foo; foo = $past(some_signal,,,@(negedge clk)); $display("some_signal was %b at the last negedge", foo); endtask endclass initial begin automatic some_class obj = new(); @(posedge clk); some_signal <= 1; @(negedge clk); some_signal <= 0; @(posedge clk); obj.some_task(); $finish(); end endmodule Quote Link to comment Share on other sites More sharing options...
kirloy Posted July 2, 2014 Report Share Posted July 2, 2014 Yours example is legal according to latest LRM. Probably some vendors have not implemented this feature according to 1800-2012 yet. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.