Background technology
After PCI/PCI Express equipment such as sound card, video card, network interface card, TV adjuster card are installed in computer system, must detect the correctness that these PCI/PCI Express equipment are installed, with guarantee these PCI/PCI Express equipment can be in computer system operate as normal.The detection method of the correctness that traditional PCI/PCI Express equipment is installed comprises manual test and tests two kinds of methods automatically.The method of manual test is by comparing the Bus number of PCI/PCI Express equipment, the correctness whether setting value in the configuration documentation of device number and function number and computer system equates to come judgment device to install, because the Bus number of computer system settings, device number and function number depend on the particular hardware configuration of computing machine, thereby this method requirement user must be at first according to BOM (Bill of Material, equipment installation table) assembled a computing machine, on this computing machine, move the configuration documentation generator program then to generate configuration documentation, if there is alternative material (video card for example in some element of computing machine, when elements such as internal memory can be selected other model for use) also need to have assembled a computing machine in addition with this alternative material, repeat said process then and generate new configuration documentation, if all there are alternative material in several elements, then the operator will have to the difference configuration that institute might occur is generated the configuration documentations that overlap by said process more.This method needs the link of manual intervention many, and efficient is low and do not fit into the situation that has the plurality of replaceable material.
Automatic test method is by reading BIOS (Basic Input/Output system, basic input/output) routing table in (Routing Table) information is obtained slot (slot) information of computing machine, whether thereby it is correct to judge the PCI equipment of installing on the slot of appointment, but this method requires BIOS must preserve complete routing table, and in real work, some slot Information such as AGP (Accelerated Graphics Port that a lot of computing machines are arranged, Accelerated Graphics Port) slot is not recorded in the routing table, thus can't judge be installed on the AGP slot or PCI/PCI Express equipment that other is not recorded on the slot in the routing table whether correct.In addition, can also add subcard on some senior PCI/PCI Express plug-in card equipment, not be connected with mainboard owing to add subcard, but be additional on the master card, therefore at this moment utilize the self-checking function of BIOS also can't finish the detection task by slot.
Summary of the invention
In view of above content, be necessary to provide a kind of method that PCI equipment is installed correctness that comprehensively detects automatically.
A kind of computer PCI/PCI Express equipment is installed the detection method of correctness, be used to detect the correctness of the PCI/PCI Express equipment installation that is inserted on the computer slot to be measured, described computing machine to be measured comprises that one detects module, and the detection method that described computer PCI/PCI Express equipment is installed correctness may further comprise the steps at least: all possible hardware combinations of computing machine to be measured is recorded in the equipment installation table; Mainboard information, PCI/PCI Express facility information and the equipment installation table of each computing machine to be measured are saved in the database; Generate and described hardware combinations configuration documentation one to one according to each mainboard information of preserving in the database, PCI/PCI Express facility information and described equipment installation table; Described detection module travels through PCI/PCI Express device tree, and detects the correctness of each the PCI/PCIExpress equipment on the computing machine to be measured that is installed on according to described configuration documentation; And output test report.
The method that the present invention detects PCI/PCI Express equipment installation correctness is the purpose that reaches PCI/PCI Express Equipment Inspection robotization, information with each mainboard and all PCI/PCI Express plug-in card equipment is saved in the database earlier, detection system is installed table (BOM) according to equipment and is generated and the corresponding one by one configuration documentation of all possible hardware combinations, and transfer to computing machine to be measured, the test module of described computing machine to be measured is according to the attribute the correctness whether consistent PCI/PCI of judgement Express equipment is installed of the corresponding device of actual installation on the property value that writes down in the more described configuration documentation and this computing machine to be measured, needn't depend on the integrality of the Routing Table of BIOS, can detect all PCI/PCI Express equipment automatically, testing efficiency height, the scope of application are more extensive.
Embodiment
See also Fig. 1, the detection system that better embodiment computer PCI of the present invention/PCI Express equipment is installed correctness comprises a SQL (Structured Query Language, Structured Query Language (SQL)) database 10, a configuration documentation maker 20 and a UUT (Unit Under Test is at proving installation) worker stands 30.Described database 10 is used to preserve various mainboard information (comprising that the PCI plate carries facility information and slot Information), PCI/PCI Express equipment (network interface card, video card etc.) information and BOM table (Bill of Material, equipment is installed table).Described configuration documentation maker 20 links to each other with described database 10 and described UUTT station 30 by network, stands 30 in order to generate PCI/PCI Express configuration documentation and to transfer to described UUT worker according to BOM table, mainboard information and the PCI/PCI Express facility information preserved in the database 10.Described UUT worker stands and 30 comprises at least one computing machine to be measured, is equiped with various PCI/PCI Express equipment to be detected on the described computing machine to be measured, and described computing machine to be measured also comprises the detection module.After described detection module had detected all PCI/PCI Express equipment, described UUT worker stood and 30 automatically generates the report of PCI testing of equipments.PCI/PCI Express facility informations such as described mainboard information and network interface card, video card are with XML (Extensible Markup Language, extend markup language) form is stored in the described database 10, and described BOM table has write down the stand hardware combinations situation of computing machine to be measured of 30 various different hardware configurations of described UUT worker with the form of Excel (spreadsheet that Microsoft produces) form.
See also Fig. 2, the operation steps that the detection system of utilizing described computer PCI/PCI Express equipment that correctness is installed detects PCI/PCIExpress equipment installation correctness is as follows:
(1) various mainboard information and PCI/PCI Express facility information are saved in the described database 10.Mainboard packets of information rubbing board carries facility information and slot Information, the packets of information rubbing board that plate carries equipment carries information such as path, function number, Sort Code, manufacturer's sign, equipment sign, subsystem equipment sign, the subsystem manufacturer sign of equipment, and the path that plate carries equipment is made up of Bus number and device number; Slot Information comprises the path of slot, Bus number, information such as device number, function number.Described PCI/PCIExpress facility information comprises relative path, the Bus number of PCI/PCI Express equipment, device number, function number etc.Because except root bus (bus 0), the Bus number of other bus may change with the configuration of PCI/PCI Express equipment is different, thereby utilize relative path to indicate the installation site of PCI/PCI Express equipment and be stored in the described database 10, described relative path by arrive from certain bridge the designated equipment node the equipment of process form, the path of described bridge number indicates (for example the equipment 1 that adheres on the root bus (bus 0) among Fig. 4 is a bridge, and its path P ath=D01F00 refers to No. 0 function of No. 01 equipment) with device number and function.
(2) the B0M table is saved in the described database.
(3) described detection system according to the BOM that preserves in database table, mainboard information and PCI/PCI Express facility information generates and the BOM tabular goes out a configuration documentation of the corresponding generation of each hardware configuration situation (for example, write down the Component List of six kinds of different hardware configurations types in the BOM table, six parts of configuration documentations of then corresponding generation, concrete when detecting the computing machine of a certain type, access a configuration documentation corresponding and actual hardware with this type dispose to compare get final product); Described configuration documentation comprises information such as the path, Bus number, device number, function number of slot, the device name that is inserted in the PCI/PCI Express equipment on this slot, path, Bus number, device number, function number.
(4) on described UUT worker station, the configuration documentation that described detection module generates according to described detection system detects the correctness of each the PCI/PCI Express equipment on the computing machine to be measured that is installed on.
See also Fig. 3, the idiographic flow that described detection module test PCI/PCI Express equipment is installed correctness is as follows:
(41) bus/device tree (see figure 4) of traversal PCI/PCI Express equipment, obtain all the PCI/PCI Express list of devices on the UUT worker station, note the path and the relevant information of all devices, and dynamically revise respective value in the configuration documentation according to the actual Bus number of reading.Before the Bus number in revising configuration documentation, described detection module must find with at the corresponding configuration documentation of test computer particular hardware configuration.The method of described traversal PCI/PCI Express device tree is: the configuration space that at first number reads the bridge on the root bus (bus 0) according to the device number of the Bus number of root bus (bus 0) and bridge, function; The Bus number of next the bar bus (sub-bus) that obtains linking to each other from the configuration space of bridge then with this bridge; Again this sub-bus is traveled through afterwards; Repeat preceding two steps, up to finding all PCI/PCIExpress equipment.
(42) check one by one whether the value of information of the corresponding device that each property value that all plates in the configuration documentation carry equipment and actual (the actual hardware configuration of computing machine to be measured) are found is in full accord.
(43) whether the property value of checking the PCI/PCI Express equipment of installing on the host slot of computing machine to be measured is consistent with the value set in the configuration documentation.
(44) check on the computing machine to be measured whether have the PCI/PCI Express equipment that is not recorded in the configuration documentation.
(45) output test report.
See also Fig. 4, a PCI device tree comprises bus 0, bus 1 and bus 2.On bus 0, adhere to an equipment 0, equipment 1 (equipment 1 is a bridge in this better embodiment) and equipment 2 (three is plate and carries equipment), the function of described equipment No. 0 is 0, the function of described equipment No. 1 is 0, the function of described equipment No. 3 is 0 and 1 (having two kinds of functions), and the Bus number of described equipment 0, equipment 1 and equipment 2 is 0.On bus 1, adhere to equipment 0 and an equipment 1, described equipment 0 is one not plug the slot of pci card as yet, and described equipment 1 is one to have plugged the slot of a TV adjuster card, and described TV adjuster card comprises a bridge that bus 1 and bus 2 are coupled together.On bus 2, adhere to equipment 0 and an equipment 1, the function of equipment 0 and equipment No. 1 is 0.