aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel V. Shatov (Meister) <meisterpaul1@yandex.ru>2017-07-08 19:40:39 +0300
committerPavel V. Shatov (Meister) <meisterpaul1@yandex.ru>2017-07-08 19:40:39 +0300
commit9e564305d8941bceafc1b1c1d6d611b642c6dce9 (patch)
tree6d0a0cf252923a3ded0c4ed4e175ff871010c2a5
parentee41d5837267e2d6a2e2ae27751d8d03a80e3657 (diff)
Minor update, there's no need to update Aj inside of systolic loop.
-rw-r--r--modexp_fpga_systolic.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/modexp_fpga_systolic.cpp b/modexp_fpga_systolic.cpp
index 9dce130..93c6111 100644
--- a/modexp_fpga_systolic.cpp
+++ b/modexp_fpga_systolic.cpp
@@ -42,6 +42,9 @@
#include "modexp_fpga_model_pe.h"
+#include <stdio.h>
+
+
//----------------------------------------------------------------
void multiply_systolic(const FPGA_WORD *A, const FPGA_WORD *B, FPGA_WORD *P, size_t len_ab, size_t len_p)
//----------------------------------------------------------------
@@ -76,15 +79,17 @@ void multiply_systolic(const FPGA_WORD *A, const FPGA_WORD *B, FPGA_WORD *P, siz
// reset word index
j_index = 0;
- // scan chunks of A
+ // current word of A
+ Aj = (i < len_ab) ? A[i] : 0;
+
+ // scan chunks of B
for (k=0; k<num_systolic_cycles; k++)
{
// simulate how systolic array would work
for (j=0; j<SYSTOLIC_NUM_WORDS; j++)
{
- // current words of B and A
+ // current word of B
Bj = (j_index < len_ab) ? B[j_index] : 0;
- Aj = (i < len_ab) ? A[i] : 0;
// Pj = Aj * Bj
pe_mul(Aj, Bj, t[k][j], c_in[k][j], &s[k][j], &c_out[k][j]);