Jan De Ceuster said:
Hi Andres,
can you give some code of what you have done? It's a bit hard to debug
without any information.
kind regards,
Jan
Hi Jan,
thanx for your help in advance,
it's just a simple one-hot encoded FSM, where I set some control
signals for my datapath logic amongst which are load signals for all
my accumulator units; these load signals are set to zero in all the
states except in states S_SHIFT_REG_LOADING and S_RUN_MATCHING where I
set one load signal to 1
one thing I tried was to comment out the errornous lines but then the
same problem arose with the signal "en_x_pos_count";
kind regards,
Andreas
-- code
Generic(
accu_count: integer := 468
);
....
signal load: std_logic_vector(accu_count-1 downto 0);
....
....
next_state_and_output: process(current_state, sr_full, start_matching,
line_finished, internal_x_position, image_line_finished)
begin
case current_state is
when S_RESET =>
for index in 0 to accu_count-1 loop
load(index) <= '0';
end loop;
clr_x_counter <= '0';
clr_accu <= '0';
load_template <= '0';
clr_line_counter <= '1';
en_matching <= '0';
en_line_counter <= '0';
clr_template_reg <= '0';
en_x_pos_count <= '0';
load_shift_reg <= '0';
clr_shift_reg <= '0';
next_state <= S_IDLE;
...
when S_SHIFT_REG_LOADING =>
for index in 0 to accu_count-1 loop
load(index) <= '0';
end loop;
load_template <= '1';
en_line_counter <= '0';
clr_x_counter <= '0';
clr_shift_reg <= '0';
load_shift_reg <= '1';
if sr_full'event and sr_full = '1' then
next_state <= S_RUN_MATCHING;
load(conv_integer(internal_x_position)) <= '1';
en_x_pos_count <= '1';
else
en_x_pos_count <= '0';
next_state <= S_SHIFT_REG_LOADING;
end if;
...
when S_RUN_MATCHING =>
for index in 0 to accu_count-1 loop
load(index) <= '0';
end loop;
load_template <= '0';
clr_x_counter <= '0';
load_shift_reg <= '1';
if image_line_finished = '1' then
next_state <= S_IDLE;
elsif image_line_finished = '0' then
if line_finished = '1' then
en_x_pos_count <= '0';
next_state <= S_NEXT_TEMPLATE_LINE;
elsif line_finished = '0' then
load(conv_integer(internal_x_position)) <= '1';
en_x_pos_count <= '1';
next_state <= S_RUN_MATCHING;
end if;
end if;
...