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 2

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

powered by: WebSVN 2.1.0

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