history: maximal 70 zeichen eingabe
authorBernhard Urban <lewurm@gmail.com>
Thu, 20 May 2010 14:39:28 +0000 (16:39 +0200)
committerBernhard Urban <lewurm@gmail.com>
Thu, 20 May 2010 14:39:28 +0000 (16:39 +0200)
src/beh_history_tb.vhd
src/history.test
src/history.vhd

index bf1eb89433df20c9e0fec8a1a6cfeb0fd2b85d54..baf097a602bdfabb291132fa25474751dc06971c 100644 (file)
@@ -167,7 +167,7 @@ begin
                file f : text open read_mode is "../../src/history.test";
                variable l : line;
 
-               variable input : hstring;
+               variable input : string(1 to 100);
 
                variable run_tc, run_inner : boolean := true;
                variable i, j, y : natural;
@@ -189,7 +189,7 @@ begin
                        f1_loop : while not endfile(f) loop
                                readline (f, l);
                                input := (others => nul);
-                               if (l'length <= 72) then
+                               if (l'length <= 100) then
                                        input(1 to l'length) := l.all;
                                        if (input(1) = '#') then
                                                next f1_loop;
@@ -213,7 +213,7 @@ begin
                                icwait(sys_clk, 10);
                                j := j + 1;
 
-                               if j = 73 then
+                               if j = 101 then
                                        run_tc := false;
                                        assert(false) report "wtf @ schleife";
                                        next mainl;
index 92f4e1ffff52353a2f9a2a7497f8e73e94c6e1f7..578998e05f8048ec14063400d62831081968c81e 100644 (file)
@@ -9,3 +9,6 @@ asdf213
 123!!5
 # testfall 4:
 123!!!!5
+# testfall 5:
+# ab "999" sind es zu viele zeichen. danach folgt einmal backspace und ein 1er
+3333333333333333333333333333333333333333333333333333333333333333333333999!1
index b1a1b0193f6f3aa9412d4c29381f1808c614b852..76c4bf70bec70ce1bda69440fa83136f5576ec86 100644 (file)
@@ -106,7 +106,6 @@ begin
        process(state_int, d_get, do_it, s_take, s_backspace, was_bs_int)
        begin
                state_next <= state_int;
-               was_bs_next <= was_bs_int;
 
                case state_int is
                        when SIDLE =>
@@ -128,7 +127,6 @@ begin
                                state_next <= S_S_DONE;
                        when S_S_BS =>
                                state_next <= S_S_DONE;
-                               was_bs_next <= '1';
                        when S_S_FIN =>
                                if do_it = '0' then
                                        state_next <= SIDLE;
@@ -136,7 +134,6 @@ begin
                        when S_S_DONE =>
                                if s_take = '0' then
                                        state_next <= SIDLE;
-                                       was_bs_next <= '0';
                                end if;
 
                        when S_D_INIT =>
@@ -151,11 +148,12 @@ begin
        -- out
        process(state_int, s_cnt_int, d_spalte, data_out, s_char, address_int,
                data_in_int, d_new_result_int, d_new_eingabe_int, d_new_bs_int,
-               was_bs_int)
+               was_bs_int, s_take)
                variable addr_tmp : std_logic_vector(H_RAM_WIDTH - 1 downto 0);
        begin
                s_done_next <= '0';
                s_cnt_next <= s_cnt_int;
+               was_bs_next <= was_bs_int;
                d_new_result_next <= d_new_result_int;
                d_new_eingabe_next <= d_new_eingabe_int;
                d_new_bs_next <= '0';
@@ -173,10 +171,17 @@ begin
                        when S_S_INIT =>
                                null;
                        when S_S_WRITE =>
-                               wr_next <= '1';
-                               address_next <= s_cnt_int;
-                               data_in_next <= s_char;
-                               s_cnt_next <= std_logic_vector(unsigned(s_cnt_int) + 1);
+                               -- nur bei < 71 weiter machen
+                               -- TODO: '/=' billiger als '<' ?
+                               if unsigned(s_cnt_int) /= 71 then
+                                       wr_next <= '1';
+                                       address_next <= 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
                                if unsigned(s_cnt_int) /= 1 then
@@ -190,6 +195,7 @@ begin
                                wr_next <= '1';
                                address_next <= addr_tmp;
                                data_in_next <= (others => '0');
+                               was_bs_next <= '1';
                        when S_S_FIN =>
                                finished_next <= '1';
                                s_cnt_next <= (0 => '1', others => '0');
@@ -199,6 +205,9 @@ begin
                                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 =>
                                address_next <= d_spalte;