Forum Discussion
Altera_Forum
Honored Contributor
9 years agoHi,
I mean that I want to set v1 to InitVal every time the process is re-evaluated. If I set v1 before the if statement, what about the clocked process something like following:
ENTITY example IS
PORT (
clk : IN STD_LOGIC;
initval : IN INTEGER;
...
);
END ENTITY;
ARCHITECTURE rt OF example IS
...
ex: PROCESS (clk)
VARIABLE v1: INTEGER;
BEGIN
IF (rising_edge(clk)) THEN
v1 := initval; ---------------------------- if I initialize here
IF (v1 < 100) THEN
v1 := v1 + 1;
END IF;
END IF;
END PROCESS;
END ARCHITECTURE;
Will the value of v1 be initialized to initval at every clock edge in this case? Thank you for the help.