1 -- VHDL model created from schematic config_space_header.sch -- Jan 09 09:34:16 2007
5 USE ieee.std_logic_1164.ALL;
6 USE ieee.numeric_std.ALL;
9 entity CONFIG_SPACE_HEADER is
10 Port ( AD_REG : In std_logic_vector (31 downto 0);
11 ADDR_REG : In std_logic_vector (31 downto 0);
12 CBE_REGn : In std_logic_vector (3 downto 0);
13 CF_RD_COM : In std_logic;
14 CF_WR_COM : In std_logic;
15 IRDY_REGn : In std_logic;
16 PCI_CLOCK : In std_logic;
17 PCI_RSTn : In std_logic;
19 REVISION_ID : In std_logic_vector (7 downto 0);
22 VENDOR_ID : In std_logic_vector (15 downto 0);
23 CONF_DATA : Out std_logic_vector (31 downto 0);
24 CONF_DATA_04H : Out std_logic_vector (31 downto 0);
25 CONF_DATA_10H : Out std_logic_vector (31 downto 0) );
26 end CONFIG_SPACE_HEADER;
28 architecture SCHEMATIC of CONFIG_SPACE_HEADER is
30 constant CONF_DEVICE_ID :std_logic_vector(31 downto 16) := X"AFFE";
32 constant CONF_CLASS_CODE :std_logic_vector (31 downto 8) := X"078000";
34 signal CONF_MAX_LAT :std_logic_vector (31 downto 24);
35 signal CONF_MIN_GNT :std_logic_vector (23 downto 16);
36 signal CONF_INT_PIN :std_logic_vector (15 downto 8);
37 signal CONF_INT_LINE :std_logic_vector ( 7 downto 0);
39 signal CONF_BAS_ADDR_REG :std_logic_vector(31 downto 0);
41 signal CONF_STATUS :std_logic_vector(31 downto 16);
42 signal CONF_COMMAND :std_logic_vector(15 downto 0);
44 SIGNAL gnd : std_logic := '0';
45 SIGNAL vcc : std_logic := '1';
47 signal CONF_WR_04H : std_logic;
48 signal CONF_WR_10H : std_logic;
49 signal CONF_WR_3CH : std_logic;
50 signal CONF_READ_SEL : std_logic_vector (2 downto 0);
51 signal CONF_DATA_04H_DUMMY : std_logic_vector (31 downto 0);
52 signal CONF_DATA_3CH : std_logic_vector (31 downto 0);
53 signal CONF_DATA_08H : std_logic_vector (31 downto 0);
54 signal CONF_DATA_00H : std_logic_vector (31 downto 0);
57 Port ( ADDR_REG : In std_logic_vector (31 downto 0);
58 CF_RD_COM : In std_logic;
59 READ_SEL : Out std_logic_vector (2 downto 0) );
63 Port ( ADDR_REG : In std_logic_vector (31 downto 0);
64 CF_WR_COM : In std_logic;
65 IRDY_REGn : In std_logic;
67 CONF_WR_04H : Out std_logic;
68 CONF_WR_10H : Out std_logic;
69 CONF_WR_3CH : Out std_logic );
73 CONF_DATA_00H <= CONF_DEVICE_ID & VENDOR_ID;
74 CONF_DATA_08H <= CONF_CLASS_CODE & REVISION_ID;
75 CONF_DATA_04H <= CONF_STATUS & CONF_COMMAND;
77 CONF_MAX_LAT <= X"00";
78 CONF_MIN_GNT <= X"00";
79 -- CONF_INT_PIN <= X"00"; -- Interrupt -
80 CONF_INT_PIN <= X"01"; -- Interrupt A
81 -- CONF_INT_PIN <= X"02"; -- Interrupt B
82 -- CONF_INT_PIN <= X"03"; -- Interrupt C
83 -- CONF_INT_PIN <= X"04"; -- Interrupt D
84 -- CONF_INT_PIN <= X"05 - FF0"; -- Reserviert
85 CONF_DATA_3CH <= CONF_MAX_LAT & CONF_MIN_GNT & CONF_INT_PIN & CONF_INT_LINE;
87 CONF_BAS_ADDR_REG(1 downto 0) <= "01";-- Base Address Register for "I/O"
88 CONF_BAS_ADDR_REG(3 downto 2) <= "00";-- IO Bereich = 16 BYTE
89 CONF_DATA_10H <= CONF_BAS_ADDR_REG;
92 Port Map ( ADDR_REG(31 downto 0)=>ADDR_REG(31 downto 0),
94 READ_SEL(2 downto 0)=>CONF_READ_SEL(2 downto 0) );
96 Port Map ( ADDR_REG(31 downto 0)=>ADDR_REG(31 downto 0),
97 CF_WR_COM=>CF_WR_COM, IRDY_REGn=>IRDY_REGn,
98 TRDYn=>TRDYn, CONF_WR_04H=>CONF_WR_04H,
99 CONF_WR_10H=>CONF_WR_10H, CONF_WR_3CH=>CONF_WR_3CH );
101 process (PCI_CLOCK,PCI_RSTn)
103 if PCI_RSTn = '0' then
104 CONF_INT_LINE <= (others => '0');
106 elsif (rising_edge(PCI_CLOCK)) then
107 if CONF_WR_3CH = '1'and CBE_REGn(0) = '0' then
108 CONF_INT_LINE(7 downto 0) <= AD_REG(7 downto 0);
113 process (PCI_CLOCK,PCI_RSTn)
116 -- if PCI_RSTn = '0' then CONF_BAS_ADDR_REG(31 downto 2) <= (others =>'0');
117 if PCI_RSTn = '0' then
118 CONF_BAS_ADDR_REG(31 downto 4) <= (others =>'0');
120 elsif (rising_edge(PCI_CLOCK)) then
122 if CONF_WR_10H = '1'and CBE_REGn(3) = '0' then
123 CONF_BAS_ADDR_REG(31 downto 24) <= AD_REG(31 downto 24);
125 CONF_BAS_ADDR_REG(31 downto 24) <= CONF_BAS_ADDR_REG(31 downto 24);
128 if CONF_WR_10H = '1'and CBE_REGn(2) = '0' then
129 CONF_BAS_ADDR_REG(23 downto 16) <= AD_REG(23 downto 16);
131 CONF_BAS_ADDR_REG(23 downto 16) <= CONF_BAS_ADDR_REG(23 downto 16);
134 if CONF_WR_10H = '1'and CBE_REGn(1) = '0' then
135 CONF_BAS_ADDR_REG(15 downto 8) <= AD_REG(15 downto 8);
137 CONF_BAS_ADDR_REG(15 downto 8) <= CONF_BAS_ADDR_REG(15 downto 8);
140 -- if CONF_WR_10H = '1'and CBE_REGn(0) = '0' then
141 -- CONF_BAS_ADDR_REG( 7 downto 2) <= AD_REG( 7 downto 2);
143 -- CONF_BAS_ADDR_REG( 7 downto 2) <= CONF_BAS_ADDR_REG( 7 downto 2);
146 if CONF_WR_10H = '1'and CBE_REGn(0) = '0' then
147 CONF_BAS_ADDR_REG( 7 downto 4) <= AD_REG( 7 downto 4);
149 CONF_BAS_ADDR_REG( 7 downto 4) <= CONF_BAS_ADDR_REG( 7 downto 4);
154 --*******************************************************************
155 --************* PCI Configuration Space Header "STATUS" *************
156 --*******************************************************************
158 CONF_STATUS(20 downto 16) <= "00000";-- Reserved
159 CONF_STATUS(21 ) <= '0';-- MAS/TAR: "R_O" :'0'= 33MHz / '1'= 66MHz
160 CONF_STATUS(22 ) <= '0';-- MAS/TAR: "R_O"
161 CONF_STATUS(23 ) <= '0';-- ???/???: "R_O" : fast back-to-back
162 CONF_STATUS(24 ) <= '0';-- Master :
163 --CONF_STATUS(26 downto 25) <= "00";-- Mas/Tar: "R_O" : timing fast for "DEVSEL"
164 CONF_STATUS(26 downto 25) <= "01";-- Mas/Tar: "R_O" : timing medium for "DEVSEL"
165 --CONF_STATUS(26 downto 25) <= "10";-- Mas/Tar: "R_O" : timing slow for "DEVSEL"
166 --CONF_STATUS(26 downto 25) <= "11";-- Mas/Tar: "R_O" : reserved
167 CONF_STATUS(27 ) <= '0';-- Target : "R_W" : Taget-Abort
168 CONF_STATUS(28 ) <= '0';-- Master : "R_W" : Taget-Abort
169 CONF_STATUS(29 ) <= '0';-- Master : "R_W" : Master-Abort
170 --CONF_STATUS(30 ) <= SERR;-- Mas/Tar: "R_W" : SERR
171 --CONF_STATUS(31 ) <= PERR;-- Mas/Tar: "R_W" : PERR
173 process (PCI_CLOCK,PCI_RSTn)
175 if PCI_RSTn = '0' then
176 CONF_STATUS(30) <= '0';
177 CONF_STATUS(31) <= '0';
179 elsif (rising_edge(PCI_CLOCK)) then
180 if CONF_WR_04H = '1' and CBE_REGn(3) = '0' then
181 CONF_STATUS(30) <= not (AD_REG(30) and CONF_STATUS(30));
182 CONF_STATUS(31) <= not (AD_REG(31) and CONF_STATUS(31));
185 CONF_STATUS(30) <= SERR or CONF_STATUS(30);
186 CONF_STATUS(31) <= PERR or CONF_STATUS(31);
192 --*******************************************************************
193 --*********** PCI Configuration Space Header "COMMAND" **************
194 --*******************************************************************
196 -- CONF_COMMAND( 0) <= '0';-- I/O Space accesses ???
197 -- CONF_COMMAND( 1) <= '0';-- Mem Space accesses ???
198 -- CONF_COMMAND( 2) <= '0';-- abillity to act as a master on the PCI bus
199 -- CONF_COMMAND( 3) <= '0';-- Special Cycle ???
200 -- CONF_COMMAND( 4) <= '0';-- Master ???
201 -- CONF_COMMAND( 5) <= '0';-- VGA ???
202 -- CONF_COMMAND( 6) <= '0';-- Party checking enable/disable
203 CONF_COMMAND( 7) <= '0';-- address/data stepping ???
204 -- CONF_COMMAND( 8) <= '0';-- enable/disable "PCI_SERRn"
205 -- CONF_COMMAND( 9) <= '0';-- fast back-to-back
206 -- CONF_COMMAND(10) <= '0';-- Reserved
207 -- CONF_COMMAND(11) <= '0';-- Reserved
208 -- CONF_COMMAND(12) <= '0';-- Reserved
209 -- CONF_COMMAND(13) <= '0';-- Reserved
210 -- CONF_COMMAND(14) <= '0';-- Reserved
211 -- CONF_COMMAND(15) <= '0';-- Reserved
213 process (PCI_CLOCK,PCI_RSTn)
215 if PCI_RSTn = '0' then
216 CONF_COMMAND(15 downto 8) <= (others =>'0');
217 CONF_COMMAND( 6 downto 0) <= (others =>'0');
219 elsif (rising_edge(PCI_CLOCK)) then
221 if CONF_WR_04H = '1'and CBE_REGn(1) = '0' then
222 CONF_COMMAND(15 downto 8) <= AD_REG(15 downto 8);
224 CONF_COMMAND(15 downto 8) <= CONF_COMMAND(15 downto 8);
227 if CONF_WR_04H = '1'and CBE_REGn(0) = '0' then
228 CONF_COMMAND( 6 downto 0) <= AD_REG( 6 downto 0);
230 CONF_COMMAND( 6 downto 0) <= CONF_COMMAND( 6 downto 0);