Update blake2b blocks and testbench.
This commit is contained in:
parent
210f6837dc
commit
cb39d92778
|
@ -154,8 +154,8 @@ generate
|
||||||
init_local_work_vector_pipe(PIPE_G0+1, LAST_BLOCK ? byte_len : 128 , LAST_BLOCK);
|
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
|
// Shift message down either from previous pipeline or from fixed portion
|
||||||
|
msg[PIPE_G0+1] <= 0;
|
||||||
for (int i = 0; i < 128; i++) begin
|
for (int i = 0; i < 128; i++) begin
|
||||||
msg[PIPE_G0+1][i*8 +: 8] <= 0;
|
|
||||||
if ((g0+1)*128 + i < MSG_VAR_BYTS)
|
if ((g0+1)*128 + i < MSG_VAR_BYTS)
|
||||||
msg[PIPE_G0+1][i*8 +: 8] <= msg[PIPE_G0][((g0+1)*128 + i)*8 +: 8];
|
msg[PIPE_G0+1][i*8 +: 8] <= msg[PIPE_G0][((g0+1)*128 + i)*8 +: 8];
|
||||||
end
|
end
|
||||||
|
@ -193,7 +193,7 @@ generate
|
||||||
always_comb begin
|
always_comb begin
|
||||||
msg_ = msg[PIPE_G2-1];
|
msg_ = msg[PIPE_G2-1];
|
||||||
//for (int i = MSG_VAR_BYTS; i < 16*64; i++)
|
//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)
|
if (i + (g0*128) >= MSG_VAR_BYTS)
|
||||||
msg_[i*8 +: 8] = msg_fixed_int[i*8 +: 8];
|
msg_[i*8 +: 8] = msg_fixed_int[i*8 +: 8];
|
||||||
for (int i = 0; i < 8; i ++) begin
|
for (int i = 0; i < 8; i ++) begin
|
||||||
|
|
|
@ -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
|
Copyright (C) 2019 Benjamin Devlin and Zcash Foundation
|
||||||
|
|
||||||
|
@ -20,7 +21,7 @@
|
||||||
module blake2b_top_tb();
|
module blake2b_top_tb();
|
||||||
|
|
||||||
parameter USE_BLAKE2B_PIPE = 0; // This instantiates the pipelined version instead
|
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;
|
parameter MSG_VAR_BYTS = USE_BLAKE2B_PIPE_MSG_LEN;
|
||||||
|
|
||||||
import blake2b_pkg::*;
|
import blake2b_pkg::*;
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
interface if_axi_stream # (
|
interface if_axi_stream # (
|
||||||
parameter DAT_BYTS = 128,
|
parameter DAT_BYTS = 8,
|
||||||
parameter CTL_BYTS = 8
|
parameter CTL_BYTS = 1
|
||||||
)(
|
)(
|
||||||
input clk
|
input clk
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue