diff options
-rw-r--r-- | modexp_fpga_systolic.cpp | 11 |
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]); |