Software PCI Simulator
Original Publication Date: 1999-Dec-01
Included in the Prior Art Database: 2003-Jun-18
Testing and Developing PCI (Peripheral Component Interconnect) code for a system BIOS can be an arduous process because the developer must take the compiled code each time an update is made and program it into a system ROM, then run the PCI code with the system BIOS. Machine lock-ups during development are common because of bugs in both BIOS and the PCI code. In order to debug the PCI code, the developer must use a hardware debugger. This process is not well suited to quick turn-around of bug fixing when developing new PCI code. The Software PCI Simulator simulates all software visible components of the PCI bus and interfaces to the developer through an OS command-line interface. A developer uses the simulator by compiling the source code of both the PCI code and the simulator itself. Then the developer launches the simulator and supplies a MAP file which describes the topography of the PCI bus, the config-space of each device in the system, a description of which bits in this config- space are hardwired and their associated values on power-up. During run-time, the simulator prints to the display the before and after pictures of the state of the PCI bus and its config spaces, which the developer can study to determine if there are bugs in the PCI code. The Developer's PCI code uses 'hooks' that run in the simulator instead of a physical computer. These hooks are the PCI config read and write commands (known to most developers as the 0xcf8 and 0xcfc addresses) to access PCI config space through standard IO. The end result is that the PCI code is not aware that it is running in a simulator instead of a real computer. The simulator allows the developer of PCI BIOS code to debug code on the same machine that is being used for the development of that code. The simulator also allows the developer to use Keyboard/Display IO commands formerly not available such as the 'printf' command in C, for instance. Also, because the MAP files are simple text files that are easy to change, the simulator allows the developer to see how the PCI configuration code would react to different PCI bus topographies. For example, topographies that are difficult or expensive to implement with today's technology, such as a system with 100 PCI busses.