[Cryptech-Commits] [core/math/modexp] 01/01: Removing state that has been collapsed.

git at cryptech.is git at cryptech.is
Mon Jun 22 11:17:39 UTC 2015


This is an automated email from the git hooks/post-receive script.

joachim at secworks.se pushed a commit to branch perfopt
in repository core/math/modexp.

commit 747377fd9a6533695dbee9394e16ad4e0481f5b2
Author: Joachim Strömbergson <joachim at secworks.se>
Date:   Mon Jun 22 13:17:34 2015 +0200

    Removing state that has been collapsed.
---
 src/rtl/montprod.v | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/src/rtl/montprod.v b/src/rtl/montprod.v
index 6d3d865..5957c17 100644
--- a/src/rtl/montprod.v
+++ b/src/rtl/montprod.v
@@ -78,9 +78,8 @@ module montprod(
   localparam CTRL_EMIT_S         = 4'ha;
 
   localparam SMUX_0              = 2'h0;
-  localparam SMUX_ADD_SM         = 2'h1;
-  localparam SMUX_ADD_SA         = 2'h2;
-  localparam SMUX_SHR            = 2'h3;
+  localparam SMUX_ADD            = 2'h1;
+  localparam SMUX_SHR            = 2'h2;
 
 
   //----------------------------------------------------------------
@@ -365,10 +364,7 @@ module montprod(
 
 
       case (s_mux_reg)
-        SMUX_0:
-          s_mem_new = 32'h0;
-
-        SMUX_ADD_SA:
+        SMUX_ADD:
           begin
             if (first_iteration_reg)
               muxed_s_mem_read_data = 32'h0;
@@ -523,11 +519,13 @@ module montprod(
 
         CTRL_L_CALC_SA:
           begin
-            s_mux_new = SMUX_ADD_SA;
+            s_mux_new = SMUX_ADD;
 
             if (word_index_reg == 8'h0)
               begin
                 reset_word_index_lsw = 1'b1;
+                first_iteration_new  = 1'b0;
+                first_iteration_we   = 1'b1;
                 montprod_ctrl_new    = CTRL_L_STALLPIPE_SA;
                 montprod_ctrl_we     = 1'b1;
               end
@@ -535,8 +533,6 @@ module montprod(
 
         CTRL_L_STALLPIPE_SA:
           begin
-            first_iteration_new  = 1'b0;
-            first_iteration_we   = 1'b1;
             montprod_ctrl_new    = CTRL_L_CALC_SDIV2;
             montprod_ctrl_we     = 1'b1;
             reset_word_index_msw = 1'b1;
@@ -544,7 +540,7 @@ module montprod(
 
         CTRL_L_CALC_SDIV2:
           begin
-            s_mux_new     = SMUX_SHR;
+            s_mux_new = SMUX_SHR;
 
             if (word_index_reg == length_m1)
               begin



More information about the Commits mailing list