2.2. Export Hardware to SDK¶
The 802.11 Vivado project generates the bitstream and hardware specification required by the MAC Software SDK project. The bitstream and hardware spec are exported from the Vivado IDE for use by the SDK.
The SDK Export process depends on whether you are targetting a PetaLinux project, or plan to create an SDK workspace to compile the standalone (not-Linux-enabled) MAC applications.
Export to PetaLinux¶
The PetaLinux tools import an archive from Vivado containing the FPGA bitstream, address map, and IP core software drivers. This archive is an HDF
file (Viavdo <= 2019.2) or an XSA
file.
To export the hardware archive from Vivado:
- Select
- In the Export dialog check Include Bitstream and leave Export To: set to
<Local to Project>
. - Find the archive in the
<vivado_proj_root>/<proj_name>.sdk
, copy the archive to your PetaLinux host - In the PetaLinxu project run
petalinux-config --get-hw-description <path_to_xsa_dir>
Refer to the PetaLinux docs for more details on updating hardware designs in PetaLinux projects.
Booting the 802.11 design with PetaLinux still requires MAC applications compiled in the Xilinx SDK. Refer to the PetaLinux Projects page for more details on the recommended flow.
New Standalone SDK Workspace¶
For standalone applications that do not use PetaLinux Vivado can create a new SDK workspace inside the Vivado project.
After the Generate Bitstream flow is complete, in the Vivado IDE:
- Select
- In the Export dialog check Include Bitstream and leave Export To: set to
<Local to Project>
.
This will create a new folder named <proj_name>.sdk
in your project folder. This .sdk
folder is an SDK workspace.
Launch the SDK with Exported Location and Workspace set to the default <Local to Project>
.
The SDK will launch and open the project’s new SDK workspace. The Project Explorer tab will contain a single project named wlan_top_wrapper_hw_0
. This is the SDK project which contains the bitstream and hardware spec exported from Vivado.
To use this new SDK workspace with the MAC code, you must create Create Board Support Package (BSP) projects for your new hardware project.
Create BSP Projects¶
The SDK requires a dedicated BSP project for each CPU in a hardware platform. The 802.11 FPGA design uses two MicroBlaze CPUs named CPU High and CPU Low. You must create the BSP project for each CPU.
The BSP projects must be named wlan_bsp_cpu_high
and wlan_bsp_cpu_low
. The SDK associates software and BSP projects by name - other BSP project names won’t work.
To create the BSP projects in the SDK:
- Select
- Set Project Name to
wlan_bsp_cpu_high
- Set CPU to
wlan_high_subsystem_cpu_high_mb_high
- Set Board Support Package OS to
standalone
- Click Finish
- The BSP Configuration dialog box will appear. Leave the default settings and click OK
The new BSP project will appear in the SDK Project Explorer tab. The SDK will immediately begin compiling the BSP code. Watch the SDK Console tab for compilation progress.
Warning
The SDK must finish building the first BSP before creating the second BSP
When the first BSP has finished building, repeat the process above with project name wlan_bsp_cpu_low
and CPU wlan_low_subsystem_cpu_low_mb_low
.
Completing SDK Workspace¶
Once the hardware project (exported from Vivado) and BSP projects (created above) are ready, the MAC software projects can be imported to complete the SDK workspace. Refer to the MAC Software SDK Workspace documentation for details.
Existing SDK Workspace¶
After making changes to the Vivado hardware design you must re-export the updated hardware to an existing SDK workspace.
We recommend the following process:
- Run the full Implementation and Generate Bitstream flow in Vivado
- Select
- In the Export dialog check Include Bitstream and leave Export To: set to
<Local to Project>
. Click OK. - Vivado will warn about “Module Already Exported”. Click Yes to continue (you want to overwrite the old hardware design).
The SDK workspace will now be updated with the new hardware design.
If the SDK is open during the Export process it might show a “Hardware Updated” warning. Be sure to accept the updated hardware.
There is a bug in the SDK which occasionally breaks the hardware update process. Look in the SDK Project Explorer tab and verify there is a single hardware project named wlan_top_wrapper_hw_platform_0
. If there is a second project named wlan_top_wrapper_hw_platform_1
, the hardware update failed. To fix this:
- In the SDK Project Explorer tab select both hardware projects, right-click and select Delete.
- In the “Delete Resources” dialog check Dleete project contents on disk, then click OK.
- Re-run the hardware export flow from Vivado to re-create the SDK hardware project
- Re-launch the SDK from Vivado to adopt the new hardware project in the SDK workspace