Bugfix for arbitrator locking

This commit is contained in:
bsdevlin 2019-07-20 15:37:19 +08:00
parent 9bbc0d9516
commit 77afff4e48
2 changed files with 13 additions and 8 deletions

View File

@ -1,3 +1,4 @@
eclipse.preferences.version=1
encoding//ip_cores/ec/src/rtl/ec_fp12_arithmetic.sv=UTF-8
encoding//ip_cores/ec/src/rtl/ec_fp2_arithmetic.sv=UTF-8
encoding//ip_cores/ec/src/rtl/ec_fp6_arithmetic.sv=UTF-8

View File

@ -112,15 +112,19 @@ always_ff @ (posedge i_clk) begin
locked <= 0;
idx <= 0;
end else begin
if (~locked) begin
idx <= get_next(idx);
if (val[get_next(idx)] && ~(eop[idx] && rdy[idx])) begin
locked <= 1;
end
end else if (eop[idx] && val[idx] && rdy[idx]) begin
idx <= get_next(idx);
locked <= 0;
if (~locked) idx <= get_next(idx);
if (val[idx]) begin
locked <= 1;
idx <= idx;
end
if (eop[idx] && val[idx] && rdy[idx]) begin
locked <= 0;
idx <= get_next(idx);
end
end
end