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

Subversion Repositories pci

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

powered by: WebSVN 2.1.0

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