1 |
2 |
dsmv |
|
2 |
|
|
//-----------------------------------------------------------------------------
|
3 |
|
|
//
|
4 |
|
|
// (c) Copyright 2009-2010 Xilinx, Inc. All rights reserved.
|
5 |
|
|
//
|
6 |
|
|
// This file contains confidential and proprietary information
|
7 |
|
|
// of Xilinx, Inc. and is protected under U.S. and
|
8 |
|
|
// international copyright and other intellectual property
|
9 |
|
|
// laws.
|
10 |
|
|
//
|
11 |
|
|
// DISCLAIMER
|
12 |
|
|
// This disclaimer is not a license and does not grant any
|
13 |
|
|
// rights to the materials distributed herewith. Except as
|
14 |
|
|
// otherwise provided in a valid license issued to you by
|
15 |
|
|
// Xilinx, and to the maximum extent permitted by applicable
|
16 |
|
|
// law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
|
17 |
|
|
// WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
|
18 |
|
|
// AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
|
19 |
|
|
// BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
|
20 |
|
|
// INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
|
21 |
|
|
// (2) Xilinx shall not be liable (whether in contract or tort,
|
22 |
|
|
// including negligence, or under any other theory of
|
23 |
|
|
// liability) for any loss or damage of any kind or nature
|
24 |
|
|
// related to, arising under or in connection with these
|
25 |
|
|
// materials, including for any direct, or any indirect,
|
26 |
|
|
// special, incidental, or consequential loss or damage
|
27 |
|
|
// (including loss of data, profits, goodwill, or any type of
|
28 |
|
|
// loss or damage suffered as a result of any action brought
|
29 |
|
|
// by a third party) even if such damage or loss was
|
30 |
|
|
// reasonably foreseeable or Xilinx had been advised of the
|
31 |
|
|
// possibility of the same.
|
32 |
|
|
//
|
33 |
|
|
// CRITICAL APPLICATIONS
|
34 |
|
|
// Xilinx products are not designed or intended to be fail-
|
35 |
|
|
// safe, or for use in any application requiring fail-safe
|
36 |
|
|
// performance, such as life-support or safety devices or
|
37 |
|
|
// systems, Class III medical devices, nuclear facilities,
|
38 |
|
|
// applications related to the deployment of airbags, or any
|
39 |
|
|
// other applications that could lead to death, personal
|
40 |
|
|
// injury, or severe property or environmental damage
|
41 |
|
|
// (individually and collectively, "Critical
|
42 |
|
|
// Applications"). Customer assumes the sole risk and
|
43 |
|
|
// liability of any use of Xilinx products in Critical
|
44 |
|
|
// Applications, subject only to applicable laws and
|
45 |
|
|
// regulations governing limitations on product liability.
|
46 |
|
|
//
|
47 |
|
|
// THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
|
48 |
|
|
// PART OF THIS FILE AT ALL TIMES.
|
49 |
|
|
//
|
50 |
|
|
//-----------------------------------------------------------------------------
|
51 |
|
|
// Project : V5-Block Plus for PCI Express
|
52 |
|
|
// File : pcie_blk_cf_pwr.v
|
53 |
|
|
//--------------------------------------------------------------------------------
|
54 |
|
|
//--------------------------------------------------------------------------------
|
55 |
|
|
//--
|
56 |
|
|
//-- Description: PCIe Block Power Management Interface
|
57 |
|
|
//--
|
58 |
|
|
//--
|
59 |
|
|
//--
|
60 |
|
|
//--------------------------------------------------------------------------------
|
61 |
|
|
|
62 |
|
|
`timescale 1ns/1ns
|
63 |
|
|
`ifndef TCQ
|
64 |
|
|
`define TCQ 1
|
65 |
|
|
`endif
|
66 |
|
|
|
67 |
|
|
module pcie_blk_cf_pwr
|
68 |
|
|
(
|
69 |
|
|
// Clock and reset
|
70 |
|
|
|
71 |
|
|
input clk,
|
72 |
|
|
input rst_n,
|
73 |
|
|
|
74 |
|
|
// User Interface Power Management Ports
|
75 |
|
|
|
76 |
|
|
input cfg_turnoff_ok_n,
|
77 |
|
|
output reg cfg_to_turnoff_n,
|
78 |
|
|
|
79 |
|
|
input cfg_pm_wake_n,
|
80 |
|
|
|
81 |
|
|
|
82 |
|
|
// PCIe Block Power Management Ports
|
83 |
|
|
|
84 |
|
|
input l0_pwr_turn_off_req,
|
85 |
|
|
|
86 |
|
|
output reg l0_pme_req_in,
|
87 |
|
|
input l0_pme_ack,
|
88 |
|
|
|
89 |
|
|
// Interface to arbiter
|
90 |
|
|
output reg send_pmeack,
|
91 |
|
|
input cs_is_pm,
|
92 |
|
|
input grant
|
93 |
|
|
);
|
94 |
|
|
|
95 |
|
|
always @(posedge clk)
|
96 |
|
|
begin
|
97 |
|
|
if (~rst_n) begin
|
98 |
|
|
cfg_to_turnoff_n <= #`TCQ 1;
|
99 |
|
|
send_pmeack <= #`TCQ 0;
|
100 |
|
|
l0_pme_req_in <= #`TCQ 0;
|
101 |
|
|
end else begin
|
102 |
|
|
//PME Turn Off message rec'd; inform user
|
103 |
|
|
if (l0_pwr_turn_off_req)
|
104 |
|
|
cfg_to_turnoff_n <= #`TCQ 0;
|
105 |
|
|
else if (~cfg_turnoff_ok_n)
|
106 |
|
|
cfg_to_turnoff_n <= #`TCQ 1;
|
107 |
|
|
//User issues PME To ACK
|
108 |
|
|
if (~cfg_turnoff_ok_n && ~cfg_to_turnoff_n)
|
109 |
|
|
send_pmeack <= #`TCQ 1;
|
110 |
|
|
else if (cs_is_pm && grant)
|
111 |
|
|
send_pmeack <= #`TCQ 0;
|
112 |
|
|
//Send a PM PME message
|
113 |
|
|
if (~cfg_pm_wake_n)
|
114 |
|
|
l0_pme_req_in <= #`TCQ 1;
|
115 |
|
|
else if (l0_pme_ack)
|
116 |
|
|
l0_pme_req_in <= #`TCQ 0;
|
117 |
|
|
end
|
118 |
|
|
end
|
119 |
|
|
|
120 |
|
|
endmodule // pcie_blk_cf_pwr
|
121 |
|
|
|