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

Subversion Repositories pci

[/] [pci/] [tags/] [rel_11/] [rtl/] [verilog/] [pci_in_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: pci_in_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
////      - Tadej Markovic, tadej@opencores.org                   ////
10
////                                                              ////
11
////  All additional information is avaliable in the README.txt   ////
12
////  file.                                                       ////
13
////                                                              ////
14
////                                                              ////
15
//////////////////////////////////////////////////////////////////////
16
////                                                              ////
17
//// Copyright (C) 2000 Tadej Markovic, tadej@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 used for registering PCI input signals 
50
// It provides data flip flops with reset
51
module PCI_IN_REG
52
(
53
    reset_in,
54
    clk_in,
55
 
56
    pci_gnt_in,
57
    pci_frame_in,
58
    pci_irdy_in,
59
    pci_trdy_in,
60
    pci_stop_in,
61
    pci_devsel_in,
62
    pci_idsel_in,
63
    pci_ad_in,
64
    pci_cbe_in,
65
 
66
    pci_gnt_reg_out,
67
    pci_frame_reg_out,
68
    pci_irdy_reg_out,
69
    pci_trdy_reg_out,
70
    pci_stop_reg_out,
71
    pci_devsel_reg_out,
72
    pci_idsel_reg_out,
73
    pci_ad_reg_out,
74
    pci_cbe_reg_out
75
 
76
);
77
 
78
input                   reset_in, clk_in ;
79
 
80
input           pci_gnt_in ;
81
input           pci_frame_in ;
82
input           pci_irdy_in ;
83
input           pci_trdy_in ;
84
input           pci_stop_in ;
85
input           pci_devsel_in ;
86
input                   pci_idsel_in ;
87
input [31:0]    pci_ad_in ;
88
input [3:0]     pci_cbe_in ;
89
 
90
output          pci_gnt_reg_out ;
91
output          pci_frame_reg_out ;
92
output          pci_irdy_reg_out ;
93
output          pci_trdy_reg_out ;
94
output          pci_stop_reg_out ;
95
output          pci_devsel_reg_out ;
96
output                  pci_idsel_reg_out ;
97
output [31:0]   pci_ad_reg_out ;
98
output [3:0]    pci_cbe_reg_out ;
99
 
100
 
101
reg             pci_gnt_reg_out ;
102
reg             pci_frame_reg_out ;
103
reg             pci_irdy_reg_out ;
104
reg             pci_trdy_reg_out ;
105
reg             pci_stop_reg_out ;
106
reg             pci_devsel_reg_out ;
107
reg                             pci_idsel_reg_out ;
108
reg    [31:0]   pci_ad_reg_out ;
109
reg    [3:0]    pci_cbe_reg_out ;
110
 
111
always@(posedge reset_in or posedge clk_in)
112
begin
113
    if ( reset_in )
114
    begin
115
                pci_gnt_reg_out         <= #`FF_DELAY 1'b1 ;
116
                pci_frame_reg_out       <= #`FF_DELAY 1'b1 ;
117
                pci_irdy_reg_out        <= #`FF_DELAY 1'b1 ;
118
                pci_trdy_reg_out        <= #`FF_DELAY 1'b1 ;
119
                pci_stop_reg_out        <= #`FF_DELAY 1'b1 ;
120
                pci_devsel_reg_out      <= #`FF_DELAY 1'b1 ;
121
                pci_idsel_reg_out       <= #`FF_DELAY 1'b0 ; // active high!
122
    end
123
    else
124
        begin
125
                pci_gnt_reg_out         <= #`FF_DELAY pci_gnt_in ;
126
                pci_frame_reg_out       <= #`FF_DELAY pci_frame_in ;
127
                pci_irdy_reg_out        <= #`FF_DELAY pci_irdy_in ;
128
                pci_trdy_reg_out        <= #`FF_DELAY pci_trdy_in ;
129
                pci_stop_reg_out        <= #`FF_DELAY pci_stop_in ;
130
                pci_devsel_reg_out      <= #`FF_DELAY pci_devsel_in ;
131
                pci_idsel_reg_out       <= #`FF_DELAY pci_idsel_in ;
132
        end
133
end
134
 
135
always@(posedge reset_in or posedge clk_in)
136
begin
137
    if ( reset_in )
138
        pci_ad_reg_out <= #`FF_DELAY 32'h0000_0000 ;
139
    else
140
        pci_ad_reg_out <= #`FF_DELAY pci_ad_in ;
141
end
142
 
143
always@(posedge reset_in or posedge clk_in)
144
begin
145
    if ( reset_in )
146
        pci_cbe_reg_out <= #`FF_DELAY 4'h0 ;
147
    else
148
        pci_cbe_reg_out <= #`FF_DELAY pci_cbe_in ;
149
end
150
 
151
 
152
endmodule

powered by: WebSVN 2.1.0

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