1 |
18 |
mihad |
//////////////////////////////////////////////////////////////////////
|
2 |
|
|
//// ////
|
3 |
|
|
//// File name: pci_rst_int.v ////
|
4 |
|
|
//// ////
|
5 |
|
|
//// This file is part of the "PCI bridge" project ////
|
6 |
|
|
//// http://www.opencores.org/cores/pci/ ////
|
7 |
|
|
//// ////
|
8 |
|
|
//// Author(s): ////
|
9 |
|
|
//// - Tadej Markovic, tadej@opencores.org ////
|
10 |
|
|
//// ////
|
11 |
|
|
//// All additional information is avaliable in the README.txt ////
|
12 |
|
|
//// file. ////
|
13 |
|
|
//// ////
|
14 |
|
|
//// ////
|
15 |
|
|
//////////////////////////////////////////////////////////////////////
|
16 |
|
|
//// ////
|
17 |
|
|
//// Copyright (C) 2000 Tadej Markovic, tadej@opencores.org ////
|
18 |
|
|
//// ////
|
19 |
|
|
//// This source file may be used and distributed without ////
|
20 |
|
|
//// restriction provided that this copyright statement is not ////
|
21 |
|
|
//// removed from the file and that any derivative work contains ////
|
22 |
|
|
//// the original copyright notice and the associated disclaimer. ////
|
23 |
|
|
//// ////
|
24 |
|
|
//// This source file is free software; you can redistribute it ////
|
25 |
|
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
26 |
|
|
//// Public License as published by the Free Software Foundation; ////
|
27 |
|
|
//// either version 2.1 of the License, or (at your option) any ////
|
28 |
|
|
//// later version. ////
|
29 |
|
|
//// ////
|
30 |
|
|
//// This source is distributed in the hope that it will be ////
|
31 |
|
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
32 |
|
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
33 |
|
|
//// PURPOSE. See the GNU Lesser General Public License for more ////
|
34 |
|
|
//// details. ////
|
35 |
|
|
//// ////
|
36 |
|
|
//// You should have received a copy of the GNU Lesser General ////
|
37 |
|
|
//// Public License along with this source; if not, download it ////
|
38 |
|
|
//// from http://www.opencores.org/lgpl.shtml ////
|
39 |
|
|
//// ////
|
40 |
|
|
//////////////////////////////////////////////////////////////////////
|
41 |
|
|
//
|
42 |
|
|
// CVS Revision History
|
43 |
|
|
//
|
44 |
|
|
// $Log: not supported by cvs2svn $
|
45 |
77 |
mihad |
// Revision 1.1 2002/02/01 14:43:31 mihad
|
46 |
|
|
// *** empty log message ***
|
47 |
18 |
mihad |
//
|
48 |
|
|
//
|
49 |
77 |
mihad |
//
|
50 |
18 |
mihad |
|
51 |
|
|
`include "pci_constants.v"
|
52 |
|
|
|
53 |
|
|
// synopsys translate_off
|
54 |
|
|
`include "timescale.v"
|
55 |
|
|
// synopsys translate_on
|
56 |
|
|
|
57 |
|
|
// Module is used to switch appropriate reset and interrupt signals with few logic
|
58 |
77 |
mihad |
module pci_rst_int
|
59 |
18 |
mihad |
(
|
60 |
|
|
clk_in,
|
61 |
|
|
// reset signals
|
62 |
|
|
rst_i,
|
63 |
|
|
pci_rstn_in,
|
64 |
|
|
conf_soft_res_in,
|
65 |
|
|
reset,
|
66 |
|
|
pci_rstn_out,
|
67 |
|
|
pci_rstn_en_out,
|
68 |
|
|
rst_o,
|
69 |
|
|
// interrupt signals
|
70 |
|
|
pci_intan_in,
|
71 |
|
|
conf_int_in,
|
72 |
|
|
int_i,
|
73 |
|
|
out_bckp_perr_en_in,
|
74 |
|
|
out_bckp_serr_en_in,
|
75 |
|
|
pci_intan_out,
|
76 |
|
|
pci_intan_en_out,
|
77 |
|
|
int_o,
|
78 |
|
|
conf_isr_int_prop_out
|
79 |
|
|
);
|
80 |
|
|
|
81 |
|
|
input clk_in;
|
82 |
|
|
// RESET inputs and outputs
|
83 |
|
|
input rst_i;
|
84 |
|
|
input pci_rstn_in;
|
85 |
|
|
input conf_soft_res_in;
|
86 |
|
|
output reset;
|
87 |
|
|
output pci_rstn_out;
|
88 |
|
|
output pci_rstn_en_out;
|
89 |
|
|
output rst_o;
|
90 |
|
|
|
91 |
|
|
// INTERRUPT inputs and outputs
|
92 |
|
|
input pci_intan_in;
|
93 |
|
|
input conf_int_in;
|
94 |
|
|
input int_i;
|
95 |
|
|
input out_bckp_perr_en_in;
|
96 |
|
|
input out_bckp_serr_en_in;
|
97 |
|
|
output pci_intan_out;
|
98 |
|
|
output pci_intan_en_out;
|
99 |
|
|
output int_o;
|
100 |
|
|
output conf_isr_int_prop_out;
|
101 |
|
|
|
102 |
|
|
/*--------------------------------------------------------------------------------------------------------
|
103 |
|
|
RESET logic
|
104 |
|
|
--------------------------------------------------------------------------------------------------------*/
|
105 |
|
|
assign pci_rstn_out = 1'b0 ;
|
106 |
|
|
// host implementation of the bridge gets its reset from WISHBONE bus - RST_I and propagates it to PCI bus
|
107 |
|
|
`ifdef HOST
|
108 |
|
|
assign reset = rst_i ;
|
109 |
|
|
`ifdef ACTIVE_LOW_OE
|
110 |
|
|
assign pci_rstn_en_out = ~(rst_i || conf_soft_res_in) ;
|
111 |
|
|
`else
|
112 |
|
|
assign pci_rstn_en_out = rst_i || conf_soft_res_in ;
|
113 |
|
|
`endif
|
114 |
|
|
assign rst_o = 1'b0 ;
|
115 |
|
|
`else
|
116 |
|
|
// guest implementation of the bridge gets its reset from PCI bus - RST# and propagates it to WISHBONE bus
|
117 |
|
|
`ifdef GUEST
|
118 |
|
|
assign reset = ~pci_rstn_in ;
|
119 |
|
|
assign rst_o = (~pci_rstn_in) || conf_soft_res_in ;
|
120 |
|
|
`ifdef ACTIVE_LOW_OE
|
121 |
|
|
assign pci_rstn_en_out = 1'b1 ; // disabled
|
122 |
|
|
`else
|
123 |
|
|
assign pci_rstn_en_out = 1'b0 ; // disabled
|
124 |
|
|
`endif
|
125 |
|
|
`endif
|
126 |
|
|
`endif
|
127 |
|
|
|
128 |
|
|
/*--------------------------------------------------------------------------------------------------------
|
129 |
|
|
INTERRUPT logic
|
130 |
|
|
--------------------------------------------------------------------------------------------------------*/
|
131 |
|
|
assign pci_intan_out = 1'b0 ;
|
132 |
|
|
// host implementation of the bridge gets its interrupt from PCI bus - INTA# and propagates it to WISHBONE bus
|
133 |
|
|
`ifdef HOST
|
134 |
|
|
assign conf_isr_int_prop_out = ~pci_intan_in ;
|
135 |
|
|
assign int_o = conf_int_in ;
|
136 |
|
|
`ifdef ACTIVE_LOW_OE
|
137 |
|
|
assign pci_intan_en_out = 1'b1 ; // disabled
|
138 |
|
|
`else
|
139 |
|
|
assign pci_intan_en_out = 1'b0 ; // disabled
|
140 |
|
|
`endif
|
141 |
|
|
`else
|
142 |
|
|
// guest implementation of the bridge gets its interrupt from WISHBONE bus - INT_I and propagates it to PCI bus
|
143 |
|
|
`ifdef GUEST
|
144 |
|
|
wire interrupt_a_en;
|
145 |
77 |
mihad |
pci_out_reg inta
|
146 |
18 |
mihad |
(
|
147 |
|
|
.reset_in ( reset ),
|
148 |
|
|
.clk_in ( clk_in) ,
|
149 |
|
|
.dat_en_in ( 1'b1 ),
|
150 |
|
|
.en_en_in ( 1'b1 ),
|
151 |
|
|
.dat_in ( 1'b0 ) , // active low
|
152 |
|
|
.en_in ( conf_int_in ) ,
|
153 |
|
|
.en_out ( interrupt_a_en ),
|
154 |
|
|
.dat_out ( )
|
155 |
|
|
);
|
156 |
|
|
assign conf_isr_int_prop_out = int_i ;
|
157 |
|
|
assign int_o = 1'b0 ;
|
158 |
|
|
assign pci_intan_en_out = interrupt_a_en ;
|
159 |
|
|
`endif
|
160 |
|
|
`endif
|
161 |
|
|
|
162 |
|
|
|
163 |
|
|
endmodule
|