aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoachim StroĢˆmbergson <joachim@secworks.se>2015-06-29 14:06:11 +0200
committerJoachim StroĢˆmbergson <joachim@secworks.se>2015-06-29 14:06:11 +0200
commitcc56cafbe5d1e8b426bd8cad618df73ad0608d11 (patch)
treeadf309b38cb688879c6e0f2ca00978715a8b4c50 /src
parent3da17709b79b4b97e246e64a102da5276e0c2327 (diff)
Added testcase from c model that tests montprod with a lot of bit twiddling.perfopt
Diffstat (limited to 'src')
-rw-r--r--src/tb/tb_montprod.v20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/tb/tb_montprod.v b/src/tb/tb_montprod.v
index cd27949..9a6d2b0 100644
--- a/src/tb/tb_montprod.v
+++ b/src/tb/tb_montprod.v
@@ -351,7 +351,7 @@ module tb_montprod();
input [0 : 8192-1] expected
);
begin
- $display("*** Mongomry multiplier test started");
+ $display("*** Montgomery multiplier test started");
begin: copy_test_vectors
integer i;
integer j;
@@ -420,19 +420,19 @@ module tb_montprod();
begin : short_tests
//* A= b B= 11 M= 13 A*B= 10 Ar= 9 Br= 7 Ar*Br= 1 A*B= 10
- test_mont_prod( 1, {32'h9, 8160'h0}, {32'h7, 8160'h0}, {32'h13,8160'h0}, {32'h1,8160'h0} );
+// test_mont_prod( 1, {32'h9, 8160'h0}, {32'h7, 8160'h0}, {32'h13,8160'h0}, {32'h1,8160'h0} );
//* A= b B= 13 M= 11 A*B= 5 Ar= b Br= 2 Ar*Br= 5 A*B= 5
- test_mont_prod( 1, {32'hb, 8160'h0}, {32'h2, 8160'h0}, {32'h11,8160'h0}, {32'h5,8160'h0} );
+// test_mont_prod( 1, {32'hb, 8160'h0}, {32'h2, 8160'h0}, {32'h11,8160'h0}, {32'h5,8160'h0} );
//* A= 11 B= b M= 13 A*B= 10 Ar= 7 Br= 9 Ar*Br= 1 A*B= 10
- test_mont_prod( 1, {32'h7, 8160'h0}, {32'h9, 8160'h0}, {32'h13,8160'h0}, {32'h1,8160'h0} );
+// test_mont_prod( 1, {32'h7, 8160'h0}, {32'h9, 8160'h0}, {32'h13,8160'h0}, {32'h1,8160'h0} );
//* A= 11 B= 13 M= b A*B= 4 Ar= 2 Br= a Ar*Br= 5 A*B= 4
- test_mont_prod( 1, {32'h2, 8160'h0}, {32'ha, 8160'h0}, {32'h0b,8160'h0}, {32'h5,8160'h0} );
+// test_mont_prod( 1, {32'h2, 8160'h0}, {32'ha, 8160'h0}, {32'h0b,8160'h0}, {32'h5,8160'h0} );
//* A= 13 B= b M= 11 A*B= 5 Ar= 2 Br= b Ar*Br= 5 A*B= 5
//* A= 13 B= 11 M= b A*B= 4 Ar= a Br= 2 Ar*Br= 5 A*B= 4
@@ -453,6 +453,16 @@ module tb_montprod();
//debug B => 0 0 4000
//debug M => 1ffffff ffffffff ffffffff
//debug s => 0 0 80
+
+ $display("*** testcase for montprod with lots of bit twiddling.");
+ test_mont_prod(2,
+ {64'hffeeffee12345678, 8128'h0},
+ {64'hffeeffeeaabbaabb, 8128'h0},
+ {64'hffeeffeedeadbeef, 8128'h0},
+ {64'h0068e96e67b14db3, 8128'h0});
+
+
+ $display("*** 96 bit test case..");
test_mont_prod( 3, {96'h1, 8096'h0}, {96'h4000, 8096'h0}, {96'h1ffffffffffffffffffffff,8096'h0}, {96'h80,8096'h0} );
end
endtask // short_tests