tudor.timi 52 Report post 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 Share this post Link to post Share on other sites
kirloy 0 Report post 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 Share this post Link to post Share on other sites