Work with CAPI1.0 HDK project Ask your contact representative or write to capi@us.ibm.com to get a CAPI1.0 HDK project to start. This chapter only works for CAPI1.0, running on Power8.
Steps and directory structure We use an "Out-of-context" flow to generate a PSL dcp file. For a new FPGA card, following steps need to be done:
Four steps to build a PSL checkpoint
We use an "Out-of-context" flow to generate a PSL dcp file. The directory structure is as following:
HDK directory structure
In build_dir/Sources The "prj" directory includes the source file lists. The "top" directory includes the top design file "psl_fpga.vhdl" and the wrapper for AFU "psl_accel.vhdl" PSL source files are in "psl" directory. AFU source files are in "afu" directory. "cores" includes 4 Xilinx IP cores used by PSL. "xdc" are the constraint files used by PSL and the top design. In build_dir, psl_fpga.tcl is the script "entrance". It assigns the FPGA chip information, and the build flow. FPGA chip information is needed for a new FPGA card, for example: set device "xcku115" set package "-flva1517" set speed "-2-e" And some controlling bits are for two build flows: 1. Build a PSL checkpoint. 2. Build a whole FPGA image (including AFU).
Generate PSL Checkpoint (b_route_design.dcp) In this section, we just talk about the first build flow - "build a PSL checkpoint". Read it when you need to enable a FPGA card on CAPI1.0 or to fix a bug and update b_routed_design.dcp. The controlling bits should be set as: ####flow control set run.topSynth 1 set run.oocSynth 1 set run.tdImpl 0 set run.oocImpl 1 set run.topImpl 0 set run.flatImpl 0 The outfile file will be placed in "Checkpoint" directory, the file name is "b_route_design.dcp".
Upgrade Xilinx IP cores When a FPGA chip type is changed, or the Vivado tool version has been upgraded, you need to upgrade the Xilinx IP cores that are used in PSL module. PSL module has instantiated four Xilinx IP cores (in Sources/cores): pcie3_ultrascale_0 sem_ultra_0 (Soft Error Migration) clk_wiz_0 tx_wr_fifo Steps to upgrade them: Open Vivado GUI Create a new project. For the second time, just open the project with the four IP cores. Import IP cores (by importing *.xci files under "Source/cores/xxx" directory). For the second time, this step is not needed. Set FPGA type in Project Settings. Run "Tools->Report->Report IP Status" "Upgrade All" and read the upgrade log.
Small project to update IPs
Report IP Status
For PCIe IP, you need to change subsystem_id for a new card. Right click pcie3_ultrascale_0 -> Reconfig IP and change the subsystem ID field. Ask an IBM representative for the subsystem ID.
Input xdc files The IO pin package information for the new card should be provided by card vendor. Generally, they include Flash Interface, PCIe Interface and other interfaces like I2C and LED. Sample code with IO pins in b_phys.xdc: Refer to Xilinx document UG575 for detailed pin package information. Example: set_property PACKAGE_PIN AJ15 [get_ports {o_flash_a[1]}] set_property PACKAGE_PIN AK15 [get_ports {o_flash_a[2]}] set_property PACKAGE_PIN AH14 [get_ports {o_flash_a[3]}] set_property IOSTANDARD LVCMOS18 [get_ports {o_flash_a[1]}] set_property IOSTANDARD LVCMOS18 [get_ports {o_flash_a[2]}] set_property IOSTANDARD LVCMOS18 [get_ports {o_flash_a[3]}] Some other constraints also must be updated for the new selection of FPGA chip. It defines the floorplan for PSL. There is also a patch to keep VSEC address for Vivado2017.4 and newer Vivado version: set_property PF0_SECONDARY_PCIE_CAP_NEXTPTR 12'h400 [get_cells *pcihip0/psl_pcihip0_inst/inst/pcie3_uscale_top_inst/pcie3_uscale_wrapper_inst/PCIE_3_1_inst] This is the base address for VSEC registers. capi-utils uses it to set the register address to send bitstream data to flash controller. Update:This step is not needed after "ECAP update (#28)" commit of capi-utils in Feb 2018.
Run Vivado to generate PSL checkpoint vivado -mode batch -source psl_fpga.tcl -notrace The checkpoint file b_route_design.dcp will be generated and put in "Checkpoint" directory. With this checkpoint file, we can continue to build a full FPGA bit image and validate it on hardware.
Generate full FPGA image
Steps
Steps to build the full FPGA image
This time the controlling bits should be set to: ####flow control set run.topSynth 1 set run.oocSynth 0 set run.tdImpl 0 set run.oocImpl 0 set run.topImpl 1 set run.flatImpl 0
Check top design file psl_fpga.vhdl For a new card, the IO pins and functions may be different to your reference card design. So the logic in top file psl_fpga.vhdl needs to be updated. Similarly, the xdc file "……topimp.xdc" also needs to be updated.
Prepare filelist for psl_fpga.prj The "prj" file is a file list. It should contain all the AFU design files. Edit it.
Run Vivado Two sub steps are here. vivado -mode batch -source psl_fpga.tcl -notrace Now the bit file is generated vivado -mode batch -source write_bitstream.tcl -notrace Now you get the bin files to be program to the FPGA flash. For more information about FPGA configuration, please refer to Xilinx Document UG570. Then you can program the generated bin file to FPGA either by JTAG or on-line programming tools capi-utils