Prob: Have some analog signals for which I need to check for signal toggle. For Eg, If the signal toggles within a particular time limit [say 10ns], then condition passes and fails if the signal doesn’t toggle. Need to enable this check from the start of the process.
Was trying out using assertion, but unable to achieve the same. In general how to take care of such scenarios in assertions ? i.e. checking of signal toggles between some time intervals or so ??
property aloha;
time cur_time;
// @(posedge clk) (1,cur_time=$time) |-> ($stable(signal) throughout (($time-cur_time) == 10ns));
@(signal) (1,cur_time=$time) |-> @(signal) ($time-cur_time <= 10ns);
endproperty: aloha
assert_aloha: assert property (aloha) begin $info("%m Worked %t\n", $time); end
else begin $error("%m Failed\n"); end
But was able to do a simple functional check to validate the same:
task launch_check();
bit timeout = 0;
forever begin
fork
begin
@(signal);
end
begin
#10ns; timeout = 1;
end
join_any
disable fork;
if (timeout) begin $display("Error\n"); timeout = 0; end
end
endtask: launch_check
But this assertion doesn’t get triggered/checked if the signal ‘a’ doesn’t change at all right ?
The check which I was trying to bring in is,
a. The signal should change within the required time i.e. 10ns from the start of the simulation.
b. If the signal doesn’t toggle then its an issue and the assertion should fail.
But the example which you posted above doesn’t get triggered if the signal doesn’t get toggled at all. How do we overcome that scenario ?