Updates to top level

This commit is contained in:
bsdevlin 2019-03-12 15:09:53 -04:00
parent 86a8db4df3
commit 2bee4f7513
7 changed files with 201 additions and 100 deletions

Binary file not shown.

View File

@ -22,6 +22,7 @@ module control_top
import zcash_fpga_pkg::*, equihash_pkg::*; import zcash_fpga_pkg::*, equihash_pkg::*;
#( #(
parameter IN_DAT_BYTS, parameter IN_DAT_BYTS,
parameter CORE_DAT_BYTS = 8, // Only tested at 8 byte data width
parameter [63:0] BUILD_HOST = "test", parameter [63:0] BUILD_HOST = "test",
parameter [63:0] BUILD_DATE = "20180311" parameter [63:0] BUILD_DATE = "20180311"
)( )(
@ -39,9 +40,6 @@ module control_top
input i_equihash_mask_val input i_equihash_mask_val
); );
localparam CORE_DAT_BYTS = 8; // Only tested at 8 byte data width
localparam IN_DAT_BITS = IN_DAT_BYTS*8; localparam IN_DAT_BITS = IN_DAT_BYTS*8;
localparam CORE_DAT_BITS = CORE_DAT_BYTS*8; localparam CORE_DAT_BITS = CORE_DAT_BYTS*8;
@ -58,8 +56,7 @@ if_axi_stream #(.DAT_BYTS(CORE_DAT_BYTS), .CTL_BYTS(1)) rx_int1_if (i_clk_core);
if_axi_stream #(.DAT_BYTS(CORE_DAT_BYTS), .CTL_BYTS(1)) rx_typ0_if (i_clk_core); if_axi_stream #(.DAT_BYTS(CORE_DAT_BYTS), .CTL_BYTS(1)) rx_typ0_if (i_clk_core);
if_axi_stream #(.DAT_BYTS(CORE_DAT_BYTS), .CTL_BYTS(1)) rx_typ1_if (i_clk_core); if_axi_stream #(.DAT_BYTS(CORE_DAT_BYTS), .CTL_BYTS(1)) rx_typ1_if (i_clk_core);
if_axi_stream #(.DAT_BYTS(CORE_DAT_BYTS), .CTL_BYTS(1)) tx_typ0_if (i_clk_core); if_axi_stream #(.DAT_BYTS(CORE_DAT_BYTS), .CTL_BYTS(1)) tx_arb_in_if [2] (i_clk_core);
if_axi_stream #(.DAT_BYTS(CORE_DAT_BYTS), .CTL_BYTS(1)) tx_typ1_if (i_clk_core);
if_axi_stream #(.DAT_BYTS(CORE_DAT_BYTS), .CTL_BYTS(1)) tx_int_if (i_clk_core); if_axi_stream #(.DAT_BYTS(CORE_DAT_BYTS), .CTL_BYTS(1)) tx_int_if (i_clk_core);
enum {TYP0_IDLE = 0, enum {TYP0_IDLE = 0,
@ -79,6 +76,7 @@ verify_equihash_rpl_t verify_equihash_rpl;
logic [7:0] typ0_wrd_cnt, typ1_wrd_cnt, reset_cnt; logic [7:0] typ0_wrd_cnt, typ1_wrd_cnt, reset_cnt;
logic [63:0] equihash_index; logic [63:0] equihash_index;
logic equihash_index_val, rx_typ1_if_rdy, verify_equihash_rpl_val; logic equihash_index_val, rx_typ1_if_rdy, verify_equihash_rpl_val;
logic sop_l;
fpga_state_t fpga_state; fpga_state_t fpga_state;
always_comb begin always_comb begin
@ -87,7 +85,7 @@ always_comb begin
fpga_state.typ1_state = TYP1_IDLE; fpga_state.typ1_state = TYP1_IDLE;
header = rx_int_if.dat; header = rx_int_if.dat;
header0 = rx_typ0_if.dat; header0 = rx_typ0_if.dat;
header1 = rx_typ0_if.dat; header1 = rx_typ1_if.dat;
end end
// Logic for processing msg_type == 0 messages // Logic for processing msg_type == 0 messages
@ -96,7 +94,7 @@ always_ff @ (posedge i_clk_core) begin
rx_typ0_if.rdy <= 0; rx_typ0_if.rdy <= 0;
typ0_msg_state <= TYP0_IDLE; typ0_msg_state <= TYP0_IDLE;
header0_l <= 0; header0_l <= 0;
tx_typ0_if.reset_source(); tx_arb_in_if[0].reset_source();
fpga_status_rpl <= 0; fpga_status_rpl <= 0;
fpga_reset_rpl <= 0; fpga_reset_rpl <= 0;
typ0_wrd_cnt <= 0; typ0_wrd_cnt <= 0;
@ -132,16 +130,16 @@ always_ff @ (posedge i_clk_core) begin
end end
TYP0_SEND_STATUS: begin TYP0_SEND_STATUS: begin
rx_typ0_if.rdy <= 0; rx_typ0_if.rdy <= 0;
if (~tx_typ0_if.val || (tx_typ0_if.rdy && tx_typ0_if.val)) begin if (~tx_arb_in_if[0].val || (tx_arb_in_if[0].rdy && tx_arb_in_if[0].val)) begin
tx_typ0_if.dat <= fpga_status_rpl; tx_arb_in_if[0].dat <= fpga_status_rpl;
tx_typ0_if.val <= 1; tx_arb_in_if[0].val <= 1;
tx_typ0_if.sop <= typ0_wrd_cnt == $bits(fpga_status_rpl_t)/8; tx_arb_in_if[0].sop <= typ0_wrd_cnt == $bits(fpga_status_rpl_t)/8;
tx_typ0_if.eop <= typ0_wrd_cnt <= CORE_DAT_BYTS; tx_arb_in_if[0].eop <= typ0_wrd_cnt <= CORE_DAT_BYTS;
tx_typ0_if.mod <= typ0_wrd_cnt < CORE_DAT_BYTS ? typ0_wrd_cnt : 0; tx_arb_in_if[0].mod <= typ0_wrd_cnt < CORE_DAT_BYTS ? typ0_wrd_cnt : 0;
typ0_wrd_cnt <= (typ0_wrd_cnt > CORE_DAT_BYTS) ? (typ0_wrd_cnt - CORE_DAT_BYTS) : 0; typ0_wrd_cnt <= (typ0_wrd_cnt > CORE_DAT_BYTS) ? (typ0_wrd_cnt - CORE_DAT_BYTS) : 0;
fpga_status_rpl <= fpga_status_rpl >> CORE_DAT_BITS; fpga_status_rpl <= fpga_status_rpl >> CORE_DAT_BITS;
if (typ0_wrd_cnt == 0) begin if (typ0_wrd_cnt == 0) begin
tx_typ0_if.val <= 0; tx_arb_in_if[0].val <= 0;
typ0_msg_state <= TYP0_IDLE; typ0_msg_state <= TYP0_IDLE;
end end
end end
@ -154,16 +152,16 @@ always_ff @ (posedge i_clk_core) begin
reset_cnt <= reset_cnt - 1; reset_cnt <= reset_cnt - 1;
if (~o_usr_rst) begin if (~o_usr_rst) begin
if (~tx_typ0_if.val || (tx_typ0_if.rdy && tx_typ0_if.val)) begin if (~tx_arb_in_if[0].val || (tx_arb_in_if[0].rdy && tx_arb_in_if[0].val)) begin
tx_typ0_if.dat <= fpga_reset_rpl; tx_arb_in_if[0].dat <= fpga_reset_rpl;
tx_typ0_if.val <= 1; tx_arb_in_if[0].val <= 1;
tx_typ0_if.sop <= typ0_wrd_cnt == $bits(fpga_reset_rpl_t)/8; tx_arb_in_if[0].sop <= typ0_wrd_cnt == $bits(fpga_reset_rpl_t)/8;
tx_typ0_if.eop <= typ0_wrd_cnt <= CORE_DAT_BYTS; tx_arb_in_if[0].eop <= typ0_wrd_cnt <= CORE_DAT_BYTS;
tx_typ0_if.mod <= typ0_wrd_cnt < CORE_DAT_BYTS ? typ0_wrd_cnt : 0; tx_arb_in_if[0].mod <= typ0_wrd_cnt < CORE_DAT_BYTS ? typ0_wrd_cnt : 0;
typ0_wrd_cnt <= (typ0_wrd_cnt > CORE_DAT_BYTS) ? (typ0_wrd_cnt - CORE_DAT_BYTS) : 0; typ0_wrd_cnt <= (typ0_wrd_cnt > CORE_DAT_BYTS) ? (typ0_wrd_cnt - CORE_DAT_BYTS) : 0;
fpga_reset_rpl <= fpga_reset_rpl >> CORE_DAT_BITS; fpga_reset_rpl <= fpga_reset_rpl >> CORE_DAT_BITS;
if (typ0_wrd_cnt == 0) begin if (typ0_wrd_cnt == 0) begin
tx_typ0_if.val <= 0; tx_arb_in_if[0].val <= 0;
typ0_msg_state <= TYP0_IDLE; typ0_msg_state <= TYP0_IDLE;
end end
end end
@ -192,18 +190,22 @@ always_ff @ (posedge i_clk_core) begin
rx_typ1_if_rdy <= 0; rx_typ1_if_rdy <= 0;
typ1_msg_state <= TYP1_IDLE; typ1_msg_state <= TYP1_IDLE;
header1_l <= 0; header1_l <= 0;
tx_typ1_if.reset_source(); tx_arb_in_if[1].reset_source();
o_equihash_axi.reset_source(); o_equihash_axi.reset_source();
verify_equihash_rpl <= 0; verify_equihash_rpl <= 0;
typ1_wrd_cnt <= 0; typ1_wrd_cnt <= 0;
equihash_index <= 0; equihash_index <= 0;
verify_equihash_rpl_val <= 0; verify_equihash_rpl_val <= 0;
equihash_index_val <= 0;
sop_l <= 0;
end else begin end else begin
rx_typ1_if.rdy <= 1; rx_typ1_if.rdy <= 1;
case (typ1_msg_state) case (typ1_msg_state)
TYP1_IDLE: begin TYP1_IDLE: begin
verify_equihash_rpl_val <= 0; verify_equihash_rpl_val <= 0;
equihash_index_val <= 0;
sop_l <= 0;
if (rx_typ1_if.val && rx_typ1_if.rdy) begin if (rx_typ1_if.val && rx_typ1_if.rdy) begin
header1_l <= header1; header1_l <= header1;
rx_typ1_if_rdy <= 0; rx_typ1_if_rdy <= 0;
@ -224,33 +226,41 @@ always_ff @ (posedge i_clk_core) begin
rx_typ1_if_rdy <= 0; rx_typ1_if_rdy <= 0;
if (~equihash_index_val) begin if (~equihash_index_val) begin
if (rx_typ1_if.rdy && rx_typ1_if.val) if (rx_typ1_if.rdy && rx_typ1_if.val) begin
equihash_index <= equihash_index_val; equihash_index <= rx_typ1_if.dat;
equihash_index_val <= 1;
end
end else begin end else begin
// First load block data (this might be bypassed if loading from memory) // First load block data (this might be bypassed if loading from memory)
if (~o_equihash_axi.val || (o_equihash_axi.rdy && o_equihash_axi.val)) begin if (~o_equihash_axi.val || (o_equihash_axi.rdy && o_equihash_axi.val)) begin
o_equihash_axi.copy_if(rx_typ1_if.to_struct()); o_equihash_axi.copy_if(rx_typ1_if.to_struct());
// First cycle has .sop set
o_equihash_axi.sop <= ~sop_l;
if (o_equihash_axi.val) begin
sop_l <= 1;
o_equihash_axi.sop <= 0;
end
end end
end end
// Wait for reply with result // Wait for reply with result
if (i_equihash_mask_val) begin if (i_equihash_mask_val && ~verify_equihash_rpl_val) begin
verify_equihash_rpl <= get_verify_equihash_rpl(i_equihash_mask, equihash_index); verify_equihash_rpl <= get_verify_equihash_rpl(i_equihash_mask, equihash_index);
verify_equihash_rpl_val <= 1; verify_equihash_rpl_val <= 1;
end end
// Send result // Send result
if (verify_equihash_rpl_val) begin if (verify_equihash_rpl_val) begin
if (~tx_typ1_if.val || (tx_typ1_if.rdy && tx_typ1_if.val)) begin if (~tx_arb_in_if[1].val || (tx_arb_in_if[1].rdy && tx_arb_in_if[1].val)) begin
tx_typ1_if.dat <= verify_equihash_rpl; tx_arb_in_if[1].dat <= verify_equihash_rpl;
tx_typ1_if.val <= 1; tx_arb_in_if[1].val <= 1;
tx_typ1_if.sop <= typ1_wrd_cnt == $bits(verify_equihash_rpl_t)/8; tx_arb_in_if[1].sop <= typ1_wrd_cnt == $bits(verify_equihash_rpl_t)/8;
tx_typ1_if.eop <= typ1_wrd_cnt <= CORE_DAT_BYTS; tx_arb_in_if[1].eop <= typ1_wrd_cnt <= CORE_DAT_BYTS;
tx_typ1_if.mod <= typ1_wrd_cnt < CORE_DAT_BYTS ? typ1_wrd_cnt : 0; tx_arb_in_if[1].mod <= typ1_wrd_cnt < CORE_DAT_BYTS ? typ1_wrd_cnt : 0;
typ1_wrd_cnt <= (typ1_wrd_cnt > CORE_DAT_BYTS) ? (typ1_wrd_cnt - CORE_DAT_BYTS) : 0; typ1_wrd_cnt <= (typ1_wrd_cnt > CORE_DAT_BYTS) ? (typ1_wrd_cnt - CORE_DAT_BYTS) : 0;
verify_equihash_rpl <= verify_equihash_rpl >> CORE_DAT_BITS; verify_equihash_rpl <= verify_equihash_rpl >> CORE_DAT_BITS;
if (typ1_wrd_cnt == 0) begin if (typ1_wrd_cnt == 0) begin
tx_typ1_if.val <= 0; tx_arb_in_if[1].val <= 0;
typ1_msg_state <= TYP1_IDLE; typ1_msg_state <= TYP1_IDLE;
end end
end end
@ -268,14 +278,14 @@ end
// Logic to mux the packet depending on its command type // Logic to mux the packet depending on its command type
logic msg_type, msg_type_l; logic msg_type, msg_type_l;
always_comb begin always_comb begin
rx_int0_if.copy_if(rx_int_if.to_struct()); rx_int0_if.copy_if_comb(rx_int_if.to_struct());
rx_int1_if.copy_if(rx_int_if.to_struct()); rx_int1_if.copy_if_comb(rx_int_if.to_struct());
rx_int0_if.val = 0; rx_int0_if.val = 0;
rx_int1_if.val = 0; rx_int1_if.val = 0;
rx_int_if.rdy = 0; rx_int_if.rdy = 0;
if (rx_int_if.sop && rx_int_if.val && rx_int_if.rdy) begin if (rx_int_if.sop && rx_int_if.val) begin
if(header.cmd[8 +: 8] == 8'd0) begin if(header.cmd[8 +: 8] == 8'd0) begin
msg_type = 0; msg_type = 0;
rx_int0_if.val = rx_int_if.val; rx_int0_if.val = rx_int_if.val;
@ -288,7 +298,7 @@ always_comb begin
end else begin end else begin
rx_int0_if.val = rx_int_if.val && (msg_type_l == 0); rx_int0_if.val = rx_int_if.val && (msg_type_l == 0);
rx_int1_if.val = rx_int_if.val && (msg_type_l == 1); rx_int1_if.val = rx_int_if.val && (msg_type_l == 1);
rx_int_if.rdy = msg_type_l == 0 ? rx_int0_if.rdy : rx_int1_if.rdy; rx_int_if.rdy = (msg_type_l == 0) ? rx_int0_if.rdy : rx_int1_if.rdy;
msg_type = msg_type_l; msg_type = msg_type_l;
end end
end end
@ -352,7 +362,7 @@ packet_arb_tx (
.i_clk ( i_clk_core ), .i_clk ( i_clk_core ),
.i_rst ( i_rst_core || o_usr_rst ), .i_rst ( i_rst_core || o_usr_rst ),
.i_axi ({tx_typ1_if, tx_typ0_if}), .i_axi ( tx_arb_in_if ),
.o_axi ( tx_int_if ) .o_axi ( tx_int_if )
); );

View File

@ -52,9 +52,9 @@ logic [N-1:0] sol_hash_xor, equihash_sol_string, equihash_sol
logic [$clog2(SOL_LIST_LEN)-1:0] sol_cnt_out, sol_cnt_in; // This tracks how many solutions we have XORed logic [$clog2(SOL_LIST_LEN)-1:0] sol_cnt_out, sol_cnt_in; // This tracks how many solutions we have XORed
logic [$clog2(2*DAT_BITS)-1:0] sol_pos; // This tracks the pos in our DAT_BITS RAM output logic [$clog2(2*DAT_BITS)-1:0] sol_pos; // This tracks the pos in our DAT_BITS RAM output
logic [64*8-1:0] parameters; logic [64*8-1:0] parameters;
//TODO tmep
if_axi_stream #(.DAT_BYTS(BLAKE2B_DIGEST_BYTS), .CTL_BYTS($clog2(INDICIES_PER_HASH))) blake2b_out_hash(i_clk); if_axi_stream #(.DAT_BYTS(BLAKE2B_DIGEST_BYTS), .CTL_BYTS(4)) blake2b_out_hash(i_clk);
if_axi_stream #(.DAT_BYTS(EQUIHASH_GEN_BYTS), .CTL_BYTS($clog2(INDICIES_PER_HASH))) blake2b_in_hash(i_clk); if_axi_stream #(.DAT_BYTS(EQUIHASH_GEN_BYTS), .CTL_BYTS(4)) blake2b_in_hash(i_clk);
if_axi_stream #(.DAT_BYTS(DAT_BYTS)) difficulty_if_in(i_clk); if_axi_stream #(.DAT_BYTS(DAT_BYTS)) difficulty_if_in(i_clk);
@ -106,7 +106,7 @@ always_ff @ (posedge i_clk) begin
ram_wr_state <= STATE_WR_IDLE; ram_wr_state <= STATE_WR_IDLE;
end else begin end else begin
// Defaults // Defaults
equihash_sol_bram_if_a.we <= 1; equihash_sol_bram_if_a.we <= i_axi.val;
equihash_sol_bram_if_a.en <= 1; equihash_sol_bram_if_a.en <= 1;
equihash_sol_bram_if_a.d <= i_axi.dat; equihash_sol_bram_if_a.d <= i_axi.dat;
@ -178,8 +178,12 @@ always_ff @ (posedge i_clk) begin
equihash_order_if.val <= 0; equihash_order_if.val <= 0;
equihash_sol_bram_read <= equihash_sol_bram_read << 1; equihash_sol_bram_read <= equihash_sol_bram_read << 1;
if (equihash_sol_bram_read[0]) if (equihash_sol_bram_read[0]) begin
equihash_sol_bram_if_b_l <= equihash_sol_bram_if_b.q; equihash_sol_bram_if_b_l <= equihash_sol_bram_if_b.q;
// If nothign else changes sol_pos, we need to shfit it here too
//if ((equihash_sol_bram_if_a.a*DAT_BYTS) < ((equihash_sol_bram_if_b.a+1)*DAT_BYTS + $bits(cblockheader_t)/DAT_BITS))
sol_pos <= sol_pos - DAT_BITS;
end
case(ram_rd_state) case(ram_rd_state)
STATE_RD_IDLE: begin STATE_RD_IDLE: begin
@ -211,10 +215,10 @@ always_ff @ (posedge i_clk) begin
equihash_gen_in.nonce <= cblockheader.nonce; equihash_gen_in.nonce <= cblockheader.nonce;
equihash_gen_in.index <= (equihash_sol_index)/INDICIES_PER_HASH; equihash_gen_in.index <= (equihash_sol_index)/INDICIES_PER_HASH;
blake2b_in_hash.ctl <= (equihash_sol_index) % INDICIES_PER_HASH; blake2b_in_hash.ctl <= (equihash_sol_index) % INDICIES_PER_HASH;
blake2b_in_hash.ctl[8 +: 24] <= equihash_sol_index;
// Stay 2 clocks behind the RAM write // Stay 2 clocks behind the RAM write
if ((equihash_sol_bram_if_a.a*DAT_BYTS + DAT_BYTS) >= (equihash_sol_bram_if_b.a + $bits(cblockheader_t)/DAT_BITS) || if ((equihash_sol_bram_if_a.a*DAT_BYTS) >= ((equihash_sol_bram_if_b.a+1)*DAT_BYTS + $bits(cblockheader_t)/DAT_BITS) ||
ram_wr_state == STATE_WR_WAIT) begin ram_wr_state == STATE_WR_WAIT) begin
// Check if we need to load next memory address // Check if we need to load next memory address
if ((sol_pos + 3*SOL_BITS >= 2*DAT_BITS) && ~|equihash_sol_bram_read) begin if ((sol_pos + 3*SOL_BITS >= 2*DAT_BITS) && ~|equihash_sol_bram_read) begin
@ -237,10 +241,17 @@ always_ff @ (posedge i_clk) begin
equihash_order_if.eop <= (sol_cnt_in == SOL_LIST_LEN - 1); equihash_order_if.eop <= (sol_cnt_in == SOL_LIST_LEN - 1);
// If our input is about to shift we need to adjust pointer by DAT_BITS // If our input is about to shift we need to adjust pointer by DAT_BITS
sol_pos <= sol_pos + SOL_BITS - (equihash_sol_bram_read[0] ? DAT_BITS : 0); //sol_pos <= sol_pos + SOL_BITS - (equihash_sol_bram_read[0] ? DAT_BITS : 0);
if (sol_cnt_in == SOL_LIST_LEN - 1)
sol_pos <= sol_pos + SOL_BITS - (sol_pos + 2*SOL_BITS >= 2*DAT_BITS ? DAT_BITS : 0);
if (sol_cnt_in == SOL_LIST_LEN - 1) begin
ram_rd_state <= STATE_RD_WAIT; ram_rd_state <= STATE_RD_WAIT;
end end
end else begin
// Hold some values steady
// equihash_sol_bram_read <= equihash_sol_bram_read;
end
end end
STATE_RD_WAIT: begin STATE_RD_WAIT: begin
if (chk_state == STATE_CHK_DONE) begin if (chk_state == STATE_CHK_DONE) begin
@ -314,13 +325,16 @@ always_ff @ (posedge i_clk) begin
// We also check the order is correct // We also check the order is correct
o_mask.BAD_ZERO_ORDER <= bad_order_check(sol_hash_xor, sol_cnt_out) | o_mask.BAD_ZERO_ORDER; o_mask.BAD_ZERO_ORDER <= bad_order_check(sol_hash_xor, sol_cnt_out) | o_mask.BAD_ZERO_ORDER;
end
if (sol_cnt_out == SOL_LIST_LEN - 1) begin if (sol_cnt_out == SOL_LIST_LEN - 1) begin
chk_state <= STATE_CHK_WAIT; chk_state <= STATE_CHK_WAIT;
end end
end end
end
STATE_CHK_WAIT: begin STATE_CHK_WAIT: begin
o_mask.XOR_NON_ZERO <= |sol_hash_xor; o_mask.XOR_NON_ZERO <= |sol_hash_xor;
xor_check_done <= 1; xor_check_done <= 1;
@ -352,7 +366,7 @@ always_comb begin
// We have to select what part of Blake2b output to sleect // We have to select what part of Blake2b output to sleect
// and then re-order the bytes so the XOR zeros grow from the left // and then re-order the bytes so the XOR zeros grow from the left
equihash_sol_string = blake2b_out_hash.dat[N*blake2b_out_hash.ctl +: N]; equihash_sol_string = blake2b_out_hash.dat[N*blake2b_out_hash.ctl[0] +: N];
for (int i = 0; i < N/8; i++) for (int i = 0; i < N/8; i++)
equihash_sol_string_flip[i*8 +: 8] = equihash_sol_string[N - 8 -i*8 +: 8]; equihash_sol_string_flip[i*8 +: 8] = equihash_sol_string[N - 8 -i*8 +: 8];
@ -415,7 +429,7 @@ localparam [EQUIHASH_GEN_BYTS*8-1:0] EQUIHASH_GEN_BYTS_BM = {
blake2b_pipe_top #( blake2b_pipe_top #(
.MSG_LEN ( EQUIHASH_GEN_BYTS ), .MSG_LEN ( EQUIHASH_GEN_BYTS ),
.MSG_VAR_BM ( EQUIHASH_GEN_BYTS_BM ), .MSG_VAR_BM ( EQUIHASH_GEN_BYTS_BM ),
.CTL_BITS ( $clog2(INDICIES_PER_HASH) ) .CTL_BITS ( 32 )
) )
blake2b_pipe_top_i ( blake2b_pipe_top_i (
.i_clk ( i_clk ), .i_clk ( i_clk ),

View File

@ -21,41 +21,66 @@
*/ */
module zcash_fpga_top module zcash_fpga_top
import zcash_verif_pkg::*; import zcash_fpga_pkg::*, equihash_pkg::*;
#( #(
parameter DAT_BYTS = 8 parameter IF_DAT_BYTS = 2,
parameter CORE_DAT_BYTS = 8 // Only tested at 8 byte data width
)( )(
// Clocks and resets // Clocks and resets
input i_clk_200, i_rst_200,
input i_clk_300, i_rst_300,
input i_clk_if, i_rst_if,
input i_clk_100, i_rst_100, // Interface input and output
// Interface inputs and outputs
// UART // UART
if_axi_stream.sink uart_if_rx, if_axi_stream.sink rx_if,
if_axi_stream.source uart_if_tx, if_axi_stream.source tx_if
// Ethernet
if_axi_stream.sink eth_if_rx,
if_axi_stream.source eth_if_tx,
// PCIe
if_axi_stream.sink pcie_if_rx,
if_axi_stream.source pcie_if_tx
); );
logic usr_rst, core_clk, core_rst;
if_axi_stream #(.DAT_BYTS(CORE_DAT_BYTS)) equihash_axi(core_clk);
equihash_bm_t equihash_mask;
logic equihash_mask_val;
always_comb begin
core_clk = i_clk_200;
core_rst = i_rst_200;
end
// This block takes in the interface signals and interfaces with other blocks
control_top #(
.CORE_DAT_BYTS ( CORE_DAT_BYTS ),
.IN_DAT_BYTS ( IF_DAT_BYTS )
)
control_top (
.i_clk_core ( core_clk ),
.i_rst_core ( core_rst ),
.i_clk_if ( i_clk_if ),
.i_rst_if ( i_rst_if ),
.o_usr_rst ( usr_rst ),
.rx_if ( rx_if ),
.tx_if ( tx_if ),
.o_equihash_axi ( equihash_axi ),
.i_equihash_mask ( equihash_mask ),
.i_equihash_mask_val ( equihash_mask_val )
);
// This block is used to verify a equihash solution // This block is used to verify a equihash solution
zcash_verif_equihash #( equihash_verif_top #(
.DAT_BYTS(DAT_BYTS) .DAT_BYTS( CORE_DAT_BYTS )
) )
equihash_verif_top ( equihash_verif_top (
.i_clk ( i_clk ), .i_clk ( core_clk ),
.i_rst ( i_rst ), .i_rst ( core_rst || usr_rst ),
.i_clk_300 ( i_clk_300 ), .i_clk_300 ( i_clk_300 ),
.i_rst_300 ( i_rst_300 ), // Faster clock .i_rst_300 ( i_rst_300 || usr_rst ), // Faster clock
.i_axi ( equihash_verif_if ), .i_axi ( equihash_axi ),
.o_mask ( equihash_verif_mask ), .o_mask ( equihash_mask ),
.o_mask_val ( equihash_verif_mask_val ) .o_mask_val ( equihash_mask_val )
); );
endmodule endmodule

View File

@ -140,8 +140,8 @@ task test_eh_verify_message();
begin begin
verify_equihash_t msg; verify_equihash_t msg;
verify_equihash_rpl_t verify_equihash_rpl; verify_equihash_rpl_t verify_equihash_rpl;
integer signed get_len, in_len; integer signed get_len, in_len, eh_len;
logic [common_pkg::MAX_SIM_BYTS*8-1:0] get_dat; logic [common_pkg::MAX_SIM_BYTS*8-1:0] get_dat, get_dat_eh;
logic fail = 0; logic fail = 0;
$display("Running test_eh_verify_message..."); $display("Running test_eh_verify_message...");
msg.hdr.cmd = VERIFY_EQUIHASH; msg.hdr.cmd = VERIFY_EQUIHASH;
@ -150,17 +150,23 @@ begin
fork fork
uart_tx_if.put_stream(msg, $bits(msg)/8); uart_tx_if.put_stream(msg, $bits(msg)/8);
uart_rx_if.get_stream(get_dat, get_len);
begin begin
while (!usr_rst) @(posedge core_clk); equihash_axi.get_stream(get_dat_eh, eh_len);
while (usr_rst) @(posedge core_clk); equihash_mask_val = 1;
equihash_mask = 0;
end end
uart_rx_if.get_stream(get_dat, get_len);
join join
equihash_mask_val = 0;
verify_equihash_rpl = get_dat; verify_equihash_rpl = get_dat;
fail |= eh_len != $bits(cblockheader_sol_t)/8;
fail |= verify_equihash_rpl.hdr.cmd != VERIFY_EQUIHASH_RPL; fail |= verify_equihash_rpl.hdr.cmd != VERIFY_EQUIHASH_RPL;
fail |= verify_equihash_rpl.hdr.len != $bits(fpga_status_rpl_t)/8; fail |= verify_equihash_rpl.hdr.len != $bits(verify_equihash_rpl_t)/8;
fail |= verify_equihash_rpl.index != 1; fail |= verify_equihash_rpl.index != 1;
fail |= verify_equihash_rpl.bm != 0;
assert (~fail) else $fatal(1, "%m %t ERROR: test_eh_verify_message was wrong:\n%p", $time, verify_equihash_rpl); assert (~fail) else $fatal(1, "%m %t ERROR: test_eh_verify_message was wrong:\n%p", $time, verify_equihash_rpl);
@ -170,7 +176,7 @@ endtask
// Main testbench calls // Main testbench calls
initial begin initial begin
equihash_axi.rdy = 1; equihash_axi.rdy = 0;
equihash_mask_val = 0; equihash_mask_val = 0;
equihash_mask = 0; equihash_mask = 0;
uart_tx_if.val = 0; uart_tx_if.val = 0;
@ -180,8 +186,9 @@ initial begin
test_reset_message(); test_reset_message();
test_status_message(); test_status_message();
test_eh_verify_message(); test_eh_verify_message();
test_status_message();
#10us $finish(); #1us $finish();
end end

View File

@ -136,7 +136,7 @@ begin
while(!done_346 || !mask_val) @(posedge clk); while(!done_346 || !mask_val) @(posedge clk);
assert (~(|mask)) else $fatal(1, "%m %t ERROR: test_block_346 mask was non-zero:\n%p", $time, mask); assert (|mask == 0) else $fatal(1, "%m %t ERROR: test_block_346 mask was non-zero:\n%p", $time, mask);
$display("test_block_346 PASSED"); $display("test_block_346 PASSED");
end end
@ -145,12 +145,20 @@ endtask
// This is a tests the sample block 346 in the block chain but with deliberate errors // This is a tests the sample block 346 in the block chain but with deliberate errors
task test_block_346_error(); task test_block_346_error();
begin begin
logic fail = 1;
$display("Running test_block_346_error..."); $display("Running test_block_346_error...");
start_346_error = 1; start_346_error = 1;
while(!done_346_error || !mask_val) @(posedge clk); while(!done_346_error || !mask_val) @(posedge clk);
assert (&mask) else $fatal(1, "%m %t ERROR: test_block_346_error mask was zero but should of failed:\n%p", $time, mask); fail &= mask.DUPLICATE_FND;
fail &= mask.BAD_ZERO_ORDER;
fail &= mask.BAD_IDX_ORDER;
fail &= mask.XOR_NON_ZERO;
fail &= mask.DIFFICULTY_FAIL;
assert (fail) else $fatal(1, "%m %t ERROR: test_block_346_error mask was zero but should of failed:\n%p", $time, mask);
$display("test_block_346_error PASSED"); $display("test_block_346_error PASSED");
end end

View File

@ -1,15 +1,52 @@
create_clock -period 5.000 -name i_clk -waveform {0.000 2.500} [get_ports -filter { NAME =~ "*i_clk*" && DIRECTION == "IN" }] create_clock -period 5.000 -name i_clk_200 -waveform {0.000 2.500} [get_ports -filter { NAME =~ "*i_clk_200*" && DIRECTION == "IN" }]
create_clock -period 2.500 -name i_clk_300 -waveform {0.000 1.250} [get_ports -filter { NAME =~ "i_clk_300" && DIRECTION == "IN" }] create_clock -period 3.333 -name i_clk_300 -waveform {0.000 1.666} [get_ports -filter { NAME =~ "i_clk_300" && DIRECTION == "IN" }]
create_clock -period 10.000 -name i_clk_if -waveform {0.000 5.000} [get_ports -filter { NAME =~ "i_clk_if" && DIRECTION == "IN" }]
set_bus_skew -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_in/synchronizer_wr_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_in/synchronizer_wr_ptr/* }]] 1.667 set_bus_skew -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_wr_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_wr_ptr/* }]] 2.500
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_in/synchronizer_wr_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_in/synchronizer_wr_ptr/* }]] 1.667 set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_wr_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_wr_ptr/* }]] 2.500
set_bus_skew -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_in/synchronizer_rd_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_in/synchronizer_rd_ptr/* }]] 2.500 set_bus_skew -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_rd_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_rd_ptr/* }]] 5.000
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_in/synchronizer_rd_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_in/synchronizer_rd_ptr/* }]] 2.500 set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_rd_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_rd_ptr/* }]] 5.000
set_bus_skew -from [get_pins -filter { NAME =~ "*ram*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_in/* }]] -to [get_pins -filter { NAME =~ "*o_dat_b*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_in/* }]] 2.500 set_bus_skew -from [get_pins -filter { NAME =~ "*ram*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/* }]] -to [get_pins -filter { NAME =~ "*o_dat_b*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/* }]] 5.000
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*ram*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_in/* }]] -to [get_pins -filter { NAME =~ "*o_dat_b*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_in/* }]] 2.500 set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*ram*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/* }]] -to [get_pins -filter { NAME =~ "*o_dat_b*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/* }]] 5.000
set_bus_skew -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_out/synchronizer_wr_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_out/synchronizer_wr_ptr/* }]] 2.500 set_bus_skew -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/synchronizer_wr_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/synchronizer_wr_ptr/* }]] 2.500
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_out/synchronizer_wr_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_out/synchronizer_wr_ptr/* }]] 2.500 set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/synchronizer_wr_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/synchronizer_wr_ptr/* }]] 2.500
set_bus_skew -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_out/synchronizer_rd_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_out/synchronizer_rd_ptr/* }]] 1.667 set_bus_skew -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/synchronizer_rd_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/synchronizer_rd_ptr/* }]] 1.667
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_out/synchronizer_rd_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_out/synchronizer_rd_ptr/* }]] 1.667 set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/synchronizer_rd_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/synchronizer_rd_ptr/* }]] 1.667
set_bus_skew -from [get_pins -filter { NAME =~ "*ram*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_out/* }]] -to [get_pins -filter { NAME =~ "*o_dat_b*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_out/* }]] 1.667 set_bus_skew -from [get_pins -filter { NAME =~ "*ram*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/* }]] -to [get_pins -filter { NAME =~ "*o_dat_b*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/* }]] 1.667
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*ram*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_out/* }]] -to [get_pins -filter { NAME =~ "*o_dat_b*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ dup_check_fifo_out/* }]] 1.667 set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*ram*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/* }]] -to [get_pins -filter { NAME =~ "*o_dat_b*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/* }]] 1.667
set_bus_skew -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/synchronizer_wr_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/synchronizer_wr_ptr/* }]] 1.667
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/synchronizer_wr_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/synchronizer_wr_ptr/* }]] 1.667
set_bus_skew -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/synchronizer_rd_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/synchronizer_rd_ptr/* }]] 2.500
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/synchronizer_rd_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/synchronizer_rd_ptr/* }]] 2.500
set_bus_skew -from [get_pins -filter { NAME =~ "*ram*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/* }]] -to [get_pins -filter { NAME =~ "*o_dat_b*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/* }]] 2.500
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*ram*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/* }]] -to [get_pins -filter { NAME =~ "*o_dat_b*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/* }]] 2.500
set_bus_skew -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_wr_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_wr_ptr/* }]] 2.500
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_wr_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_wr_ptr/* }]] 2.500
set_bus_skew -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_rd_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_rd_ptr/* }]] 5.000
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_rd_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_rd_ptr/* }]] 5.000
set_bus_skew -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_wr_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_wr_ptr/* }]] 2.500
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_wr_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_wr_ptr/* }]] 2.500
set_bus_skew -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_rd_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_rd_ptr/* }]] 5.000
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_rd_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_rd_ptr/* }]] 5.000
set_bus_skew -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_wr_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_wr_ptr/* }]] 2.500
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_wr_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_wr_ptr/* }]] 2.500
set_bus_skew -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_rd_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_rd_ptr/* }]] 5.000
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_rd_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_rx/cdc_fifo/synchronizer_rd_ptr/* }]] 5.000
set_bus_skew -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_tx/cdc_fifo/synchronizer_wr_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_tx/cdc_fifo/synchronizer_wr_ptr/* }]] 5.000
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_tx/cdc_fifo/synchronizer_wr_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_tx/cdc_fifo/synchronizer_wr_ptr/* }]] 5.000
set_bus_skew -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_tx/cdc_fifo/synchronizer_rd_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_tx/cdc_fifo/synchronizer_rd_ptr/* }]] 2.500
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_tx/cdc_fifo/synchronizer_rd_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ control_top/cdc_fifo_tx/cdc_fifo/synchronizer_rd_ptr/* }]] 2.500
set_bus_skew -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/synchronizer_wr_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/synchronizer_wr_ptr/* }]] 1.667
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/synchronizer_wr_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/synchronizer_wr_ptr/* }]] 1.667
set_bus_skew -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/synchronizer_rd_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/synchronizer_rd_ptr/* }]] 2.500
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/synchronizer_rd_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/synchronizer_rd_ptr/* }]] 2.500
set_bus_skew -from [get_pins -filter { NAME =~ "*ram*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/* }]] -to [get_pins -filter { NAME =~ "*o_dat_b*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/* }]] 2.500
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*ram*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/* }]] -to [get_pins -filter { NAME =~ "*o_dat_b*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_in/* }]] 2.500
set_bus_skew -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/synchronizer_wr_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/synchronizer_wr_ptr/* }]] 2.500
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/synchronizer_wr_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/synchronizer_wr_ptr/* }]] 2.500
set_bus_skew -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/synchronizer_rd_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/synchronizer_rd_ptr/* }]] 1.667
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*dat_reg[0]*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/synchronizer_rd_ptr/* }]] -to [get_pins -filter { NAME =~ "*dat_reg[1]*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/synchronizer_rd_ptr/* }]] 1.667
set_bus_skew -from [get_pins -filter { NAME =~ "*ram*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/* }]] -to [get_pins -filter { NAME =~ "*o_dat_b*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/* }]] 1.667
set_max_delay -datapath_only -from [get_pins -filter { NAME =~ "*ram*C" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/* }]] -to [get_pins -filter { NAME =~ "*o_dat_b*D" } -of_objects [get_cells -hierarchical -filter {NAME =~ equihash_verif_top/dup_check_fifo_out/* }]] 1.667
set_multicycle_path -hold -from [get_pins control_top/o_usr_rst_reg/C] 5
set_multicycle_path -setup -from [get_pins control_top/o_usr_rst_reg/C] 5