+ when S_S_WRITE =>
+ -- nur bei < HSPALTE_MAX weiter machen
+ -- Hint: '/=' billiger als '<'
+ if unsigned(s_cnt_int) /= HSPALTE_MAX then
+ wr_next <= '1';
+ address_next <= std_logic_vector(unsigned(pos_int) + unsigned(s_cnt_int));
+ data_in_next <= s_char;
+ s_cnt_next <= std_logic_vector(unsigned(s_cnt_int) + 1);
+ else
+ -- was_bs hier missbrauchen, um ein d_new_eingabe zu verhindern
+ was_bs_next <= '1';
+ end if;
+ when S_S_BS =>
+ -- ab 1 darf nicht mehr dekrementiert werden
+ addr_tmp := (others => '0');
+ if unsigned(s_cnt_int) /= 1 then
+ addr_tmp(hspalte'length - 1 downto 0) := std_logic_vector(unsigned(s_cnt_int) - 1);
+ d_new_bs_next <= '1';
+ else
+ addr_tmp(hspalte'length - 1 downto 0) := s_cnt_int;
+ end if;
+ s_cnt_next <= addr_tmp(hspalte'length - 1 downto 0);
+ wr_next <= '1';
+ address_next <= std_logic_vector(unsigned(pos_int) + unsigned(addr_tmp));
+ data_in_next <= (others => '0');
+ was_bs_next <= '1';
+ when S_S_FIN =>
+ s_cnt_next <= (0 => '1', others => '0');
+ d_new_result_next <= '1';
+ -- resetten der parser counter
+ p_sp_read_next <= (others => '0');
+ p_sp_write_next <= std_logic_vector(to_unsigned(HSPALTE_MAX,p_sp_write_next'length));
+ when S_S_FIN_POSUP =>
+ -- overflowcheck nach 50 berechnungen => wieder von vorne anfangen
+ if pos_int = std_logic_vector(to_unsigned(H_RAM_SIZE-142,H_RAM_WIDTH)) then
+ pos_next <= (others => '0');
+ else
+ pos_next <= std_logic_vector(unsigned(pos_int) + to_unsigned(142,H_RAM_WIDTH));
+ end if;
+ when S_S_CLEAR_NEXT0 =>
+ -- die naechsten 142 bytes im speicher resetten
+ wr_next <= '1';
+ address_next <= std_logic_vector(unsigned(pos_int) + unsigned(s_cnt_int));
+ data_in_next <= (others => '0');
+ if s_cnt_int = hspalte(to_unsigned(HSPALTE_MAX,hspalte'length)) then
+ s_cnt_next <= (0 => '1', others => '0');
+ else
+ s_cnt_next <= std_logic_vector(unsigned(s_cnt_int) + 1);
+ end if;
+ when S_S_CLEAR_NEXT1 =>
+ -- die naechsten 142 bytes im speicher resetten
+ wr_next <= '1';
+ address_next <= std_logic_vector(unsigned(pos_int) + to_unsigned(HSPALTE_MAX,H_RAM_WIDTH) + unsigned(s_cnt_int));
+ data_in_next <= (others => '0');
+ if s_cnt_int = hspalte(to_unsigned(HSPALTE_MAX,hspalte'length)) then
+ s_cnt_next <= (0 => '1', others => '0');
+ else
+ s_cnt_next <= std_logic_vector(unsigned(s_cnt_int) + 1);
+ end if;
+ when S_S_DONE =>
+ s_done_next <= '1';
+ if was_bs_int = '0' then
+ d_new_eingabe_next <= '1';
+ end if;
+ if s_take = '0' then
+ was_bs_next <= '0';
+ end if;
+
+ when S_D_INIT =>
+ addr_tmp := (others => '0');
+ addr_tmp(hzeile'length - 1 downto 0) := d_zeile;
+ mul_tmp := std_logic_vector(unsigned(addr_tmp) * to_unsigned(HSPALTE_MAX,H_RAM_WIDTH));
+ addr_tmp := mul_tmp((addr_tmp'length - 1) downto 0);
+ addr_tmp := std_logic_vector(unsigned(addr_tmp) + unsigned(d_spalte));
+ address_next <= addr_tmp;
+ d_new_eingabe_next <= '0';
+ d_new_result_next <= '0';
+ when S_D_READ =>
+ d_char_next <= data_out;
+ d_done_next <= '1';
+
+ when S_PC_INIT =>
+ addr_tmp := (others => '0');
+ addr_tmp(hzeile'length - 1 downto 0) := pc_zeile;
+ mul_tmp := std_logic_vector(unsigned(addr_tmp) * to_unsigned(HSPALTE_MAX,H_RAM_WIDTH));
+ addr_tmp := mul_tmp((addr_tmp'length - 1) downto 0);
+ addr_tmp := std_logic_vector(unsigned(addr_tmp) + unsigned(pc_spalte));
+ address_next <= addr_tmp;
+ when S_PC_READ =>
+ pc_done_next <= '1';
+ pc_char_next <= data_out;
+
+ when S_P_READ =>
+ wr_next <= '0';
+ spalte_tmp := std_logic_vector(unsigned(p_sp_read_int) + 1);
+ p_sp_read_next <= spalte_tmp;
+ address_next <= std_logic_vector(unsigned(pos_int) + unsigned(spalte_tmp));
+ when S_P_READ_DONE =>
+ p_rdone_next <= '1';
+ p_read_next <= data_out;
+
+ when S_P_WRITE =>
+ wr_next <= '1';
+ data_in_next <= p_write;
+ spalte_tmp := std_logic_vector(unsigned(p_sp_write_int) - 1);
+ p_sp_write_next <= spalte_tmp;
+ address_next <= std_logic_vector(unsigned(pos_int) + to_unsigned(HSPALTE_MAX,H_RAM_WIDTH) + unsigned(spalte_tmp));
+ when S_P_WRITE_DONE =>
+ p_wdone_next <= '1';
+ when S_P_DONE =>
+ p_rdone_next <= '0';
+ p_wdone_next <= '0';