diff options
| author | Matt Ettus <matt@ettus.com> | 2009-09-24 12:33:22 -0700 |
|---|---|---|
| committer | Matt Ettus <matt@ettus.com> | 2009-09-24 12:33:22 -0700 |
| commit | 618ebd292a5b0acf221ef2d4ccf1a19596bc6c86 (patch) | |
| tree | 2cfa09094702487ab8ad365c940883821dbd5ff4 /sdr_lib/small_hb_dec.v | |
| parent | aa37ca0b3b716e23e51f04b6f199ecacf89fe479 (diff) | |
| download | uhd-618ebd292a5b0acf221ef2d4ccf1a19596bc6c86.tar.gz uhd-618ebd292a5b0acf221ef2d4ccf1a19596bc6c86.tar.bz2 uhd-618ebd292a5b0acf221ef2d4ccf1a19596bc6c86.zip | |
Synchronize the internal phase of the halfband filters to the start of the "run" signal. This is important for MIMO. Bug reported by Christoph Hein and Hanwen .
Diffstat (limited to 'sdr_lib/small_hb_dec.v')
| -rw-r--r-- | sdr_lib/small_hb_dec.v | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/sdr_lib/small_hb_dec.v b/sdr_lib/small_hb_dec.v index 9957de15a..8519b628a 100644 --- a/sdr_lib/small_hb_dec.v +++ b/sdr_lib/small_hb_dec.v @@ -8,6 +8,7 @@ module small_hb_dec (input clk, input rst, input bypass, + input run, input stb_in, input [WIDTH-1:0] data_in, output reg stb_out, @@ -21,15 +22,26 @@ module small_hb_dec wire go; reg phase, go_d1, go_d2, go_d3, go_d4; always @(posedge clk) - if(rst) + if(rst | ~run) phase <= 0; else if(stb_in_d1) phase <= ~phase; assign go = stb_in_d1 & phase; - always @(posedge clk) go_d1 <= go; - always @(posedge clk) go_d2 <= go_d1; - always @(posedge clk) go_d3 <= go_d2; - always @(posedge clk) go_d4 <= go_d3; + always @(posedge clk) + if(rst | ~run) + begin + go_d1 <= 0; + go_d2 <= 0; + go_d3 <= 0; + go_d4 <= 0; + end + else + begin + go_d1 <= go; + go_d2 <= go_d1; + go_d3 <= go_d2; + go_d4 <= go_d3; + end wire [17:0] coeff_a = -10690; wire [17:0] coeff_b = 75809; |
