Forum Discussion
Altera_Forum
Honored Contributor
10 years agoVariable does not increment
I don't know why the variable clk_count does not increments, it's steel il the value 1. There is the code
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.all;
Entity TestVar Is
Port (
CLK ...
Altera_Forum
Honored Contributor
10 years ago --- Quote Start --- I think that the process(pr_stat) is executed every rising edge of clock. So the counter have to be incremented every rising edge. --- Quote End --- But it isnt, because you didnt make it a clocked process. This process will only execute when pr_stat changes, and because it never changes, the counter will get the initial increment at time 0 and then never do anything again. Make the process sensitive to the clock and make the process use the clock to make the counter increment. If you do not add if rising_edge(clk) to the process, the hardware hehaviour will not match the simulation.