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

Subversion Repositories pci

[/] [pci/] [tags/] [rel_3/] [rtl/] [verilog/] [cur_out_reg.v] - Blame information for rev 154

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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