V
valentin tihomirov
Guest
This line is synthesizable but result is truncated (according to
simulation):
constant DIVIDER: integer := Frequency / BaudRate / 16;
The following rounds to closest integer but works only in simulator:
constant DIVIDER: integer := integer(real(Frequency) / real(BaudRate) /
real(16)); -- not synthetable
Synplify tells "Right argument must evaluate to a constant integer power of
2".
How could I implement a synthesizable round function? Please note, the
floating-point arithmetics is required at compile time only, not at
run-time.
simulation):
constant DIVIDER: integer := Frequency / BaudRate / 16;
The following rounds to closest integer but works only in simulator:
constant DIVIDER: integer := integer(real(Frequency) / real(BaudRate) /
real(16)); -- not synthetable
Synplify tells "Right argument must evaluate to a constant integer power of
2".
How could I implement a synthesizable round function? Please note, the
floating-point arithmetics is required at compile time only, not at
run-time.