aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim StroĢˆmbergson <joachim@secworks.se>2015-06-16 15:57:43 +0200
committerJoachim StroĢˆmbergson <joachim@secworks.se>2015-06-16 15:57:43 +0200
commit4f7b066afc92075d9c13b6ab423e2aa59b19284c (patch)
treeef523dc3a3ebd9cc0c42002411cb4482721e78e1
parentaa58db8cf671c6abcbc8d918bac4345d2f22d809 (diff)
Fixed final big testcase to match python model.
-rw-r--r--src/tb/tb_modexp.v44
1 files changed, 24 insertions, 20 deletions
diff --git a/src/tb/tb_modexp.v b/src/tb/tb_modexp.v
index ca2ad8d..d250b0c 100644
--- a/src/tb/tb_modexp.v
+++ b/src/tb/tb_modexp.v
@@ -967,17 +967,6 @@ module tb_modexp();
write_word({GENERAL_PREFIX, ADDR_EXPONENT_DATA}, 32'h00000000);
write_word({GENERAL_PREFIX, ADDR_EXPONENT_DATA}, 32'h00010001);
- 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'hf169d36e);
- write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hbe2ce61d);
- write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hc2e87809);
- write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'h4fed15c3);
- write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'h7c70eac5);
- write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'ha123e643);
- write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'h299b36d2);
- write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'h788e583b);
-
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'hf169d36e);
@@ -989,6 +978,17 @@ module tb_modexp();
write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'h299b36d2);
write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'h788e583b);
+ 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'hf169d36e);
+ write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hbe2ce61d);
+ write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hc2e87809);
+ write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'h4fed15c3);
+ write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'h7c70eac5);
+ write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'ha123e643);
+ write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'h299b36d2);
+ write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'h788e583a);
+
write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000009);
write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000009);
@@ -1002,10 +1002,14 @@ module tb_modexp();
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'h0ddc404d, read_data);
- read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h91600596, read_data);
- read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h7425a8d8, read_data);
- read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'ha066ca56, read_data);
+ read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf169d36e, read_data);
+ read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hbe2ce61d, read_data);
+ read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hc2e87809, read_data);
+ read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4fed15c3, read_data);
+ read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h7c70eac5, read_data);
+ read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'ha123e643, read_data);
+ read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h299b36d2, read_data);
+ read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h788e583a, read_data);
if (success !== 1)
begin
@@ -1391,13 +1395,13 @@ module tb_modexp();
reset_dut();
dump_dut_state();
- tc1();
- tc2();
- tc3();
+// tc1();
+// tc2();
+// tc3();
// autogenerated_BASIC_33bit();
// autogenerated_BASIC_128bit();
-// e65537_64bit_modulus();
- e65537_128bit_modulus();
+ e65537_64bit_modulus();
+// e65537_128bit_modulus();
// e65537_256bit_modulus();
// rob_dec_1024();