B
Ben Voigt
Guest
I'm getting this error:
Fatal: (vsim-3421) Value 125000 for inc_tick is out of range 0 to
124999.
From this code:
SUBTYPE tick_t IS NATURAL RANGE 0 TO 124999;
SIGNAL tick, inc_tick : tick_t;
SIGNAL tick_overflow : BOOLEAN;
tick_overflow <= (tick = tick_t'HIGH);
inc_tick <= tick_t'LOW WHEN tick_overflow ELSE tick + 1;
The expression tick+1 overflowed, but it can at most glitch (the other
path of the selected assignment is active) and the setup time for the
flip-flop shouldn't be an issue.
This synthesizes just fine, but fails under simulation. I can get it
to simulate using a process and sequential if statement, but that's
about five times more code than I have now (I need the overflow flag
for other logic).
Any ideas how to do this elegantly?
Fatal: (vsim-3421) Value 125000 for inc_tick is out of range 0 to
124999.
From this code:
SUBTYPE tick_t IS NATURAL RANGE 0 TO 124999;
SIGNAL tick, inc_tick : tick_t;
SIGNAL tick_overflow : BOOLEAN;
tick_overflow <= (tick = tick_t'HIGH);
inc_tick <= tick_t'LOW WHEN tick_overflow ELSE tick + 1;
The expression tick+1 overflowed, but it can at most glitch (the other
path of the selected assignment is active) and the setup time for the
flip-flop shouldn't be an issue.
This synthesizes just fine, but fails under simulation. I can get it
to simulate using a process and sequential if statement, but that's
about five times more code than I have now (I need the overflow flag
for other logic).
Any ideas how to do this elegantly?