Commit b6aa848b authored by Zsolt István's avatar Zsolt István
Browse files

bugfix in the dedup write module

parent 8c9d1da4
......@@ -106,22 +106,24 @@ module muu_HT_Read #(
selectInput <= selectInputNext;
selectInputNext <= ~selectInputNext;
if (selectInputNext==1 && input_valid==0 && feedback_valid==1) begin
if (selectInputNext==1 && feedback_valid==1) begin
selectInput <= 0;
selectInputNext <= 1;
end
state <= ST_ISSUE_READ_ONE;
end else if (selectInputNext==1 && input_valid==1) begin
state <= ST_ISSUE_READ_ONE;
end
if (selectInputNext==0 && input_valid==1 && feedback_valid==0) begin
selectInput <= 1;
selectInputNext <= 0;
end
selectInputNext <= 0;
state <= ST_ISSUE_READ_ONE;
if (selectInput==1 && input_valid==1) begin
end else if (selectInputNext==0 && feedback_valid==1) begin
state <= ST_ISSUE_READ_ONE;
end
if (selectInput==0 && feedback_valid==1) begin
state <= ST_ISSUE_READ_ONE;
end
end
......
......@@ -25,7 +25,7 @@ module muu_HT_Write_Dedup #(
parameter META_WIDTH = 96,
parameter DOUBLEHASH_WIDTH = 64,
parameter MEMORY_WIDTH = 512,
parameter FASTFORWARD_BITS = 5,
parameter FASTFORWARD_BITS = 6,
parameter MEM_WRITE_WAIT = 512,
parameter MEMADDR_WIDTH = 21,
parameter IS_SIM = 0,
......@@ -111,10 +111,10 @@ reg [FASTFORWARD_BITS-1:0] ff_cnt;
reg [FASTFORWARD_BITS-1:0] pos_ff;
(* ram_style = "block" *) reg [USER_BITS+KEY_WIDTH+HEADER_WIDTH-1:0] kicked_keys [0:2**FASTFORWARD_BITS];
reg [FASTFORWARD_BITS-1:0] kk_head;
reg [FASTFORWARD_BITS-1:0] kk_tail;
reg [FASTFORWARD_BITS-1:0] kk_cnt;
reg [FASTFORWARD_BITS-1:0] pos_kk;
(* mark_debug = "true" *)reg [FASTFORWARD_BITS-1:0] kk_head;
(* mark_debug = "true" *)reg [FASTFORWARD_BITS-1:0] kk_tail;
(* mark_debug = "true" *)reg [FASTFORWARD_BITS-1:0] kk_cnt;
(* mark_debug = "true" *)reg [FASTFORWARD_BITS-1:0] pos_kk;
reg [1:0] found_ff;
reg [1:0] found_addr_ff;
......@@ -454,7 +454,7 @@ always @(posedge clk) begin
found_kk_pos <= pos_kk-1;
kicked_keys_found_reg <= kicked_keys_pos_reg;
if (op_retry==1 && (opmode==HTOP_SETNEXT || opmode==HTOP_SETCUR) && pos_kk==kk_tail+1) begin
if (op_retry==1 && (opmode==HTOP_SETNEXT || opmode==HTOP_SETCUR) && pos_kk==(kk_tail+1)%2**FASTFORWARD_BITS) begin
oldpointer <= kicked_keys_pos_reg[KEY_WIDTH+31:KEY_WIDTH];
kk_cnt <= kk_cnt-1;
kk_tail <= kk_tail +1;
......
......@@ -1029,7 +1029,7 @@ assign hash_expand_2 = {32'h0,fromhash_data[32+HASHTABLE_MEM_SIZE-1:32]} ^ {32'h
nukv_fifogen #(
.DATA_SIZE(KEY_WIDTH+USER_BITS),
.ADDR_BITS(5)
.ADDR_BITS(6)
) fifo_key_fromwritetohash2 (
.clk(clk),
.rst(rst),
......@@ -1080,7 +1080,7 @@ assign secondhash_expand_2 = {32'h0,secondhash_data[32+HASHTABLE_MEM_SIZE-1:32]}
nukv_fifogen #(
.DATA_SIZE(DOUBLEHASH_WIDTH),
.ADDR_BITS(5)
.ADDR_BITS(6)
) fifo_from_hash2 (
.clk(clk),
.rst(rst),
......@@ -1229,7 +1229,7 @@ nukv_fifogen #(
nukv_fifogen #(
.DATA_SIZE(KEY_WIDTH+EXT_META_WIDTH),
.ADDR_BITS(6)
.ADDR_BITS(7)
) fifo_feedback_delayer (
.clk(clk),
.rst(rst),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment