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

Subversion Repositories usb_fpga_2_14

[/] [usb_fpga_2_14/] [trunk/] [examples/] [memfifo/] [fpga-2.04b/] [ipcore_dir/] [mem0/] [user_design/] [sim/] [data_prbs_gen.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ZTEX
//*****************************************************************************
2
// (c) Copyright 2008-2009 Xilinx, Inc. All rights reserved.
3
//
4
// This file contains confidential and proprietary information
5
// of Xilinx, Inc. and is protected under U.S. and
6
// international copyright and other intellectual property
7
// laws.
8
//
9
// DISCLAIMER
10
// This disclaimer is not a license and does not grant any
11
// rights to the materials distributed herewith. Except as
12
// otherwise provided in a valid license issued to you by
13
// Xilinx, and to the maximum extent permitted by applicable
14
// law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
15
// WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
16
// AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
17
// BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
18
// INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
19
// (2) Xilinx shall not be liable (whether in contract or tort,
20
// including negligence, or under any other theory of
21
// liability) for any loss or damage of any kind or nature
22
// related to, arising under or in connection with these
23
// materials, including for any direct, or any indirect,
24
// special, incidental, or consequential loss or damage
25
// (including loss of data, profits, goodwill, or any type of
26
// loss or damage suffered as a result of any action brought
27
// by a third party) even if such damage or loss was
28
// reasonably foreseeable or Xilinx had been advised of the
29
// possibility of the same.
30
//
31
// CRITICAL APPLICATIONS
32
// Xilinx products are not designed or intended to be fail-
33
// safe, or for use in any application requiring fail-safe
34
// performance, such as life-support or safety devices or
35
// systems, Class III medical devices, nuclear facilities,
36
// applications related to the deployment of airbags, or any
37
// other applications that could lead to death, personal
38
// injury, or severe property or environmental damage
39
// (individually and collectively, "Critical
40
// Applications"). Customer assumes the sole risk and
41
// liability of any use of Xilinx products in Critical
42
// Applications, subject only to applicable laws and
43
// regulations governing limitations on product liability.
44
//
45
// THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
46
// PART OF THIS FILE AT ALL TIMES.
47
//
48
//*****************************************************************************
49
//   ____  ____
50
//  /   /\/   /
51
// /___/  \  /    Vendor: Xilinx
52
// \   \   \/     Version: %version
53
//  \   \         Application: MIG
54
//  /   /         Filename: data_prbs_gen.v
55
// /___/   /\     Date Last Modified: $Date: 2011/06/02 07:16:33 $
56
// \   \  /  \    Date Created: Fri Sep 01 2006
57
//  \___\/\___\
58
//
59
//Device: Spartan6
60
//Design Name: DDR/DDR2/DDR3/LPDDR 
61
//Purpose:  This module is used LFSR to generate random data for memory 
62
//          data write or memory data read comparison.The first data is 
63
//          seeded by the input prbs_seed_i which is connected to memory address.
64
//Reference:
65
//Revision History:
66
//*****************************************************************************
67
 
68
`timescale 1ps/1ps
69
 
70
module data_prbs_gen #
71
  (
72
    parameter TCQ           = 100,
73
 
74
    parameter EYE_TEST   = "FALSE",
75
    parameter PRBS_WIDTH = 32,                                                                       // "SEQUENTIAL_BUrst_i"
76
    parameter SEED_WIDTH = 32
77
   )
78
  (
79
   input           clk_i,
80
   input           clk_en,
81
   input           rst_i,
82
   input [31:0] prbs_fseed_i,
83
   input           prbs_seed_init,  // when high the prbs_x_seed will be loaded
84
   input [PRBS_WIDTH - 1:0]  prbs_seed_i,
85
 
86
   output  [PRBS_WIDTH - 1:0]  prbs_o     // generated address
87
  );
88
 
89
reg [PRBS_WIDTH - 1 :0] prbs;
90
reg [PRBS_WIDTH :1] lfsr_q;
91
integer i;
92
 
93
 
94
 
95
always @ (posedge clk_i)
96
begin
97
   if (prbs_seed_init && EYE_TEST == "FALSE"  || rst_i )  //reset it to a known good state to prevent it locks up
98
//   if (rst_i )  //reset it to a known good state to prevent it locks up
99
 
100
      begin
101
        lfsr_q <= #TCQ  {prbs_seed_i + prbs_fseed_i[31:0] + 32'h55555555};
102
 
103
      end
104
   else   if (clk_en) begin
105
 
106
        lfsr_q[32:9] <= #TCQ  lfsr_q[31:8];
107
        lfsr_q[8]    <= #TCQ  lfsr_q[32] ^ lfsr_q[7];
108
        lfsr_q[7]    <= #TCQ  lfsr_q[32] ^ lfsr_q[6];
109
        lfsr_q[6:4]  <= #TCQ  lfsr_q[5:3];
110
 
111
        lfsr_q[3]    <= #TCQ  lfsr_q[32] ^ lfsr_q[2];
112
        lfsr_q[2]    <= #TCQ  lfsr_q[1] ;
113
        lfsr_q[1]    <= #TCQ  lfsr_q[32];
114
 
115
 
116
         end
117
end
118
 
119
always @ (lfsr_q[PRBS_WIDTH:1]) begin
120
       prbs = lfsr_q[PRBS_WIDTH:1];
121
end
122
 
123
assign prbs_o = prbs;
124
 
125
endmodule
126
 
127
 

powered by: WebSVN 2.1.0

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