Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
learn:programmable-logic:tutorials:htsspisf:start [2020/06/09 07:58] – [Vivado Steps for creating the block design and generate bitstream] Monica Ignat | learn:programmable-logic:tutorials:htsspisf:start [2022/08/01 22:47] (current) – Made note that this guide is only compatible with 2019.1 and older. Will need a newer guide James Colvin | ||
---|---|---|---|
Line 9: | Line 9: | ||
This guide requires the existence of a Vivado project containing a Microblaze system built complete with **Quad SPI**, **External Memory**, and **Uart** cores, and that you have the appropriate QSPI mode jumper setting on the board. | This guide requires the existence of a Vivado project containing a Microblaze system built complete with **Quad SPI**, **External Memory**, and **Uart** cores, and that you have the appropriate QSPI mode jumper setting on the board. | ||
- | You can follow the steps presented in the [[https:// | + | You can follow the steps presented in the [[/ |
Since there are slight differences in the Vivado 2019.1 and the version in which the Microblaze tutorial was created, the user needs to check all the connections in the block design to make sure that are correctly made or present. | Since there are slight differences in the Vivado 2019.1 and the version in which the Microblaze tutorial was created, the user needs to check all the connections in the block design to make sure that are correctly made or present. | ||
=== Hardware === | === Hardware === | ||
Line 16: | Line 16: | ||
=== Software === | === Software === | ||
* **Xilinx Vivado 2019.1 with the SDK package.** | * **Xilinx Vivado 2019.1 with the SDK package.** | ||
+ | |||
=== Board Support Files === | === Board Support Files === | ||
Line 21: | Line 22: | ||
* //These files will describe GPIO interfaces on your board and make it easier to select your FPGA board and add GPIO IP blocks// | * //These files will describe GPIO interfaces on your board and make it easier to select your FPGA board and add GPIO IP blocks// | ||
* //Follow this Wiki guide ([[vivado: | * //Follow this Wiki guide ([[vivado: | ||
+ | |||
+ | <WRAP center round important 80%> | ||
+ | The xilisf library was officially depreciated by Xilinx starting in 2019.2 with the release of Vitis. This guide is only directly compatible with 2019.1 and older versions of the Xilinx software. | ||
+ | </ | ||
Line 103: | Line 108: | ||
=== 5. Adding UART IP Block === | === 5. Adding UART IP Block === | ||
- | * Go to {{: | + | * Go to **Add IP** and search for " |
- | {{:vivado:mig_17.jpg?500|}} | + | {{:learn:programmable-logic: |
* Select the **AXI Uartlite** IP block. | * Select the **AXI Uartlite** IP block. | ||
- | {{:vivado:mig_18.jpg?500|}} | + | {{:learn:programmable-logic: |
* This will add a UART block to the existing design. We need a UART controller to communicate between the terminal window on the Host-PC and the Nexys 4 DDR hardware. | * This will add a UART block to the existing design. We need a UART controller to communicate between the terminal window on the Host-PC and the Nexys 4 DDR hardware. | ||
Line 116: | Line 121: | ||
=== 6. Add AXI Quad SPI IP === | === 6. Add AXI Quad SPI IP === | ||
- | From the Add IP option, select AXI Quad SPI IP with the following customization: | + | From the Add IP option, select AXI Quad SPI IP with the following customization: |
{{: | {{: | ||
Line 122: | Line 127: | ||
=== 7. Running Connection Automation for the First Time === | === 7. Running Connection Automation for the First Time === | ||
- | * Select the **Run Connection Automation** from the //Designer Assistance// | + | * Select the **Run Connection Automation** from the //Designer Assistance// |
- | + | ||
- | {{: | + | |
- | + | ||
- | * Now select | + | |
The **clk_out2** pin will be manually connected later. | The **clk_out2** pin will be manually connected later. | ||
Line 132: | Line 133: | ||
**Do not select Run Connection Automation at this point**. | **Do not select Run Connection Automation at this point**. | ||
- | {{:nexys4-ddr:nexys4ddr-connectionauto.png?direct&500|}} | + | {{:learn:programmable-logic: |
=== 8. Perform some manual connections/ | === 8. Perform some manual connections/ | ||
Line 171: | Line 172: | ||
{{: | {{: | ||
- | ----- | + | * Select the button circled in blue. This is the {{: |
- | === 11. Second Manual Connection === | + | |
- | * Manually connect **clk_out2** output port signal on the **clk_wiz_1** to the **sys_clk_i** input port on the **mig_7series_0** block. **clk_out2** signal is the //200 Mhz// clock signal we have added during the Clock Wizard Block Automation step. | + | {{: |
- | {{: | ||
- | * Select the button circled in blue. This is the {{: | + | === 11. Regenerate |
- | {{: | ||
- | |||
- | ----- | ||
- | === 12. Regenerate layout and validate design === | ||
The result should look like in the below image representing the Block Diagram: | The result should look like in the below image representing the Block Diagram: | ||
- | === 13. Create HDL wrapper === | + | === 12. Create HDL wrapper === |
Right click on the Block Design, and select the Create HDL Wrapper option. | Right click on the Block Design, and select the Create HDL Wrapper option. | ||
- | === 14. Synthesize === | + | === 13. Synthesize === |
Open the synthesized design, and under I/O Ports tab below the page, check the name of the signals to be written in the XDC file. | Open the synthesized design, and under I/O Ports tab below the page, check the name of the signals to be written in the XDC file. | ||
- | === 15. Create an XDC file and add the constraints in it === | + | === 14. Create an XDC file and add the constraints in it === |
You can copy paste the syntax from the [[https:// | You can copy paste the syntax from the [[https:// | ||
--> XDC File signals # | --> XDC File signals # | ||
Line 274: | Line 269: | ||
</ | </ | ||
<-- | <-- | ||
- | === 16. Compress Bitstream (Optional) === | + | === 15. Compress Bitstream (Optional) === |
In certain applications (often when using the Cmod A7 with Microblaze) you might find that you do not have the necessary space in flash in order to store both your program and bitstream configuration. If this is the case it would be worth a try to compress your bitstream in order to get it to fit. Note that using a compressed bitstream in flash will not only take up less space but will also improve initial FPGA programming speeds. These steps take place in Vivado before the bitstream gets generated. | In certain applications (often when using the Cmod A7 with Microblaze) you might find that you do not have the necessary space in flash in order to store both your program and bitstream configuration. If this is the case it would be worth a try to compress your bitstream in order to get it to fit. Note that using a compressed bitstream in flash will not only take up less space but will also improve initial FPGA programming speeds. These steps take place in Vivado before the bitstream gets generated. | ||
* With your design ready to be generated into a bitstream select {{: | * With your design ready to be generated into a bitstream select {{: | ||
Line 293: | Line 288: | ||
* Now Vivado has been configured to output a compressed bitstream which will transfer to your SDK project. Select {{: | * Now Vivado has been configured to output a compressed bitstream which will transfer to your SDK project. Select {{: | ||
- | ===13. Export Hardware Handoff === | + | |
+ | ===16. Export Hardware Handoff === | ||
From File-> | From File-> | ||
Line 301: | Line 298: | ||
==== SDK Steps to create a bootloader and program the board ==== | ==== SDK Steps to create a bootloader and program the board ==== | ||
- | ===2. Create SPI Bootloader and BSP === | + | === 1. Create SPI Bootloader and BSP === |
* To create the bootloader, go to //File > New > Application Project//. | * To create the bootloader, go to //File > New > Application Project//. | ||
Name the bootloader then hit Next.\\ | Name the bootloader then hit Next.\\ | ||
Line 310: | Line 307: | ||
{{: | {{: | ||
- | ===1. Configure Bootloader BSP === | + | === 2. Configure Bootloader BSP === |
* Open the BSP project and open system.mss. Click " | * Open the BSP project and open system.mss. Click " | ||
- | * // | + | * // |
* serial_flash_interface = 1(AXI SPI) | * serial_flash_interface = 1(AXI SPI) | ||
Click " | Click " | ||
Line 318: | Line 315: | ||
{{: | {{: | ||
- | Next we need to update | + | Next we should check that the BSP is updated in order to use the updated version of **xilisf**. To do this, right click on the BSP and select **Board Support Package settings** and make sure that **xilisf** is checked. |
{{: | {{: | ||
- | * In your newly created bootloader application, | + | * In your newly created bootloader application, |
- | It is important to note that this value is the offset that the image will have in Flash. | + | It is important to note that this value is the offset that the image will have in Flash. |
NOTE: If you are using the Cmod-A7 try the offset: 0x00300000. | NOTE: If you are using the Cmod-A7 try the offset: 0x00300000. | ||
Line 336: | Line 334: | ||
{{: | {{: | ||
- | Make sure to re-build | + | NOTE: If you are using a board with Macronix flash follow |
+ | * Open **bootloader.c** from the sources and scroll down until you find the call to **XIsf_Initialize**. Double click the function name to highlight it, right click and select "Open Declaration" | ||
+ | * Add the following line somewhere near the top of **xilisf.c** | ||
+ | < | ||
+ | * In **xilisf.c** find the definition for IntelStmDevices[] and add the following: | ||
+ | < | ||
+ | XISF_BYTES256_PER_PAGE, | ||
+ | XISF_NUM_OF_SECTORS64}</ | ||
+ | * Save **xilisf.c** | ||
+ | <WRAP round important 1000px> | ||
+ | ===Important if you are using a board with Macronix flash.=== | ||
+ | The source files that need editing are part of a library (https:// | ||
+ | |||
+ | A more permanent solution is forking the library repository (https:// | ||
+ | </ | ||
+ | |||
+ | * Make sure to re-build the application after making these changes. | ||
=== 3. Program FPGA with bootloader === | === 3. Program FPGA with bootloader === | ||
+ | |||
The hardware design including bootloader will be programmed into flash such that the FPGA loads it every time it boots. Configure the SPI jumper on the Nexys4 DDR board on the QSPI position. This allows the FPGA to load its bit file from the SPI flash. The FPGA bit file contains the configuration of the FPGA including initial contents of the Microblaze local BRAM. \\ | The hardware design including bootloader will be programmed into flash such that the FPGA loads it every time it boots. Configure the SPI jumper on the Nexys4 DDR board on the QSPI position. This allows the FPGA to load its bit file from the SPI flash. The FPGA bit file contains the configuration of the FPGA including initial contents of the Microblaze local BRAM. \\ | ||
- | Next connect the Nexys4 DDR board via the JTAG usb connector. Start a serial terminal (eg. terraterm) and select the port and set the baud rate to 9600 (as configured in the UARTlite block design). | + | Next connect the Nexys4 DDR board via the JTAG usb connector. Start a serial terminal (eg. Teraterm) and select the port and set the baud rate to 9600 (as configured in the UARTlite block design). |
Select the bootloader.elf file (in the Bootloader/ | Select the bootloader.elf file (in the Bootloader/ | ||
Line 352: | Line 367: | ||
=== 4. Flashing FPGA === | === 4. Flashing FPGA === | ||
- | The **Program Flash Memory** utility will be used again to store the bitstream initialized with the bootloader in BRAM. | + | The **Program Flash Memory** utility will be used again to store the bitstream initialized with the bootloader in BRAM. Move the jumper on the board in the JTAG position. |
The **Image File** is the **download.bit** that was generated previously, and should be located inside of your hardware platform folder.The **Offset** is 0x0 since the bitstream will be loading our project into memory. Select **Program** to continue. The flash type is " | The **Image File** is the **download.bit** that was generated previously, and should be located inside of your hardware platform folder.The **Offset** is 0x0 since the bitstream will be loading our project into memory. Select **Program** to continue. The flash type is " | ||
- | After flashing you can restart the Nexys4 DDR by pressing the " | + | After flashing you can restart the Nexys4 DDR by pressing the " |
{{: | {{: | ||
- | ------ | + | |
=== 5. Create a User Application === | === 5. Create a User Application === | ||
+ | |||
This application will be the one that gets stored into Flash. For this tutorial we will be creating a simple **Hello World** project but the process applies to any project that you would want stored in flash. | This application will be the one that gets stored into Flash. For this tutorial we will be creating a simple **Hello World** project but the process applies to any project that you would want stored in flash. | ||
* Create a **Hello World** application. //File > New > Application Project// and name your app. Then select **Next**. | * Create a **Hello World** application. //File > New > Application Project// and name your app. Then select **Next**. | ||
Line 370: | Line 386: | ||
=== 6. Configure User App BSP === | === 6. Configure User App BSP === | ||
+ | |||
* Next we need to make sure to store our program in DDR. In order to do this, right click on the **Hello World** application, | * Next we need to make sure to store our program in DDR. In order to do this, right click on the **Hello World** application, | ||
Place all sections into DDR: | Place all sections into DDR: | ||
Line 382: | Line 399: | ||
{{: | {{: | ||
- | ------ | ||
=== 7. Program Flash === | === 7. Program Flash === | ||
+ | |||
In this step we will use the SDK **Program Flash Memory** utility to program our **Hello World** application to Flash. | In this step we will use the SDK **Program Flash Memory** utility to program our **Hello World** application to Flash. | ||
Line 400: | Line 417: | ||
{{tag> | {{tag> | ||
- | {{tag> | + |