Information Technology Reference
In-Depth Information
200 Print "Test1 Passed....Component ID Test"
210 Dim TEST(4)
220 TEST(1)=&FFFFFFFF
230 TEST(2)=&AAAAAAAA
240 TEST(3)=&O55555555
250 TEST(4)=&O0
260 D9=&80000000
270 REG = &O60
280 REPEAT
290 TST = &O1
300 IOWRITE &CF8,2,D9 + REG
310 REPEAT
320 IOWRITE &CFC,2,TEST(TST)
330 IOREAD &CFC,2
340 If B1 <> TEST(TST) Then GoTo 450
350 TST = TST + &O1
360 UNTIL TST=&5
370 REG = REG + &O4
380 UNTIL REG=&68
390 Print "Test2 Passed...Internal Register Test"
400 GoTo 480
410 Print "Test1 Failed...."
420 Print "Component ID Test...."
430 PRINT "Expected ID &10000E11 Actual ID "~B1
440 GoTo 480
450 Print "Test2 Failed...."
460 Print "Internal register test...."
470 PRINT "Register "~REG", Expected "~TEST(TST)" Actual "~B1
The code:
170 IOWRITE &CF8,2,&80000000
180 IOREAD &CFC,2
190 IF B1<>&10008086 THEN GOTO 410
writes the value 80000000h (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
10000E11h, where 1000h identifies the unit ID and 8086h identifies the manufacturer ID (In-
tel).
The values written to the registers are FFFFFFFFh (1111 1111 ... 1111), AAAAAAAAh
(1010 1010 ... 1010), 55555555h (0101 0101 ... 0101) and 00000000h. These values are then
read back and tested to determine if they match the values that where written.
Video device test
An example BASIC program to test the video adaptor on the PCI bus is given next.
2 Program 4.2
112 Print "PCI test: Component ID and PCI Register Test"
122 IOWRITE &CF8 ,2,&80005000
Search WWH ::




Custom Search