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 2

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

powered by: WebSVN 2.1.0

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