B
Brandon
Guest
I'm trying to scale some reals in a test bench, however I'm getting an
out of range error:
<SNIP>
signal srefloat_unscale : real;
signal simfloat_unscale : real;
signal srefloat_test : real;
signal simfloat_test : real;
begin
....
....
....
scaleresult_proc: process(srefloat_unscale, simfloat_unscale)
begin
srefloat_test <= srefloat_unscale*2.0**7;
simfloat_test <= simfloat_unscale*2.0**7;
-- srefloat_test <= srefloat_unscale;
-- simfloat_test <= simfloat_unscale;
end process scaleresult_proc;
</SNIP>
In ModelSim:
VSIM> run
# ** Fatal: (vsim-3421) Value -1.#INF is out of range 1e+308 to
-1e+308.
What gives? Is the scale factor I'm multiplying by somehow causing an
overflow in the floating point? srefloat_unscale and simfloat_unscale
are both reals between -1 and +1 (normalized fixed point), so the
result should be anywhere from -128 to +128 after scaling.
Thanks,
-Brandon
out of range error:
<SNIP>
signal srefloat_unscale : real;
signal simfloat_unscale : real;
signal srefloat_test : real;
signal simfloat_test : real;
begin
....
....
....
scaleresult_proc: process(srefloat_unscale, simfloat_unscale)
begin
srefloat_test <= srefloat_unscale*2.0**7;
simfloat_test <= simfloat_unscale*2.0**7;
-- srefloat_test <= srefloat_unscale;
-- simfloat_test <= simfloat_unscale;
end process scaleresult_proc;
</SNIP>
In ModelSim:
VSIM> run
# ** Fatal: (vsim-3421) Value -1.#INF is out of range 1e+308 to
-1e+308.
What gives? Is the scale factor I'm multiplying by somehow causing an
overflow in the floating point? srefloat_unscale and simfloat_unscale
are both reals between -1 and +1 (normalized fixed point), so the
result should be anywhere from -128 to +128 after scaling.
Thanks,
-Brandon