fixed quick div reuse timing bug

This commit is contained in:
Eric Matthews 2019-09-04 09:02:54 -07:00
parent 5f2dfd21db
commit c9015dc180
3 changed files with 5 additions and 5 deletions

View file

@ -112,7 +112,7 @@ module div_quick_clz
always_ff @ (posedge clk) begin
if (firstCycle)
Q <= B_is_zero ? '1 : '0;
else if (~terminate)
else if (~terminate & running)
Q <= new_Q_bit;
end
@ -122,7 +122,7 @@ module div_quick_clz
always @ (posedge clk) begin
if (firstCycle)
R <= A_r;
else if (~terminate)
else if (~terminate & running)
R <= new_R;
end

View file

@ -136,7 +136,7 @@ module div_quick_clz_mk2
always_ff @ (posedge clk) begin
if (firstCycle)
Q <= B_is_zero ? '1 : '0;
else if (~terminate)
else if (~terminate & running)
Q <= Q | new_Q_bit;
end
@ -146,7 +146,7 @@ module div_quick_clz_mk2
always @ (posedge clk) begin
if (firstCycle)
R <= A_r;
else if (~terminate)
else if (~terminate & running)
R <= new_R;
end

View file

@ -110,7 +110,7 @@ module div_quick_naive
Q <= B_is_zero ? '1 : 0;
R <= A;
end
else if (~terminate) begin
else if (~terminate & running) begin
Q <= new_Q_bit;
R <= new_R;
end