Bitstream

The FPGA adapter implements its functionality via bitstream images which can be loaded into the card.

The card supports two partitions, partitions 0 and 1, for bitstream images. Partition 0 should always contain a image that is known to work because it will be used as fallback in case partition 1 fails to load. If partition 0 fails to load, the card does not fall back to partition 1.

Checking the version of the bitstream

You can verify the version of the bitstream that is currently running using the following command:

# cat /sys/class/genwqe/genwqe<card_number>_card/version

Determining the currently used bitstream

$ cat /sys/class/genwqe/genwqe0_card/curr_bitstream

Updating the bitstream

Use the genwqe_update command line tool to update the bitstream image of the card. The command can be used as follows:

# genwqe_update -C <card number> -p <partition number (0 or 1)> <bitstream image file>

This will transfer the bitstream image file to the selected partition of the given card. Remember to always transfer a new image to partition 1 first to keep a bitstream that is known to work on partition 0. If you have only one card on the system, the card number will be 0. If you have more than one, they will be numbered 0, 1, and so on. The default partition is 1 after power cycling.

You can also check http://www-933.ibm.com/support/fixcentral/ (http://www-933.ibm.com/support/fixcentral/) for bitstream updates.

Changing the bitstream

You can change which partition the card will load the bitstream from on the next adapter initialization. To check which bitstream partition is being used currently, run the following command:

# cat /sys/class/genwqe/genwqe<card_number>_card/curr_bitstream

To change which partition the adapter should try to load the bitstream from on the next adapter initialization, run the following command:

# echo <partition number (0 or 1) >  /sys/class/genwqe/genwqe<card_number>_card/next_bitstream

This command will not change immediately which partition is being used. To reload the card bitstream, follow the procedures in the next section.

Reloading the bitstream

After choosing which bitstream partition to load, there are two ways of reloading the bitstream of the adapter: by performing a system power cycle (a reboot of the Power® VM LPAR or PowerKVM guest), or by using sysfs interface.
Note: The sysfs interface is not available on all driver versions. Check the sysfs interfaces provided by your driver version.

To reload the card bitsream via sysfs, run the following command:

# echo 1 >/sys/class/genwqe/genwqe<card_number>_card/reload_bitstream

By default, after a reboot of the card, the next_bitstream will be always set with the same value as curr_bitstream.

To verify if the reload was successful, check if the correct partition is being loaded and if the bitstream version is correct using the following commands:

# cat /sys/class/genwqe/genwqe<card_number>_card/curr_bitstream

# cat /sys/class/genwqe/genwqe<card_number>__card/version

To avoid problems with new bitstreams, update bitstream 0 first, activate it, and try it out. If bitstream 0 does not work for some reason, a power-cycle of the card will reactivate bitstream 1 and bitstream 0 can be set back to the old version. If it the new bitstream is successful,, bitstream 1 can be updated and reloaded to make the new version the default.