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

Subversion Repositories pci

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 mihad
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  File name "conf_cyc_addr_dec.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
 
54
// module is a simple decoder which decodes device num field of configuration address
55
// for type0 configuration cycles. If type 1 configuration cycle is
56
// initiated then address goes through unchanged
57
 
58 21 mihad
// synopsys translate_off
59 6 mihad
`include "timescale.v"
60 21 mihad
// synopsys translate_on
61 6 mihad
 
62 2 mihad
module CONF_CYC_ADDR_DEC
63
(
64
    ccyc_addr_in,
65
    ccyc_addr_out
66
) ;
67
 
68
input   [31:0]  ccyc_addr_in ;
69
output  [31:0]  ccyc_addr_out ;
70
reg     [31:11]  ccyc_addr_31_11 ;
71
 
72
// lower 11 address lines are alweys going through unchanged
73
assign ccyc_addr_out = {ccyc_addr_31_11, ccyc_addr_in[10:0]} ;
74
 
75
// configuration cycle type indicator
76
wire ccyc_type = ccyc_addr_in[0] ;
77
 
78
always@(ccyc_addr_in or ccyc_type)
79
begin
80
    if (ccyc_type)
81
        // type 1 cycle - address goes through unchanged
82
        ccyc_addr_31_11 = ccyc_addr_in[31:11] ;
83
    else
84
    begin
85
        // type 0 conf. cycle - decode device number field to appropriate value
86
        case (ccyc_addr_in[15:11])
87
            5'h00:ccyc_addr_31_11 = 21'h00_0001 ;
88
            5'h01:ccyc_addr_31_11 = 21'h00_0002 ;
89
            5'h02:ccyc_addr_31_11 = 21'h00_0004 ;
90
            5'h03:ccyc_addr_31_11 = 21'h00_0008 ;
91
            5'h04:ccyc_addr_31_11 = 21'h00_0010 ;
92
            5'h05:ccyc_addr_31_11 = 21'h00_0020 ;
93
            5'h06:ccyc_addr_31_11 = 21'h00_0040 ;
94
            5'h07:ccyc_addr_31_11 = 21'h00_0080 ;
95
            5'h08:ccyc_addr_31_11 = 21'h00_0100 ;
96
            5'h09:ccyc_addr_31_11 = 21'h00_0200 ;
97
            5'h0A:ccyc_addr_31_11 = 21'h00_0400 ;
98
            5'h0B:ccyc_addr_31_11 = 21'h00_0800 ;
99
            5'h0C:ccyc_addr_31_11 = 21'h00_1000 ;
100
            5'h0D:ccyc_addr_31_11 = 21'h00_2000 ;
101
            5'h0E:ccyc_addr_31_11 = 21'h00_4000 ;
102
            5'h0F:ccyc_addr_31_11 = 21'h00_8000 ;
103
            5'h10:ccyc_addr_31_11 = 21'h01_0000 ;
104
            5'h11:ccyc_addr_31_11 = 21'h02_0000 ;
105
            5'h12:ccyc_addr_31_11 = 21'h04_0000 ;
106
            5'h13:ccyc_addr_31_11 = 21'h08_0000 ;
107
            5'h14:ccyc_addr_31_11 = 21'h10_0000 ;
108
            default: ccyc_addr_31_11 = 21'h00_0000 ;
109
        endcase
110
    end
111
end
112
 
113
endmodule

powered by: WebSVN 2.1.0

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