summaryrefslogtreecommitdiff
path: root/gr-sounder/src/fpga/lib/lfsr_constants.v
diff options
context:
space:
mode:
authorjcorgan2007-06-05 04:21:29 +0000
committerjcorgan2007-06-05 04:21:29 +0000
commite283fe844c88aa33b6bde4a7cb74f0d1c2ddbbc5 (patch)
tree0081a8487d3a4bb7a65404c2662d0a7480f50421 /gr-sounder/src/fpga/lib/lfsr_constants.v
parent389906ea28957c6d7a08b5cd43a4ac2ab0c9d24d (diff)
downloadgnuradio-e283fe844c88aa33b6bde4a7cb74f0d1c2ddbbc5.tar.gz
gnuradio-e283fe844c88aa33b6bde4a7cb74f0d1c2ddbbc5.tar.bz2
gnuradio-e283fe844c88aa33b6bde4a7cb74f0d1c2ddbbc5.zip
Merged r5566:5676 from jcorgan/snd into trunk, with minor changes. Component gr-sounder is now complete for recording impulse responses to a file.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@5679 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-sounder/src/fpga/lib/lfsr_constants.v')
-rw-r--r--[-rwxr-xr-x]gr-sounder/src/fpga/lib/lfsr_constants.v66
1 files changed, 39 insertions, 27 deletions
diff --git a/gr-sounder/src/fpga/lib/lfsr_constants.v b/gr-sounder/src/fpga/lib/lfsr_constants.v
index 55ee613d2..e23ed6601 100755..100644
--- a/gr-sounder/src/fpga/lib/lfsr_constants.v
+++ b/gr-sounder/src/fpga/lib/lfsr_constants.v
@@ -19,33 +19,45 @@
// Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA
//
-module lfsr_constants(degree_i,mask_o,len_o);
- input wire [4:0] degree_i;
- output reg [15:0] mask_o;
- output wire [15:0] len_o;
-
- assign len_o = (1 << degree_i) - 1;
+module lfsr_constants(clk_i,rst_i,degree_i,mask_o,len_o);
+ input clk_i;
+ input rst_i;
+ input [4:0] degree_i;
+ output reg [15:0] mask_o;
+ output reg [16:0] len_o;
+
+ integer len;
- always @*
- case (degree_i)
- 5'd00: mask_o = 16'h0000;
- 5'd01: mask_o = 16'h0001;
- 5'd02: mask_o = 16'h0003;
- 5'd03: mask_o = 16'h0005;
- 5'd04: mask_o = 16'h0009;
- 5'd05: mask_o = 16'h0012;
- 5'd06: mask_o = 16'h0021;
- 5'd07: mask_o = 16'h0041;
- 5'd08: mask_o = 16'h008E;
- 5'd09: mask_o = 16'h0108;
- 5'd10: mask_o = 16'h0204;
- 5'd11: mask_o = 16'h0402;
- 5'd12: mask_o = 16'h0829;
- 5'd13: mask_o = 16'h100D;
- 5'd14: mask_o = 16'h2015;
- 5'd15: mask_o = 16'h4001;
- 5'd16: mask_o = 16'h8016;
- default: mask_o = 16'h0000;
- endcase // case(degree_i)
+ always @(posedge clk_i)
+ if (rst_i)
+ begin
+ len_o <= #5 17'b0;
+ mask_o <= #5 16'b0;
+ end
+ else
+ begin
+ len_o <= #5 ((1 << degree_i) << 1)-3;
+
+ case (degree_i)
+ 5'd00: mask_o <= #5 16'h0000;
+ 5'd01: mask_o <= #5 16'h0001;
+ 5'd02: mask_o <= #5 16'h0003;
+ 5'd03: mask_o <= #5 16'h0005;
+ 5'd04: mask_o <= #5 16'h0009;
+ 5'd05: mask_o <= #5 16'h0012;
+ 5'd06: mask_o <= #5 16'h0021;
+ 5'd07: mask_o <= #5 16'h0041;
+ 5'd08: mask_o <= #5 16'h008E;
+ 5'd09: mask_o <= #5 16'h0108;
+ 5'd10: mask_o <= #5 16'h0204;
+ 5'd11: mask_o <= #5 16'h0402;
+ 5'd12: mask_o <= #5 16'h0829;
+ 5'd13: mask_o <= #5 16'h100D;
+ 5'd14: mask_o <= #5 16'h2015;
+ 5'd15: mask_o <= #5 16'h4001;
+ 5'd16: mask_o <= #5 16'h8016;
+ default: mask_o <= #5 16'h0000;
+ endcase // case(degree_i)
+ end // else: !if(rst_i)
endmodule // lfsr_constants