divider: Always compute result/sresult/d_out.write_reg_data
authorPaul Mackerras <paulus@ozlabs.org>
Wed, 25 Sep 2019 10:03:46 +0000 (20:03 +1000)
committerPaul Mackerras <paulus@ozlabs.org>
Fri, 27 Sep 2019 22:41:17 +0000 (08:41 +1000)
These are intended to be combinatorial.  The previous code was giving
warnings in vivado about registers/latches with no clock defined.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
divider.vhdl

index 6b20576ea9d4bbf1316edb455f9dc80f2ef3bfdf..c1335222edb48bf062adb1604e667bd78e64617f 100644 (file)
@@ -108,20 +108,21 @@ begin
         d_out <= DividerToWritebackInit;
         d_out.write_reg_nr <= write_reg;
 
+        if is_modulus = '1' then
+            result <= dend(127 downto 64);
+        else
+            result <= quot;
+        end if;
+        if neg_result = '1' then
+            sresult <= std_ulogic_vector(- signed(result));
+        else
+            sresult <= result;
+        end if;
+        d_out.write_reg_data <= sresult;
+
         if count(6) = '1' then
             d_out.valid <= '1';
             d_out.write_reg_enable <= '1';
-            if is_modulus = '1' then
-                result <= dend(127 downto 64);
-            else
-                result <= quot;
-            end if;
-            if neg_result = '1' then
-                sresult <= std_ulogic_vector(- signed(result));
-            else
-                sresult <= result;
-            end if;
-            d_out.write_reg_data <= sresult;
             if rc = '1' then
                 d_out.write_cr_enable <= '1';
                 d_out.write_cr_mask <= num_to_fxm(0);