diff options
author | Matt Ettus <matt@ettus.com> | 2011-05-13 13:06:16 -0700 |
---|---|---|
committer | Matt Ettus <matt@ettus.com> | 2011-06-08 10:52:52 -0700 |
commit | d35bbdf5a68dd8227354b4352043867f43b20b09 (patch) | |
tree | c315c90c43019840ce1a41931db0f93eaa7ef445 /usrp2/sdr_lib | |
parent | e0654430583fb4980165adbcfd04aa9bf04c429b (diff) | |
download | uhd-d35bbdf5a68dd8227354b4352043867f43b20b09.tar.gz uhd-d35bbdf5a68dd8227354b4352043867f43b20b09.tar.bz2 uhd-d35bbdf5a68dd8227354b4352043867f43b20b09.zip |
dsp: increase gain of small_hb_dec because it used to scale down by factor of 2. Clip if needed.
Diffstat (limited to 'usrp2/sdr_lib')
-rw-r--r-- | usrp2/sdr_lib/dsp_core_rx_tb.v | 4 | ||||
-rw-r--r-- | usrp2/sdr_lib/small_hb_dec.v | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/usrp2/sdr_lib/dsp_core_rx_tb.v b/usrp2/sdr_lib/dsp_core_rx_tb.v index c8fb33982..ff35d4027 100644 --- a/usrp2/sdr_lib/dsp_core_rx_tb.v +++ b/usrp2/sdr_lib/dsp_core_rx_tb.v @@ -46,11 +46,11 @@ module dsp_core_rx_tb(); @(negedge rst); @(posedge clk); set_addr <= 1; - set_data <= {16'd64,16'd64}; + set_data <= {16'd64,16'd64}; // set gains set_stb <= 1; @(posedge clk); set_addr <= 2; - set_data <= {16'd0,8'd3,8'd8}; + set_data <= {16'd0,8'd0,8'd8}; // set decim set_stb <= 1; @(posedge clk); set_stb <= 0; diff --git a/usrp2/sdr_lib/small_hb_dec.v b/usrp2/sdr_lib/small_hb_dec.v index ecafc2b68..14e6d755c 100644 --- a/usrp2/sdr_lib/small_hb_dec.v +++ b/usrp2/sdr_lib/small_hb_dec.v @@ -106,18 +106,22 @@ module small_hb_dec else if(go_d3) accum <= accum + {prod}; - wire [17:0] accum_rnd; + wire [18:0] accum_rnd; + wire [17:0] accum_rnd_clip; + wire stb_round; - round_sd #(.WIDTH_IN(36),.WIDTH_OUT(18)) round_acc + round_sd #(.WIDTH_IN(36),.WIDTH_OUT(19)) round_acc (.clk(clk), .reset(rst), .in(accum), .strobe_in(go_d4), .out(accum_rnd), .strobe_out(stb_round)); + clip #(.bits_in(19),.bits_out(18)) clip (.in(accum_rnd), .out(accum_rnd_clip)); + reg [17:0] final_sum; always @(posedge clk) if(bypass) final_sum <= data_in_d1; else if(stb_round) - final_sum <= accum_rnd; + final_sum <= accum_rnd_clip; assign data_out = final_sum; |