Styx is an easy-to-use Zynq FPGA Module. Zynq SoC consists of Programmable Logic (PL) and Processing Subsystem (PS). SRAM programming of the PL part of Zynq is the same as other Xilinx 7 series FPGAs, but booting a bitstream from a flash is different in Zynq from other 7 series FPGAs. To boot a bitstream onto the PL part we need the help of Zynq Processing System IP and First Stage Bootloader Application. In this article, we will walk through all the steps from creating an RTL code for the PL part to programming a bitstream that will boot up from flash memory present on Styx FPGA Module.
- Styx Zynq Module
- Micro USB cable
- Xilinx Vivado Suite (version will change as per user)
- Tenagra FPGA System Management Software
Open Vivado Design Suite, go to File->Project->New. The New Project window will open. Click Next.
Enter a suitable name for the project and save it at a suitable location. Check the option “Create project subdirectory”. Click Next to continue.
In the Project Type window, select RTL Project and check the “Do not specify sources at this time” option. Click Next.
In the Default Part window, select “Styx” from the Boards option. If Styx is not listed, make sure board support files are installed correctly. Click Next to continue.
Click Finish to complete creating a new project. A new project will be created by Vivado with the selected settings.
Select Add Sources under the Flow Navigator ->PROJECT MANAGER section. Now select “Add or create design sources” and click Next.
Now, select Create File. The Create Source File window will open, select the suitable File type and give the file name as in the image below. Click OK and then click Finish.
Provide the Verilog/VHDL module that wants to be implemented (here the author had given the VHDL program for GPIO all high)
To create the constraints file, go to Add Sources under the Flow Navigator –> PROJECT MANAGER window, select the “Add or create constraints” and click Next.
Click on Create file and give a name for the XDC and select “File type” as XDC. Click OK and then Finish.
The XDC file is now created and is available in the Sources –> Constraints. Double click on it to open. Add the correct constraints for the design.
In the Flow Navigator panel, select Create Block Design under IP INTEGRATOR. Enter a name for the block design and click OK. An empty block design will be created.
Click Add IP,
Search for the ZYNQ7 Processing System and Add it.
Click Run Block Automation, select All Automation and click OK.
Go to Sources Tab, right-click on your Verilog or VHDL top module and select “Add Module to Block Design” which will add the RTL module to the block design.
Right-click the added module and select Make External.
Make sure the external pins have the same naming as that of constraint pins.
Select the Validate Design option from the Tools menu to ensure that connections are correct.
In the Sources window, right-click on the design and select Create HDL Wrapper. Click OK in the dialog box that appears.
Click Generate Bitstream under the PROGRAM AND DEBUG section of Vivado to synthesize, implement and generate the bitstream.
Once the bitstream is generated successfully, we need to export the hardware along with the bitstream. From the File menu, select Export -> Export Hardware.
Launch SDK from the File menu. Click OK.
Once the SDK window appears, select “Application Project” from the File menu -> New. We need to create an ‘fsbl (first stage boot loader)’ application. Type in a project name, leave other options as default and click Next.
Now select the Zynq FSBL template from the list of available templates and click Finish.
Once the project is created, SDK will automatically run a build. If that didn’t happen for any reason, run a build manually.
To create a bootable image and BIN file, go to Xilinx Tools -> Create Boot Image
In the create boot image window, provide a path for the Output BIF file and select Output format as BIN. Add the following files manually in boot image partitions,
- fsbl.elf (Bootloader)
- styx_bd_wrapper.bit (Bitstream)
Click on Create Image.
Booting from QSPI Flash
For programing the Styx Board, use Tenagra FPGA Management software, refer “Getting started with Tenagra FPGA System Management Software” article.
Program the flash with the created BIN file and will be able to observe the output.
Booting from SD card
After generating the bin file successfully, copy the bin file into the SD card. Change the Styx boot mode to SD Card by following instructions in the Styx User Manual. Insert the SD card into Styx and connect the micro USB cable. Power up the board to observe the output.