diff --git a/ip_cores/blake2b/src/rtl/blake2b_pipe_top.sv b/ip_cores/blake2b/src/rtl/blake2b_pipe_top.sv index e0fc226..437f78a 100644 --- a/ip_cores/blake2b/src/rtl/blake2b_pipe_top.sv +++ b/ip_cores/blake2b/src/rtl/blake2b_pipe_top.sv @@ -154,8 +154,8 @@ generate init_local_work_vector_pipe(PIPE_G0+1, LAST_BLOCK ? byte_len : 128 , LAST_BLOCK); // Shift message down either from previous pipeline or from fixed portion + msg[PIPE_G0+1] <= 0; for (int i = 0; i < 128; i++) begin - msg[PIPE_G0+1][i*8 +: 8] <= 0; if ((g0+1)*128 + i < MSG_VAR_BYTS) msg[PIPE_G0+1][i*8 +: 8] <= msg[PIPE_G0][((g0+1)*128 + i)*8 +: 8]; end @@ -193,7 +193,7 @@ generate always_comb begin msg_ = msg[PIPE_G2-1]; //for (int i = MSG_VAR_BYTS; i < 16*64; i++) - for (int i = 0; i < 16*64; i++) + for (int i = 0; i < 128; i++) if (i + (g0*128) >= MSG_VAR_BYTS) msg_[i*8 +: 8] = msg_fixed_int[i*8 +: 8]; for (int i = 0; i < 8; i ++) begin diff --git a/ip_cores/blake2b/src/tb/blake2b_top_tb.sv b/ip_cores/blake2b/src/tb/blake2b_top_tb.sv index 4ddd5df..97a6934 100644 --- a/ip_cores/blake2b/src/tb/blake2b_top_tb.sv +++ b/ip_cores/blake2b/src/tb/blake2b_top_tb.sv @@ -1,5 +1,6 @@ /* - The BLAKE2b testbench. + The BLAKE2b testbench. Uses parameters so can test either the basic Blake2b + or the Blake2b_pipe version. Copyright (C) 2019 Benjamin Devlin and Zcash Foundation @@ -20,7 +21,7 @@ module blake2b_top_tb(); parameter USE_BLAKE2B_PIPE = 0; // This instantiates the pipelined version instead -parameter USE_BLAKE2B_PIPE_MSG_LEN = 140; +parameter USE_BLAKE2B_PIPE_MSG_LEN = 140; // Has to be the maximum of whatever test case parameter MSG_VAR_BYTS = USE_BLAKE2B_PIPE_MSG_LEN; import blake2b_pkg::*; diff --git a/ip_cores/common/src/rtl/common_if.sv b/ip_cores/common/src/rtl/common_if.sv index 7a16a90..fa5d194 100644 --- a/ip_cores/common/src/rtl/common_if.sv +++ b/ip_cores/common/src/rtl/common_if.sv @@ -18,8 +18,8 @@ */ interface if_axi_stream # ( - parameter DAT_BYTS = 128, - parameter CTL_BYTS = 8 + parameter DAT_BYTS = 8, + parameter CTL_BYTS = 1 )( input clk );