Information Technology Reference
In-Depth Information
124 IOREAD &CFC ,2
126 IF B1<>&00A81013 THEN PRINT : GOTO 172
128 Print " Passed....Component ID Test"
130 Dim TEST(4)
132 TEST(1)=&FF000000
134 TEST(2)=&AA000000
136 TEST(3)=&O55000000
138 TEST(4)=&O0
140 ADDR=&80005000
142 REG =&O10
144 REPEAT
146 TST = &O1
148 IOWRITE &CF8 ,2,ADDR + REG
150 REPEAT
152 IOWRITE &CFC ,2,TEST(TST)
154 IOREAD &CFC ,2
156 If B1 <> TEST(TST) Then Print: GoTo 180
158 TST = TST + &O1
160 UNTIL TST=&5
162 REG = REG + &O20
164 UNTIL REG=&50
166 Print " Test02 Passed....PCI Register Test"
168 GoTo 188
172 Print " FAIL: Component ID Test"
174 PRINT " Expected ID &00A81013 Actual ID "~B1
176 Print: GoTo 130
180 Print " FAIL: PCI Register Test...."
182 PRINT " Register "~REG", Expected "~TEST(TST)" Actual "~B1
188
etc
The code:
122 IOWRITE &CF8 ,2,&80005000
124 IOREAD &CFC ,2
126 IF B1<>&00A81013 THEN PRINT : GOTO 172
writes the value 80005000h (1000 0000 ... 0000b) to the CF8h register (configuration ad-
dress), where the most signification bit activates the configuration data register. Next the pro-
gram reads from the CFCh register (configuration data), after this the B1 value contains the
32-bit value read from the configuration data register. In this case the value will be the first
32 bits from the configuration memory of the PCI device. The value tested in this case is
00A81013h, where 00A8h identifies the Unit ID and 1013h identifies the manufacturer ID
(Cirrus Logic).
The following code tests four 32-bit words from the configuration memory. The values
written are:
FF000000h, AA000000h, 55000000h, 00h
These values are then read back and tested against the values actual written. It should be
noted that the least significant 24 bits are read-only registers, thus they cannot be written to.
Search WWH ::




Custom Search