[Cryptech-Commits] [core/math/modexp] 01/03: Added testcases with 1024 bit and 2048 bit modulus, mem and short exponents.

git at cryptech.is git at cryptech.is
Tue Jun 30 07:34:20 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 4e43d0acb92dd3110b89e9b153b9c0ecb441c655
Author: Joachim Strömbergson <joachim at secworks.se>
Date:   Mon Jun 29 12:56:28 2015 +0200

    Added testcases with 1024 bit and 2048 bit modulus, mem and short exponents.
---
 src/tb/tb_modexp.v | 398 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 392 insertions(+), 6 deletions(-)

diff --git a/src/tb/tb_modexp.v b/src/tb/tb_modexp.v
index 542d85e..23e9f13 100644
--- a/src/tb/tb_modexp.v
+++ b/src/tb/tb_modexp.v
@@ -1113,6 +1113,390 @@ module tb_modexp();
 
 
   //----------------------------------------------------------------
+  // e65537_1024bit_modulus()
+  //
+  // Task that tests modexp with small exponent and
+  //  2048 bit modulus.
+  //----------------------------------------------------------------
+  task e65537_1024bit_modulus();
+    reg [31 : 0] read_data;
+    begin
+      success = 32'h1;
+      tc_ctr = tc_ctr + 1;
+      $display("Test with e = 65537 and 1024 bit modulus.");
+
+      write_word({GENERAL_PREFIX, ADDR_EXPONENT_PTR_RST}, 32'h00000000);
+      write_word({GENERAL_PREFIX, ADDR_EXPONENT_DATA}, 32'h00010001);
+
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_PTR_RST}, 32'h00000000);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'h00000000);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+
+
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_PTR_RST}, 32'h00000000);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'h00000000);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+
+      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000001);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000021);
+
+      start_test_cycle_ctr();
+
+      // Start processing and wait for ready.
+      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
+      wait_ready();
+
+      stop_test_cycle_ctr();
+
+      write_word({GENERAL_PREFIX, ADDR_RESULT_PTR_RST}, 32'h00000000);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h00000000, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h45d55343, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'ha0971add, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h45d55343, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'ha0971add, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h45d55343, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'ha0971add, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h45d55343, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'ha0971add, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h45d55343, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'ha0971add, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h45d55343, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'ha0971add, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h45d55343, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'ha0971add, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h45d55343, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'ha0971add, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h45d55343, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'ha0971add, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h45d55343, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'ha0971add, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h45d55343, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'ha0971add, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h45d55343, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'ha0971add, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h45d55343, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'ha0971add, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h45d55343, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'ha0971add, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h45d55343, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'ha0971add, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h45d55343, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'ha0971add, read_data);
+
+      if (success !== 1)
+        begin
+          $display("*** ERROR: e65537_1024bit_modulus was NOT successful.");
+          error_ctr = error_ctr + 1;
+        end
+      else
+        $display("*** e65537_1024bit_modulus success.");
+    end
+  endtask // e65537_1024bit_modulus
+
+
+  //----------------------------------------------------------------
+  // e65537_2048bit_modulus()
+  //
+  // Task that tests modexp with small exponent and
+  //  2048 bit modulus.
+  //----------------------------------------------------------------
+  task e65537_2048bit_modulus();
+    reg [31 : 0] read_data;
+    begin
+      success = 32'h1;
+      tc_ctr = tc_ctr + 1;
+      $display("Test with e = 65537 and 2048 bit modulus.");
+
+      write_word({GENERAL_PREFIX, ADDR_EXPONENT_PTR_RST}, 32'h00000000);
+      write_word({GENERAL_PREFIX, ADDR_EXPONENT_DATA}, 32'h00010001);
+
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_PTR_RST}, 32'h00000000);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'h00000000);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+
+
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_PTR_RST}, 32'h00000000);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'h00000000);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+
+      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000001);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000041);
+
+      start_test_cycle_ctr();
+
+      // Start processing and wait for ready.
+      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
+      wait_ready();
+
+      stop_test_cycle_ctr();
+
+      write_word({GENERAL_PREFIX, ADDR_RESULT_PTR_RST}, 32'h00000000);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h00000000, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+
+      if (success !== 1)
+        begin
+          $display("*** ERROR: e65537_2048bit_modulus was NOT successful.");
+          error_ctr = error_ctr + 1;
+        end
+      else
+        $display("*** e65537_2048bit_modulus success.");
+    end
+  endtask // e65537_2048bit_modulus
+
+
+  //----------------------------------------------------------------
   // rob_dec_1024()
   //
   // Task that tests modexp with 1024 bit decipher/sign with
@@ -1490,12 +1874,14 @@ module tb_modexp();
 //      tc3();
 //      autogenerated_BASIC_33bit();
 //      autogenerated_BASIC_128bit();
-      e64bit_64bit_modulus();
-      e65537_64bit_modulus();
-      e65537_64bit_modulus_elength();
-      e65537_128bit_modulus();
-      e65537_256bit_modulus();
-
+//      e64bit_64bit_modulus();
+//      e65537_64bit_modulus();
+//      e65537_64bit_modulus_elength();
+//      e65537_128bit_modulus();
+//      e65537_256bit_modulus();
+//      e65537_1024bit_modulus();
+      e65537_2048bit_modulus();
+//      e65537_2048bit_modulus();
 //      rob_dec_1024();
 //      rob_enc_1024();
 



More information about the Commits mailing list