I declare my variable:
real meas_diff_div;
I have a task, where I use this variable:
measure_task(meas_diff_div);
After that I filter for an error based on the value of this real
:
if(meas_diff_div > 0)`error("error message. %f", meas_diff_div);
Sometimes the error is triggered, even if the printed value is 0.000000
At the task declaration, the 1st line looks like this:
task measure_task(output real output_value);
In the task this real
is 'filled' up with (I use $floor
in this context to get around the % 'modulo' operator applied to 'real' problemtype):
output_value = realtime_val1 - realtime_val2 * $floor(realtime_val1/realtime_val2);