parser: overflow fix
[hwmod.git] / src / parser.vhd
index 616555e21ef154677c5f92fe67c931c963c2f176..c74b4cb1e801dacda11a7121a545b145bc64cd7c 100644 (file)
@@ -463,7 +463,15 @@ begin
                                case opp_int is
                                        when ALU_NOP | ALU_ADD | ALU_SUB =>
                                                case opp_int  is
-                                                       when ALU_SUB => op1_next <= (not tmp) + 1;
+                                                       when ALU_SUB =>
+                                                               -- xst (xilinx) workaround
+                                                               if x"80000000" = tmp then
+                                                                       -- vgl. testfall 37 und 38
+                                                                       err_next <= 3;
+                                                                       op1_next <= tmp;
+                                                               else
+                                                                       op1_next <= (not tmp) + 1;
+                                                               end if;
                                                        when others => op1_next <= tmp;
                                                end case;
                                                case aktop_int is
@@ -519,6 +527,7 @@ begin
                                                                punkt_next <= op3;
                                                        when others => assert (false) report "SCALC_2/1: shouldn't happen!";
                                                end case;
+                                       when ALU_DONE => null;
                                        when others => assert (false) report "SCALC_2/2: shouldn't happen!";
                                end case;
                                -- aktuelle rechenoperation fuer naechste 'runde' uebernehmen