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

Subversion Repositories ddr3_synthesizable_bfm

[/] [ddr3_synthesizable_bfm/] [trunk/] [rtl/] [ddr3_sr4.v] - Blame information for rev 7

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 slai
/*
2
Multibits Shift Register
3
2010-2011 sclai <laikos@yahoo.com>
4
 
5
This library is free software; you can redistribute it and/or modify it
6
 under the terms of the GNU Lesser General Public License as published by
7
 the Free Software Foundation; either version 2.1 of the License,
8
 or (at your option) any later version.
9
 
10
 This library is distributed in the hope that it will be useful, but
11
 WITHOUT ANY WARRANTY; without even the implied warranty of
12
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
 Lesser General Public License for more details.
14
 
15
 You should have received a copy of the GNU Lesser General Public
16
 License along with this library; if not, write to the Free Software
17
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18
 USA
19
*/
20
module ddr3_sr4 #(
21
parameter PIPE_LEN=7
22
)(
23
input wire        clk,
24
input wire [3:0] shift_in,
25
output wire[3:0] shift_out
26
);
27
//register to hold value
28
reg [PIPE_LEN-1:0] d0;
29
reg [PIPE_LEN-1:0] d1;
30
reg [PIPE_LEN-1:0] d2;
31
reg [PIPE_LEN-1:0] d3;
32
 
33
always @(posedge clk)
34
begin
35
  d3  <={shift_in[ 3],d3[PIPE_LEN-1:1]};
36
  d2  <={shift_in[ 2],d2[PIPE_LEN-1:1]};
37
  d1  <={shift_in[ 1],d1[PIPE_LEN-1:1]};
38
  d0  <={shift_in[ 0],d0[PIPE_LEN-1:1]};
39
end
40
 
41
assign shift_out={d3[0],d2[0],d1[0],d0[0]};
42
endmodule
43
 
44
 
45
 

powered by: WebSVN 2.1.0

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