From 7c2dde74f0187f78f8ca4f16a45f10954c170d46 Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Mon, 24 May 2010 20:49:15 +0200 Subject: [PATCH] parser: kleinere anpassungen. eine aenderung verursacht zwar mehr logic elements, wird aber verstaendlicher... logic elements: 2715 -> 2705 --- src/TODO | 11 ++++++--- src/parser.vhd | 60 ++++++++++++++++++-------------------------------- 2 files changed, 29 insertions(+), 42 deletions(-) diff --git a/src/TODO b/src/TODO index 9dcc181..0704608 100644 --- a/src/TODO +++ b/src/TODO @@ -12,13 +12,18 @@ == low prio == -- mehr testfaelle fuer alu/scanner/parser -- parser refactor - logic elements eliminieren == jakob/thomas fragen == - sram warning @ quartus - coverage fuer abgabe noetig? - bei -cover funktioniert 's' nicht, siehe http://pastebin.com/p8RwNk7j -- wo sieht man f_max im quartus? - wie detailiert muessen die screenshots der simulationen sein? + + +== FAQ = +Q: wo sieht man f_max im quartus? +A: in der project_gen.tcl die zeile + > set_global_assignment -name FMAX_REQUIREMENT "33.33 MHz" -section_id sys_clk + entfernen und danach das quartus projekt neu erstellen. danach sollte fmax im + timing report ersichtlich sein. diff --git a/src/parser.vhd b/src/parser.vhd index 2bf4e95..39b9a96 100644 --- a/src/parser.vhd +++ b/src/parser.vhd @@ -245,42 +245,27 @@ begin state_next <= SREAD_SPACE_PROC_SIGN; end if; when SREAD_SPACE_PROC | SREAD_SPACE_PROC_SIGN => - case p_read is - when x"20" => null; - when x"2D" => - case state_int is - when SREAD_SPACE_PROC => - case state_int is - when SREAD_SPACE_PROC => state_next <= SREAD_SIGN; - when others => assert(false) report "wtf @ state3"; - end case; - - when SREAD_SPACE_PROC_SIGN => - p_rget_next <= '1'; - case state_int is - when SREAD_SPACE_PROC => state_next <= SREAD_NEXTBYTE; - when SREAD_SPACE_PROC_SIGN => state_next <= SREAD_OP1; - when others => assert(false) report "wtf @ state2"; - end case; - - when others => assert(false) report "SREAD_SPACE_PROC/3: shouldn't happen"; - end case; - when others => - p_rget_next <= '1'; - case state_int is - when SREAD_SPACE_PROC => state_next <= SREAD_NEXTBYTE; - when SREAD_SPACE_PROC_SIGN => state_next <= SREAD_OP1; - when others => assert(false) report "wtf @ state2"; - end case; - end case; - if p_rdone = '0' then case state_int is when SREAD_SPACE_PROC => state_next <= SREAD_SPACE_GET; when SREAD_SPACE_PROC_SIGN => state_next <= SREAD_SPACE_GET_SIGN; when others => assert(false) report "wtf @ state1"; end case; + else + if p_read = x"2d" and state_int = SREAD_SPACE_PROC then + -- vorzeichen? + state_next <= SREAD_SIGN; + elsif p_read /= x"20" then + -- leerzeichen sollen ignoriert werden + p_rget_next <= '1'; + case state_int is + when SREAD_SPACE_PROC => state_next <= SREAD_NEXTBYTE; + when SREAD_SPACE_PROC_SIGN => state_next <= SREAD_OP1; + when others => assert(false) report "SREAD_SPACE_PROC{,_SIGN}: shouldn't happen"; + end case; + end if; end if; + when SREAD_SIGN => z_sign_next <= '1'; if p_rdone = '0' then @@ -336,9 +321,7 @@ begin state_next <= SREAD_OP2; when SREAD_OP2 => if p_rdone = '0' then - if aktop_int /= ALU_NOP then - state_next <= SCALC_1; - end if; + state_next <= SCALC_1; end if; when SCALC_1 => @@ -507,6 +490,9 @@ begin end if; when SERROR1 => + p_wtake_next <= '1'; + p_write_next <= hbyte(to_unsigned (character'pos(error_str(err_int)(errc_int)),8)); + errc_tmp_next <= errc_int - 1; if p_wdone = '1' then if errc_int <= 2 then state_next <= SDONE; @@ -515,6 +501,7 @@ begin end if; end if; when SERROR2 => + errc_next <= errc_tmp_int; if p_wdone = '0' then state_next <= SERROR1; end if; @@ -532,13 +519,8 @@ begin -- fehlerbehandlung case state_int is - when SERROR1 => - p_wtake_next <= '1'; - p_write_next <= hbyte(to_unsigned (character'pos(error_str(err_int)(errc_int)),8)); - errc_tmp_next <= errc_int - 1; - when SERROR2 => - errc_next <= errc_tmp_int; - when SDONE => null; + -- diese states sind ausgenommen vom "pokemon-exception-handling" + when SERROR1 | SERROR2 | SDONE => null; when others => if calc_error = '1' then if op2_int = 0 then -- 2.25.1