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/] [example_design/] [rtl/] [traffic_gen/] [tg_status.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: tg_status.v
55
// /___/   /\     Date Last Modified: 
56
// \   \  /  \    Date Created: 
57
//  \___\/\___\
58
//
59
//Device: Spartan6
60
//Design Name: DDR/DDR2/DDR3/LPDDR 
61
//Purpose:  This module compare the memory read data agaisnt compare data that generated from data_gen module.
62
//          Error signal will be asserted if the comparsion is not equal.
63
//Reference:
64
//Revision History:
65
//*****************************************************************************
66
 
67
`timescale 1ps/1ps
68
 
69
 
70
module tg_status #(
71
   parameter TCQ           = 100,
72
 
73
   parameter DWIDTH = 32
74
    )
75
    (
76
 
77
 
78
   input                            clk_i  ,
79
   input                            rst_i ,
80
   input                            manual_clear_error,
81
   input                            data_error_i ,
82
   input [DWIDTH-1:0]               cmp_data_i,
83
   input [DWIDTH-1:0]               rd_data_i ,
84
   input [31:0]                     cmp_addr_i ,
85
   input [5:0]                      cmp_bl_i ,
86
   input                            mcb_cmd_full_i ,
87
   input                            mcb_wr_full_i,
88
   input                            mcb_rd_empty_i,
89
   output reg [64 + (2*DWIDTH - 1):0]   error_status,
90
   output                           error
91
  );
92
 
93
reg data_error_r;
94
reg error_set;
95
assign  error = error_set;
96
 
97
always @ (posedge clk_i)
98
    data_error_r <= #TCQ  data_error_i;
99
 
100
always @ (posedge clk_i)
101
begin
102
 
103
if (rst_i || manual_clear_error) begin
104
   error_status <= #TCQ  'b0;
105
   error_set    <= #TCQ  1'b0;
106
end
107
else begin
108
  // latch the first error only
109
  if (data_error_i && ~data_error_r && ~error_set ) begin
110
     error_status[31:0]  <= #TCQ  cmp_addr_i;
111
     error_status[37:32] <= #TCQ  cmp_bl_i;
112
     error_status[40] <= #TCQ  mcb_cmd_full_i;
113
     error_status[41] <= #TCQ  mcb_wr_full_i;
114
     error_status[42] <= #TCQ  mcb_rd_empty_i;
115
     error_set <= #TCQ  1'b1;
116
     error_status[64 + (DWIDTH - 1)  :64]           <= #TCQ  cmp_data_i;
117
     error_status[64 + (2*DWIDTH - 1):64 + DWIDTH]  <= #TCQ  rd_data_i;
118
 
119
  end
120
 
121
  error_status[39:38]  <= #TCQ  'b0;    // reserved
122
  error_status[63:43] <= #TCQ  'b0;    // reserved
123
 
124
 
125
end end
126
 
127
endmodule
128
 

powered by: WebSVN 2.1.0

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