From 931758b70cad60760e3063b5c4bfa772b778637a Mon Sep 17 00:00:00 2001 From: Istvan Csomortani Date: Wed, 19 Apr 2017 12:02:31 +0300 Subject: [PATCH] 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) --- library/common/ad_tdd_control.v | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/library/common/ad_tdd_control.v b/library/common/ad_tdd_control.v index 321dad83c..1b07b150a 100644 --- a/library/common/ad_tdd_control.v +++ b/library/common/ad_tdd_control.v @@ -234,14 +234,10 @@ module ad_tdd_control#( // tdd burst counter always @(posedge clk) begin - if (rst == 1'b1) begin - tdd_burst_counter <= tdd_burst_count; + if (tdd_cstate == ON) begin + tdd_burst_counter <= ((tdd_burst_counter > 0) && (tdd_endof_frame == 1'b1)) ? tdd_burst_counter - 1 : tdd_burst_counter; end else 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; - end else begin - tdd_burst_counter <= tdd_burst_count; - end + tdd_burst_counter <= tdd_burst_count; end end