bug updates for flow control

This commit is contained in:
bsdevlin 2019-04-11 08:55:51 -04:00
parent b75dc693e2
commit 6daeb87ce5
4 changed files with 16 additions and 10 deletions

View File

@ -53,13 +53,13 @@ logic [LEVEL*3-1:0][CTL_BITS-1:0] ctl;
always_comb begin
o_val = val[LEVEL*3-1];
o_ctl = ctl[LEVEL*3-1];
o_rdy = i_rdy;
o_rdy = ~o_val || (o_val && i_rdy);
end
always_ff @ (posedge i_clk) begin
if (i_rst) begin
val <= 0;
end else begin
if(o_rdy) begin
if(~o_val || (o_val && i_rdy)) begin
val <= {val, i_val};
end
end
@ -78,7 +78,7 @@ always_ff @ (posedge i_clk) begin
dat_b <= 0;
sign <= 0;
end else begin
if(o_rdy) begin
if(~o_val || (o_val && i_rdy)) begin
o_dat <= q;
ctl <= {ctl, i_ctl};
a0_ <= a0;

View File

@ -75,7 +75,7 @@ generate
end
endgenerate
always_comb o_rdy = i_rdy;
always_comb o_rdy = ~o_val || (i_rdy && o_val);
always_ff @ (posedge i_clk) begin
if (i_rst) begin

View File

@ -140,7 +140,7 @@ always_ff @ (posedge i_clk) begin
if_cmd_rx.rdy <= 1;
header_l <= header;
cnt <= 0;
bin_inv_out_if.rdy <= 0;
pt_mult1_in_p.z <= 1;
pt_mult1_in_p.x <= secp256k1_pkg::Gx;
pt_mult1_in_p.y <= secp256k1_pkg::Gy;

View File

@ -30,10 +30,10 @@ logic clk_200, rst_200;
localparam CLK200_PERIOD = 5000;
localparam CLK300_PERIOD = 3333;
localparam IF_CLK_PERIOD = 10000;
localparam IF_CLK_PERIOD = 100000;
parameter DAT_BYTS = 8;
parameter IF_DAT_BYTS = 4;
parameter IF_DAT_BYTS = 1;
string my_file_path_s = get_file_dir(`__FILE__);
if_axi_stream #(.DAT_BYTS(IF_DAT_BYTS)) tx_if(clk_if);
@ -76,7 +76,7 @@ end
// Need one for each test so we can multiplex the input
always_comb begin
tx_346_if.rdy = 0;
tx_if.val = 0;
//
if (start_346 && ~done_346) begin
tx_346_if.rdy = tx_if.rdy;
@ -260,12 +260,18 @@ endtask;
// Main testbench calls
initial begin
tx_if.rdy = 0;
rx_if.rdy = 0;
tx_if.val = 0;
#20us; // Let internal memories reset
//test_ignored_message();
//test_block_346_equihash();
test_block_secp256k1();
if (zcash_fpga_pkg::ENB_VERIFY_EQUIHASH == 1)
test_block_346_equihash();
if (zcash_fpga_pkg::ENB_VERIFY_SECP256K1_SIG == 1)
test_block_secp256k1();
#1us $finish();