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,16 +234,12 @@ module ad_tdd_control#(
// tdd burst counter // tdd burst counter
always @(posedge clk) begin always @(posedge clk) begin
if (rst == 1'b1) begin
tdd_burst_counter <= tdd_burst_count;
end else begin
if (tdd_cstate == ON) begin if (tdd_cstate == ON) begin
tdd_burst_counter <= ((tdd_burst_counter > 0) && (tdd_endof_frame == 1'b1)) ? tdd_burst_counter - 1 : tdd_burst_counter; 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
tdd_burst_counter <= tdd_burst_count; tdd_burst_counter <= tdd_burst_count;
end end
end end
end
always @(posedge clk) begin always @(posedge clk) begin
tdd_last_burst <= (tdd_burst_counter == 6'b1) ? 1'b1 : 1'b0; tdd_last_burst <= (tdd_burst_counter == 6'b1) ? 1'b1 : 1'b0;