parser: blanks nach dem ergebnis rausschreiben... macht es fuer pc-com einfacher
authorBernhard Urban <lewurm@gmail.com>
Thu, 27 May 2010 16:26:32 +0000 (18:26 +0200)
committerBernhard Urban <lewurm@gmail.com>
Thu, 27 May 2010 16:26:32 +0000 (18:26 +0200)
... rs232 output schaut mal sehr gut aus :)

src/parser.vhd

index 5736bf5be96661a7ffa25b678a1f83c121bf86ea..95952d1dd45ad553c43f4bc68a5202368b2efe25 100644 (file)
@@ -26,7 +26,7 @@ architecture beh of parser is
                SREAD_SPACE_GET_SIGN, SREAD_SPACE_PROC, SREAD_SPACE_PROC_SIGN, SREAD_OP1, SREAD_OP2,
                SREAD_SIGN, SREAD_NEXTBYTE, SREAD_CALCNUMBER1, SREAD_CALCNUMBER2, SCALC_1,
                SCALC_14, SCALC_15, SCALC_2, SWRITE_CHAR0, SWRITE_CHAR1, SWRITE_CHAR2,
-               SWRITE_SIGN1, SWRITE_SIGN2, SDONE, SERROR1, SERROR2);
+               SWRITE_SIGN1, SWRITE_SIGN2, SDONE, SERROR1, SERROR2, SBLANK1, SBLANK2);
        signal state_int, state_next : PARSER_STATE;
        signal z_int, z_next, strich_int, strich_next, wtmp_int, wtmp_next : csigned;
        signal punkt_int, punkt_next : csigned;
@@ -455,13 +455,14 @@ begin
                                wtmp_next <= op3;
 
                                if p_wdone = '1' then
+                                       errc_next <= errc_int - 1;
                                        -- ueberpruefung auf -2147483648 fuer testfall 39 und 40
                                        -- x"80000000": xst (xilinx) workaround
                                        if strich_int < 10 and strich_int /= x"80000000" then
                                                if z_sign_int = '1' then
                                                        state_next <= SWRITE_SIGN1;
                                                else
-                                                       state_next <= SDONE;
+                                                       state_next <= SBLANK1;
                                                end if;
                                        else
                                                state_next <= SWRITE_CHAR2;
@@ -486,9 +487,27 @@ begin
                                end if;
 
                                if p_wdone = '1' then
+                                       errc_next <= errc_int - 1;
                                        state_next <= SDONE;
                                end if;
 
+                       when SBLANK1 =>
+                               p_wtake_next <= '1';
+                               p_write_next <= x"20";
+                               errc_tmp_next <= errc_int - 1;
+                               if p_wdone = '1' then
+                                       if errc_int <= 2 then
+                                               state_next <= SDONE;
+                                       else
+                                               state_next <= SBLANK2;
+                                       end if;
+                               end if;
+                       when SBLANK2 =>
+                               errc_next <= errc_tmp_int;
+                               if p_wdone = '0' then
+                                       state_next <= SBLANK1;
+                               end if;
+
                        when SERROR1 =>
                                p_wtake_next <= '1';
                                p_write_next <= hbyte(to_unsigned (character'pos(error_str(err_int)(errc_int)),8));