ad_tdd_control: Optimize the burst_counter logic

The tdd_burst_counter should be in reset if the tdd_cstate
is not ON. (tdd counter is inactive)
main
Istvan Csomortani 2017-04-19 12:02:31 +03:00
parent 8e6dbe1917
commit 931758b70c
1 changed files with 3 additions and 7 deletions

View File

@ -234,14 +234,10 @@ module ad_tdd_control#(
// tdd burst counter // tdd burst counter
always @(posedge clk) begin always @(posedge clk) begin
if (rst == 1'b1) begin if (tdd_cstate == ON) begin
tdd_burst_counter <= tdd_burst_count; tdd_burst_counter <= ((tdd_burst_counter > 0) && (tdd_endof_frame == 1'b1)) ? tdd_burst_counter - 1 : tdd_burst_counter;
end else begin end else begin
if (tdd_cstate == ON) begin tdd_burst_counter <= tdd_burst_count;
tdd_burst_counter <= ((tdd_burst_counter > 0) && (tdd_endof_frame == 1'b1)) ? tdd_burst_counter - 1 : tdd_burst_counter;
end else begin
tdd_burst_counter <= tdd_burst_count;
end
end end
end end