1 //////////////////////////////////////////////////////////////////////
3 //// File name "cur_out_reg.v" ////
5 //// This file is part of the "PCI bridge" project ////
6 //// http://www.opencores.org/cores/pci/ ////
9 //// - Miha Dolenc (mihad@opencores.org) ////
11 //// All additional information is avaliable in the README ////
15 //////////////////////////////////////////////////////////////////////
17 //// Copyright (C) 2001 Miha Dolenc, mihad@opencores.org ////
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. ////
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. ////
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 ////
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 ////
40 //////////////////////////////////////////////////////////////////////
42 // CVS Revision History
44 // $Log: pci_cur_out_reg.v,v $
45 // Revision 1.1 2007-03-20 17:50:56 sithglan
48 // Revision 1.1 2003/01/27 16:49:31 mihad
49 // Changed module and file names. Updated scripts accordingly. FIFO synchronizations changed.
51 // Revision 1.3 2002/02/01 15:25:12 mihad
52 // Repaired a few bugs, updated specification, added test bench files and design document
54 // Revision 1.2 2001/10/05 08:14:28 mihad
55 // Updated all files with inclusion of timescale file for simulation purposes.
57 // Revision 1.1.1.1 2001/10/02 15:33:46 mihad
58 // New project directory structure
62 // synopsys translate_off
63 `include "timescale.v"
64 // synopsys translate_on
65 `include "pci_constants.v"
67 // module is only a backup copy of relevant output registers
68 // used in some arhitectures that support IOB registers, which have to have a
70 // Otherwise nothing special in this module
71 module pci_cur_out_reg
92 ad_en_unregistered_in,
124 input reset_in, clk_in ;
127 input frame_load_in ;
136 input [31:0] mas_ad_in ;
137 input [31:0] tar_ad_in ;
141 input ad_en_unregistered_in ;
165 output [3:0] cbe_out ;
167 output [31:0] ad_out ;
199 assign ad_en_out = mas_ad_en_out || tar_ad_en_out ;
201 always@(posedge reset_in or posedge clk_in)
205 irdy_out <= #`FF_DELAY 1'b1 ;
206 devsel_out <= #`FF_DELAY 1'b1 ;
207 trdy_out <= #`FF_DELAY 1'b1 ;
208 stop_out <= #`FF_DELAY 1'b1 ;
209 frame_en_out <= #`FF_DELAY 1'b0 ;
210 irdy_en_out <= #`FF_DELAY 1'b0 ;
211 mas_ad_en_out<= #`FF_DELAY 1'b0 ;
212 tar_ad_en_out<= #`FF_DELAY 1'b0 ;
213 trdy_en_out <= #`FF_DELAY 1'b0 ;
214 par_out <= #`FF_DELAY 1'b0 ;
215 par_en_out <= #`FF_DELAY 1'b0 ;
216 perr_out <= #`FF_DELAY 1'b1 ;
217 perr_en_out <= #`FF_DELAY 1'b0 ;
218 serr_out <= #`FF_DELAY 1'b1 ;
219 serr_en_out <= #`FF_DELAY 1'b0 ;
220 cbe_en_out <= #`FF_DELAY 1'b0 ;
225 irdy_out <= #`FF_DELAY irdy_in ;
226 devsel_out <= #`FF_DELAY devsel_in ;
227 trdy_out <= #`FF_DELAY trdy_in ;
228 stop_out <= #`FF_DELAY stop_in ;
229 frame_en_out <= #`FF_DELAY frame_en_in ;
230 irdy_en_out <= #`FF_DELAY irdy_en_in ;
231 mas_ad_en_out<= #`FF_DELAY mas_ad_en_in && ad_en_unregistered_in ;
232 tar_ad_en_out<= #`FF_DELAY tar_ad_en_in && ad_en_unregistered_in ;
233 trdy_en_out <= #`FF_DELAY trdy_en_in ;
235 par_out <= #`FF_DELAY par_in ;
236 par_en_out <= #`FF_DELAY par_en_in ;
237 perr_out <= #`FF_DELAY perr_in ;
238 perr_en_out <= #`FF_DELAY perr_en_in ;
239 serr_out <= #`FF_DELAY serr_in ;
240 serr_en_out <= #`FF_DELAY serr_en_in ;
241 cbe_en_out <= #`FF_DELAY cbe_en_in ;
245 always@(posedge reset_in or posedge clk_in)
248 cbe_out <= #`FF_DELAY 4'hF ;
249 else if ( ad_load_in )
250 cbe_out <= #`FF_DELAY cbe_in ;
254 wire [31:0] ad_source = tar_ad_en_out ? tar_ad_in : mas_ad_in ;
256 always@(posedge reset_in or posedge clk_in)
259 ad_out <= #`FF_DELAY 32'h0000_0000 ;
260 else if ( ad_load_in )
261 ad_out <= #`FF_DELAY ad_source ;
265 always@(posedge reset_in or posedge clk_in)
268 frame_out <= #`FF_DELAY 1'b1 ;
269 else if ( frame_load_in )
270 frame_out <= #`FF_DELAY frame_in ;