OpenCores
URL https://opencores.org/ocsvn/thor/thor/trunk

Subversion Repositories thor

[/] [thor/] [trunk/] [FT64v5/] [rtl/] [lib/] [vtdl.v] - Blame information for rev 48

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 48 robfinch
//=============================================================================
2
//      (C) 2007,2012  Robert Finch, Stratford
3
//      robfinch<remove>@opencores.org
4
//
5
//
6
//      vtdl - variable tap delay line
7
//              (dynamic shift register)
8
//
9
//
10
//
11
// This source file is free software: you can redistribute it and/or modify 
12
// it under the terms of the GNU Lesser General Public License as published 
13
// by the Free Software Foundation, either version 3 of the License, or     
14
// (at your option) any later version.                                      
15
//                                                                          
16
// This source file is distributed in the hope that it will be useful,      
17
// but WITHOUT ANY WARRANTY; without even the implied warranty of           
18
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            
19
// GNU General Public License for more details.                             
20
//                                                                          
21
// You should have received a copy of the GNU General Public License        
22
// along with this program.  If not, see <http://www.gnu.org/licenses/>.    
23
//                                                                          
24
//
25
//    Notes:
26
//
27
//      This module acts like a clocked delay line with a variable tap.
28
//      Miscellaneous usage in rate control circuitry such as fifo's.
29
//      Capable of delaying a signal bus.
30
//      Signal bus width is specified with the WID parameter.
31
//
32
//      Verilog 1995
33
//      Ref: Webpack9.1i xc3s1000-4ft256
34
//      4 slices / 8 LUTs / < 10ns
35
//=============================================================================
36
//
37
module vtdl(clk, ce, a, d, q);
38
parameter WID = 8;
39
parameter DEP = 16;
40
localparam AMSB = DEP>64?6:DEP>32?5:DEP>16?4:DEP>8?3:DEP>4?2:DEP>2?1:0;
41
input clk;
42
input ce;
43
input [AMSB:0] a;
44
input [WID-1:0] d;
45
output [WID-1:0] q;
46
 
47
reg [WID-1:0] m [DEP-1:0];
48
integer n;
49
 
50
always @(posedge clk)
51
        if (ce) begin
52
                for (n = 1; n < DEP; n = n + 1)
53
                        m[n] <= m[n-1];
54
                m[0] <= d;
55
        end
56
 
57
assign q = m[a];
58
 
59
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.