You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, defining RANGE_ASSERTIONS will cause svreal to fail with a fatal error whenever a real value is outside of the range of the signal to which it is being assigned. As currently implemented, though, this is pickier than necessary -- logic delays may cause values to temporarily exceed the allowed range, without causing any issues. Something like this might work:
`ifdef RANGE_ASSERTIONS
`undef RANGE_ASSERTIONS
`COPY_FORMAT_REAL(in, in_inertial);
`define RANGE_ASSERTIONS
`else
`COPY_FORMAT_REAL(in, in_inertial);
`endifassign #(1ns) in_inertial = in;
always @(in_inertial) beginif (!((min <= `TO_REAL(in_inertial)) && (`TO_REAL(in_inertial) <= max))) begin$display("Real number %s with value %f out of range (%e to %e).", name, `TO_REAL(in_inertial), min, max);
$fatal;
endend
We might want to make that inertial delay of 1ns user-adjustable, and maybe also have a flag for if range assertions should be fatal errors or just warnings.
The text was updated successfully, but these errors were encountered:
At the moment, defining RANGE_ASSERTIONS will cause svreal to fail with a fatal error whenever a real value is outside of the range of the signal to which it is being assigned. As currently implemented, though, this is pickier than necessary -- logic delays may cause values to temporarily exceed the allowed range, without causing any issues. Something like this might work:
We might want to make that inertial delay of 1ns user-adjustable, and maybe also have a flag for if range assertions should be fatal errors or just warnings.
The text was updated successfully, but these errors were encountered: