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

Subversion Repositories pci

[/] [pci/] [trunk/] [rtl/] [verilog/] [pci_cur_out_reg.v] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 77 mihad
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  File name "cur_out_reg.v"                                   ////
4
////                                                              ////
5
////  This file is part of the "PCI bridge" project               ////
6
////  http://www.opencores.org/cores/pci/                         ////
7
////                                                              ////
8
////  Author(s):                                                  ////
9
////      - Miha Dolenc (mihad@opencores.org)                     ////
10
////                                                              ////
11
////  All additional information is avaliable in the README       ////
12
////  file.                                                       ////
13
////                                                              ////
14
////                                                              ////
15
//////////////////////////////////////////////////////////////////////
16
////                                                              ////
17
//// Copyright (C) 2001 Miha Dolenc, mihad@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
// Revision 1.3  2002/02/01 15:25:12  mihad
46
// Repaired a few bugs, updated specification, added test bench files and design document
47
//
48
// Revision 1.2  2001/10/05 08:14:28  mihad
49
// Updated all files with inclusion of timescale file for simulation purposes.
50
//
51
// Revision 1.1.1.1  2001/10/02 15:33:46  mihad
52
// New project directory structure
53
//
54
//
55
 
56
// synopsys translate_off
57
`include "timescale.v"
58
// synopsys translate_on
59
`include "pci_constants.v"
60
 
61
// module is only a backup copy of relevant output registers
62
// used in some arhitectures that support IOB registers, which have to have a
63
// fanout of 1
64
// Otherwise nothing special in this module
65
module pci_cur_out_reg
66
(
67
    reset_in,
68
    clk_in,
69
    frame_in,
70
    frame_load_in,
71
    irdy_in,
72
    devsel_in,
73
    trdy_in,
74
    trdy_en_in,
75
    stop_in,
76
    ad_load_in,
77
    cbe_in,
78
    cbe_en_in,
79
    mas_ad_in,
80
    tar_ad_in,
81
    frame_en_in,
82
    irdy_en_in,
83
 
84
    mas_ad_en_in,
85
    tar_ad_en_in,
86
    ad_en_unregistered_in,
87
 
88
    par_in,
89
    par_en_in,
90
    perr_in,
91
    perr_en_in,
92
    serr_in,
93
    serr_en_in,
94
 
95
    frame_out,
96
    irdy_out,
97
    devsel_out,
98
    trdy_out,
99
    stop_out,
100
    cbe_out,
101
    cbe_en_out,
102
    ad_out,
103
    frame_en_out,
104
    irdy_en_out,
105
    ad_en_out,
106
    mas_ad_en_out,
107
    tar_ad_en_out,
108
    trdy_en_out,
109
 
110
    par_out,
111
    par_en_out,
112
    perr_out,
113
    perr_en_out,
114
    serr_out,
115
    serr_en_out
116
) ;
117
 
118
input reset_in, clk_in ;
119
 
120
input           frame_in ;
121
input           frame_load_in ;
122
input           irdy_in ;
123
input           devsel_in ;
124
input           trdy_in ;
125
input           stop_in ;
126
input           ad_load_in ;
127
 
128
input [3:0]     cbe_in ;
129
input           cbe_en_in ;
130
input [31:0]    mas_ad_in ;
131
input [31:0]    tar_ad_in ;
132
 
133
input           mas_ad_en_in ;
134
input           tar_ad_en_in ;
135
input           ad_en_unregistered_in ;
136
 
137
input           frame_en_in,
138
                irdy_en_in ;
139
 
140
input           trdy_en_in ;
141
 
142
input par_in ;
143
input par_en_in ;
144
input perr_in ;
145
input perr_en_in ;
146
input serr_in ;
147
input serr_en_in ;
148
 
149
output          frame_out ;
150
reg             frame_out ;
151
output          irdy_out ;
152
reg             irdy_out ;
153
output          devsel_out ;
154
reg             devsel_out ;
155
output          trdy_out ;
156
reg             trdy_out ;
157
output          stop_out ;
158
reg             stop_out ;
159
output [3:0]    cbe_out ;
160
reg    [3:0]    cbe_out ;
161
output [31:0]   ad_out ;
162
reg    [31:0]   ad_out ;
163
 
164
output          frame_en_out,
165
                irdy_en_out,
166
                ad_en_out,
167
                cbe_en_out,
168
                mas_ad_en_out,
169
                tar_ad_en_out,
170
                trdy_en_out ;
171
 
172
reg             frame_en_out,
173
                irdy_en_out,
174
                cbe_en_out,
175
                mas_ad_en_out,
176
                tar_ad_en_out,
177
                trdy_en_out;
178
 
179
output          par_out ;
180
output          par_en_out ;
181
output          perr_out ;
182
output          perr_en_out ;
183
output          serr_out ;
184
output          serr_en_out ;
185
 
186
reg             par_out ;
187
reg             par_en_out ;
188
reg             perr_out ;
189
reg             perr_en_out ;
190
reg             serr_out ;
191
reg             serr_en_out ;
192
 
193
assign ad_en_out = mas_ad_en_out || tar_ad_en_out ;
194
 
195
always@(posedge reset_in or posedge clk_in)
196
begin
197
    if ( reset_in )
198
    begin
199
        irdy_out     <= #`FF_DELAY 1'b1 ;
200
        devsel_out   <= #`FF_DELAY 1'b1 ;
201
        trdy_out     <= #`FF_DELAY 1'b1 ;
202
        stop_out     <= #`FF_DELAY 1'b1 ;
203
        frame_en_out <= #`FF_DELAY 1'b0 ;
204
        irdy_en_out  <= #`FF_DELAY 1'b0 ;
205
        mas_ad_en_out<= #`FF_DELAY 1'b0 ;
206
        tar_ad_en_out<= #`FF_DELAY 1'b0 ;
207
        trdy_en_out  <= #`FF_DELAY 1'b0 ;
208
        par_out      <= #`FF_DELAY 1'b0 ;
209
        par_en_out   <= #`FF_DELAY 1'b0 ;
210
        perr_out     <= #`FF_DELAY 1'b1 ;
211
        perr_en_out  <= #`FF_DELAY 1'b0 ;
212
        serr_out     <= #`FF_DELAY 1'b1 ;
213
        serr_en_out  <= #`FF_DELAY 1'b0 ;
214
        cbe_en_out   <= #`FF_DELAY 1'b0 ;
215
 
216
    end
217
    else
218
    begin
219
        irdy_out     <= #`FF_DELAY irdy_in ;
220
        devsel_out   <= #`FF_DELAY devsel_in ;
221
        trdy_out     <= #`FF_DELAY trdy_in ;
222
        stop_out     <= #`FF_DELAY stop_in ;
223
        frame_en_out <= #`FF_DELAY frame_en_in ;
224
        irdy_en_out  <= #`FF_DELAY irdy_en_in ;
225
        mas_ad_en_out<= #`FF_DELAY mas_ad_en_in && ad_en_unregistered_in ;
226
        tar_ad_en_out<= #`FF_DELAY tar_ad_en_in && ad_en_unregistered_in ;
227
        trdy_en_out  <= #`FF_DELAY trdy_en_in ;
228
 
229
        par_out      <= #`FF_DELAY par_in ;
230
        par_en_out   <= #`FF_DELAY par_en_in ;
231
        perr_out     <= #`FF_DELAY perr_in ;
232
        perr_en_out  <= #`FF_DELAY perr_en_in ;
233
        serr_out     <= #`FF_DELAY serr_in ;
234
        serr_en_out  <= #`FF_DELAY serr_en_in ;
235
        cbe_en_out   <= #`FF_DELAY cbe_en_in ;
236
    end
237
end
238
 
239
always@(posedge reset_in or posedge clk_in)
240
begin
241
    if ( reset_in )
242
        cbe_out <= #`FF_DELAY 4'hF ;
243
    else if ( ad_load_in )
244
        cbe_out <= #`FF_DELAY cbe_in ;
245
 
246
end
247
 
248
wire [31:0] ad_source = tar_ad_en_out ? tar_ad_in : mas_ad_in ;
249
 
250
always@(posedge reset_in or posedge clk_in)
251
begin
252
    if ( reset_in )
253
        ad_out <= #`FF_DELAY 32'h0000_0000 ;
254
    else if ( ad_load_in )
255
        ad_out <= #`FF_DELAY ad_source ;
256
 
257
end
258
 
259
always@(posedge reset_in or posedge clk_in)
260
begin
261
    if ( reset_in )
262
        frame_out <= #`FF_DELAY 1'b1 ;
263
    else if ( frame_load_in )
264
        frame_out <= #`FF_DELAY frame_in ;
265
 
266
end
267
 
268
endmodule

powered by: WebSVN 2.1.0

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