I want to have a sequence on the antecedent side of my properties in order not to duplicate the function call and local variables in every property. The sequence calls the function and looks for the time whether it has passed a specific delay. Unfortunately, it does seem like antecedent never matches and function is called only once. What’s wrong here?
In reply to emin:
function call and task calls with functions and tasks require the empty argument list, in other words the ().
module m;
bit f1, a;
function f;
return 1;
endfunction
initial begin
a=f; // <<< need f()
$display ("a=%b", a);
end
endmodule
"Invalid function call: f." "testbench.sv" 8 8
Is it better to use $realtime rather than $time?
YES>
Are there any differences between always forever and initial forever?
I don’t believe so; they both work.>
What is the advantage of using data type bit over logic?
With bit, there is no need to initialize the clk. Logic is of course 4 states, but I don’t believe that there is much impact in terms of speed for simulation, maybe less memory.