Forum Discussion
Altera_Forum
Honored Contributor
14 years agoAvoid Error 10454 - Integer in RANGE
Hello all together,
I am looking for a solution to avoid the Error 10454. I know, that this RANGE is not VHDL-conform.FUNCTION summe(
zahl1 : STD_LOGIC_VECTOR;
zahl2 : STD_LOGIC_VECTOR;
index : NATURAL )
RETURN STD_LOGIC_VECTOR IS
VARIABLE v_summe : STD_LOGIC_VECTOR(11 downto 0);
VARIABLE v_tmp_summe : STD_LOGIC_VECTOR(11 downto 0);
BEGIN
v_tmp_summe := (OTHERS => '0');
FOR i IN 0 TO 2 LOOP
IF index < 8 THEN
v_tmp_summe(zahl1'HIGH+index+i downto index+i) := zahl1;
v_summe := v_summe + v_tmp_summe;
ELSE
EXIT;
END IF;
END LOOP;
RETURN v_summe;
END; So I just want to add several times in one clock cycle. But I have no idea for another solution... Modelsim have no problem with this code and the simulation runs also fine... Thanks a lot!1 Reply
- Altera_Forum
Honored Contributor
How big is zahl1?
You should initialize v_summe at the beginning of the function too, I don't understand how Modelsim can give you an answer other than XXXXX when you do arithmetics on uninitialized vectors. I also assume that you are using the non standard std_logic_(un)signed library. You should consider using numeric_std instead and the signed/unsigned types, this is the recommended way.