This script is used by the data streams optimizer on the target system to get the device root port, based on the device’s BDF address.
The script supports the Yocto Project*-based board support package.
You can copy and modify the script to support another OS. The script must meet the following requirements to maintain compatibility with the data streams optimizer:
Input: BDF address of the device on the target system as a command-line argument in the following format: BB:DD.FF
BB – PCI Bus number in hexadecimal format, followed by a colon (:)
DD – PCI Device number in hexadecimal format, followed by a decimal point (.)
FF – PCI Function number in hexadecimal format
Output: The script must only print the root port address in the format BB:DD.FF to STDOUT.
Error handling: Any nonzero value returned from the script will be interpreted as an error. Any additional logging should be printed to STDERR.
Command line: tools/target_scripts/bdf_converter.py aa:00.00
Return value: 0
STDERR: <some debug information>