Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| learn:programmable-logic:tutorials:zedboard-getting-started-with-zynq:start [2016/07/14 17:54] – Sam Lowe | learn:programmable-logic:tutorials:zedboard-getting-started-with-zynq:start [2022/10/04 11:38] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Getting Started with Zynq ====== | ====== Getting Started with Zynq ====== | ||
| - | {{ :zybo:zybo_revb-box-1000.png?nolink& | + | |
| + | {{:reference:programmable-logic: | ||
| ===== Overview ===== | ===== Overview ===== | ||
| - | This guide will provide a step by step walk-through of creating a hardware design using the Vivado IP Integrator for the Zybo board. | + | This guide will provide a step by step walk-through of creating a hardware design using the Vivado IP Integrator for the Zedboard. |
| At the end of this tutorial you will have: | At the end of this tutorial you will have: | ||
| Line 12: | Line 13: | ||
| ----- | ----- | ||
| - | |||
| ===== Prerequisites ===== | ===== Prerequisites ===== | ||
| === Hardware === | === Hardware === | ||
| - | * **Digilent' | + | * **Digilent' |
| === Software === | === Software === | ||
| Line 22: | Line 22: | ||
| === Board Support Files === | === Board Support Files === | ||
| - | * **Zybo Support Files** | + | * **Zedboard |
| * //These files will describe GPIO interfaces on your board and make it easier to select your board in the initial design setup and add GPIO IP blocks in the block design// | * //These files will describe GPIO interfaces on your board and make it easier to select your board in the initial design setup and add GPIO IP blocks in the block design// | ||
| * //Follow this Wiki guide **[[vivado: | * //Follow this Wiki guide **[[vivado: | ||
| ----- | ----- | ||
| - | |||
| - | ===== Tutorial ===== | ||
| ==== General Design Flow ==== | ==== General Design Flow ==== | ||
| I. Vivado | I. Vivado | ||
| - | * Open Vivado and select | + | * Open Vivado and select |
| * Create an new Vivado Project | * Create an new Vivado Project | ||
| * Create empty block design workspace inside the new project | * Create empty block design workspace inside the new project | ||
| Line 49: | Line 47: | ||
| * Create new application project and select default Hello World template | * Create new application project and select default Hello World template | ||
| * Program FPGA and run application | * Program FPGA and run application | ||
| + | ----- | ||
| ==== 1. Creating a New Project ==== | ==== 1. Creating a New Project ==== | ||
| Line 56: | Line 54: | ||
| >1.1) Click on **Create New Project**. | >1.1) Click on **Create New Project**. | ||
| > | > | ||
| - | >{{:zybo:new_project.png?nolink& | + | >{{:reference:programmable-logic: |
| + | > | ||
| >1.2) You will be presented with the project creation wizard. Click **Next**. | >1.2) You will be presented with the project creation wizard. Click **Next**. | ||
| > | > | ||
| - | >{{:zybo:create_new.png?nolink& | + | >{{:reference:programmable-logic: |
| + | > | ||
| >1.3) Enter a project name and location the click **Next**. | >1.3) Enter a project name and location the click **Next**. | ||
| > | > | ||
| - | >{{:zybo:save_location.png?nolink& | + | >{{:reference:programmable-logic: |
| + | > | ||
| >1.4) Select **RTL Project** and click **Next**. | >1.4) Select **RTL Project** and click **Next**. | ||
| > | > | ||
| - | >{{:zybo:rtl_project.png?nolink& | + | >{{:reference:programmable-logic: |
| + | > | ||
| >1.5) This demo does not use any existing sources, existing IP or constraints. Click through the next three screens. | >1.5) This demo does not use any existing sources, existing IP or constraints. Click through the next three screens. | ||
| > | > | ||
| - | >{{:zybo:add_sources.png?nolink& | + | >{{:reference:programmable-logic: |
| - | >1.6) Select **Boards** and select the **Zybo** board file. Click **Next** and then **Finish**. | + | >1.6) Select **Boards** and select the **Zedboard** board file. Click **Next** and then **Finish**. |
| > | > | ||
| - | >{{:zybo:default_part.png?nolink& | + | >{{:learn:programmable-logic: |
| + | <WRAP center round tip 60%> | ||
| + | Make sure to select the board file made by Digilent. | ||
| + | </ | ||
| ----- | ----- | ||
| - | |||
| ==== 2. Creating a New Block Design ==== | ==== 2. Creating a New Block Design ==== | ||
| >2.1) Once the process has completed, click **Create Block Design** in the flow navigator. | >2.1) Once the process has completed, click **Create Block Design** in the flow navigator. | ||
| > | > | ||
| - | >{{:zybo:make_block_design.png?nolink&300|}} | + | >{{:reference:programmable-logic: |
| + | > | ||
| >2.2) Click **OK**. | >2.2) Click **OK**. | ||
| > | > | ||
| - | >{{:zybo:make_block_design1.png?nolink&500|}} | + | >{{:reference:programmable-logic: |
| + | > | ||
| >2.3) A blank Block Design will open up. | >2.3) A blank Block Design will open up. | ||
| > | > | ||
| - | > | + | > |
| ----- | ----- | ||
| - | |||
| ==== 3. Add the Zynq IP & GPIO Blocks ==== | ==== 3. Add the Zynq IP & GPIO Blocks ==== | ||
| >3.1) Click the {{: | >3.1) Click the {{: | ||
| > | > | ||
| - | >{{:zybo:zynq_block.png?nolink& | + | >{{:reference:programmable-logic: |
| + | > | ||
| >3.2) Click the **Run Block Automation** link | >3.2) Click the **Run Block Automation** link | ||
| > | > | ||
| - | >{{:zybo:block_auto_window.png?nolink& | + | >{{:reference:programmable-logic: |
| > | > | ||
| > Your Zynq block should now look like the picture below. | > Your Zynq block should now look like the picture below. | ||
| - | >{{ : | + | > |
| + | > | ||
| >3.3) Click the {{: | >3.3) Click the {{: | ||
| > | > | ||
| - | >{{:zybo:add_gpio_core1.png? | + | >{{:reference:programmable-logic: |
| + | > | ||
| >3.4) Double-click on new **axi_gpio_0** core that was just added to bring up the customizing window. Under the **IP Configuration** tab check the **Enable Dual Channel** box. Click **OK**. | >3.4) Double-click on new **axi_gpio_0** core that was just added to bring up the customizing window. Under the **IP Configuration** tab check the **Enable Dual Channel** box. Click **OK**. | ||
| > | > | ||
| - | >{{:zybo:setting_dual_channel.png?nolink& | + | >{{:reference:programmable-logic: |
| + | > | ||
| >3.5) Add another GPIO core by repeating step 3.4 but do not enable dual channel. | >3.5) Add another GPIO core by repeating step 3.4 but do not enable dual channel. | ||
| > | > | ||
| - | >{{:zybo:adding_gpio_core2.png?nolink& | + | >{{:reference:programmable-logic: |
| + | > | ||
| ----- | ----- | ||
| - | |||
| ==== 4. Run the Connection Automation Tool ==== | ==== 4. Run the Connection Automation Tool ==== | ||
| >4.1) The connection automation tool will add the required logic blocks for the demo. Select **Run Connection Automation** highlighted in blue. | >4.1) The connection automation tool will add the required logic blocks for the demo. Select **Run Connection Automation** highlighted in blue. | ||
| > | > | ||
| - | >{{:zybo:connection_auto.png?nolink& | + | >{{:reference:programmable-logic: |
| - | + | ||
| - | >4.2) Check the box by **All Automation**. Select **GPIO** under **axi_gpio_0** and select **btns_4bits** in the Board Part Interface drop-down box. | + | |
| > | > | ||
| - | > | + | >4.2) Check the box by **All Automation**. |
| - | + | ||
| - | >4.3) Select **GPIO2** under **axi_gpio_0** and select **swts_4bits** in the drop-down box. | + | |
| > | > | ||
| - | >{{:zybo:conn_auto2.png?nolink& | + | >{{:reference:programmable-logic: |
| - | + | > | |
| - | >4.4) Select **GPIO** under **axi_gpio_1** and select **leds_4bits** in the drop-down box and hit **OK**. | + | >4.3) Select **GPIO2** under **axi_gpio_0** and select **swts_8bits** in the drop-down box. |
| + | > | ||
| + | > | ||
| + | > | ||
| + | >4.4) Select **GPIO** under **axi_gpio_1** and select **leds_8bits** in the drop-down box and hit **OK**. | ||
| + | > | ||
| + | > | ||
| > | > | ||
| - | > | ||
| >4.5) This process will add: | >4.5) This process will add: | ||
| Line 145: | Line 145: | ||
| * Processor System Reset | * Processor System Reset | ||
| * The board parts for the buttons, switches and LEDs. | * The board parts for the buttons, switches and LEDs. | ||
| - | {{:zybo:sec_block_auto.png?nolink& | + | >{{:reference:programmable-logic: |
| + | > | ||
| >4.6) Next let's clean up our Block Design. Click the {{: | >4.6) Next let's clean up our Block Design. Click the {{: | ||
| > | > | ||
| - | >{{:zybo:regen_layout.png?nolink& | + | >{{:reference:programmable-logic: |
| + | > | ||
| ----- | ----- | ||
| - | |||
| ==== 5. Generate HDL Wrapper and Validate Design ==== | ==== 5. Generate HDL Wrapper and Validate Design ==== | ||
| Line 159: | Line 158: | ||
| >5.2) After the design validation step we will proceed with creating a HDL System Wrapper. In the block design window, under the **Design Sources** tab, right-click on the block diagram file. We labeled it " | >5.2) After the design validation step we will proceed with creating a HDL System Wrapper. In the block design window, under the **Design Sources** tab, right-click on the block diagram file. We labeled it " | ||
| > | > | ||
| - | >{{:zybo:generate_hdl_wrapper.png?nolink& | + | >{{:reference:programmable-logic: |
| This will create a top module in VHDL and will allow you to generate a bitstream. | This will create a top module in VHDL and will allow you to generate a bitstream. | ||
| ----- | ----- | ||
| - | |||
| ==== 6. Generate the Bitstream ==== | ==== 6. Generate the Bitstream ==== | ||
| >6.1) Click on **Generate Bitstream** at the bottom of the Flow Navigator. Wait for the process to complete and click OK. | >6.1) Click on **Generate Bitstream** at the bottom of the Flow Navigator. Wait for the process to complete and click OK. | ||
| > | > | ||
| - | >{{:zybo:generate_bitstream.png?nolink& | + | >{{:reference:programmable-logic: |
| ----- | ----- | ||
| - | |||
| ==== 7. Export hardware files for SDK ==== | ==== 7. Export hardware files for SDK ==== | ||
| >7.1) Go to file-> | >7.1) Go to file-> | ||
| > | > | ||
| - | >{{:zybo:export_hdwr.png?nolink& | + | >{{:reference:programmable-logic: |
| ----- | ----- | ||
| Line 185: | Line 182: | ||
| >8.1) Go to **File-> | >8.1) Go to **File-> | ||
| > | > | ||
| - | >{{:zybo:launch_sdk.png?nolink& | + | >{{:reference:programmable-logic: |
| ----- | ----- | ||
| - | |||
| ==== 9. Create a new Hello World Application Project ==== | ==== 9. Create a new Hello World Application Project ==== | ||
| >9.1) Go to **File-> | >9.1) Go to **File-> | ||
| > | > | ||
| - | >{{:zybo:sdk_new_app_project.png?nolink& | + | >{{:reference:programmable-logic: |
| + | > | ||
| >9.2) Enter the project details: | >9.2) Enter the project details: | ||
| - | * Project name: "getting_started_with_ZYBO" | + | * Project name: "zedboard_getting_started_with_zynq" |
| - | * Hardware Platform: | + | * Hardware Platform: |
| * Processor: ps7_cortexas9_0 | * Processor: ps7_cortexas9_0 | ||
| * Languate: C | * Languate: C | ||
| * OS Platform: standalone | * OS Platform: standalone | ||
| * Board Support Package: Create New (leave default name) | * Board Support Package: Create New (leave default name) | ||
| - | {{:zybo:sdk_project_details.png?nolink& | + | {{:reference:programmable-logic: |
| >9.3) The Hello World demo is a good starting point for this demo. Click **Next**, select **Hello World** and click **Finish**. This process will add two directories to the project explorer. | >9.3) The Hello World demo is a good starting point for this demo. Click **Next**, select **Hello World** and click **Finish**. This process will add two directories to the project explorer. | ||
| - | >9.4) Expand **getting_started_with_ZYBO** then open **src** and double click on " | + | >9.4) Expand **zedboard_getting_started_with_zynq** then open **src** and double click on " |
| + | > | ||
| + | > | ||
| > | > | ||
| - | > | ||
| ----- | ----- | ||
| - | |||
| - | ==== 10. Creating Our Own Hello World ==== | ||
| - | |||
| >10.1) Copy and paste the code below into the helloworld.c file. | >10.1) Copy and paste the code below into the helloworld.c file. | ||
| <code C> | <code C> | ||
| / | / | ||
| - | Getting Started Guide for Zybo | + | Getting Started Guide for Zedboard |
| This demo displays the status of the switches on the | This demo displays the status of the switches on the | ||
| Line 230: | Line 224: | ||
| -Stop bits: 1 | -Stop bits: 1 | ||
| - | 1/6/14: Created by MarshallW | + | 7/25/16: Created by JonP |
| ****************************************************/ | ****************************************************/ | ||
| Line 257: | Line 251: | ||
| | | ||
| switch_data = XGpio_DiscreteRead(& | switch_data = XGpio_DiscreteRead(& | ||
| - | | + | |
| XGpio_DiscreteWrite(& | XGpio_DiscreteWrite(& | ||
| Line 263: | Line 257: | ||
| //print message dependent on whether one or more buttons are pressed | //print message dependent on whether one or more buttons are pressed | ||
| - | if(button_data == 0b0000){} //do nothing | + | if(button_data == 0b00000){} //do nothing |
| - | + | ||
| - | else if(button_data == 0b0001) | + | else if(button_data == 0b00001) |
| | | ||
| - | else if(button_data == 0b0010) | + | else if(button_data == 0b00010) |
| | | ||
| - | + | ||
| - | else if(button_data == 0b0100) | + | else if(button_data == 0b00100) |
| | | ||
| - | + | ||
| - | else if(button_data == 0b1000) | + | else if(button_data == 0b01000) |
| | | ||
| - | | + | |
| + | else if(button_data == 0b10000) | ||
| + | xil_printf(" | ||
| else | else | ||
| | | ||
| usleep(200000); | usleep(200000); | ||
| - | + | ||
| } | } | ||
| | | ||
| Line 287: | Line 284: | ||
| } | } | ||
| </ | </ | ||
| + | |||
| ==== 11. Run the Project ==== | ==== 11. Run the Project ==== | ||
| - | >11.1) Make sure that the Zybo is connected to the host PC via the **UART** USB Port and that JP5 is set to JTAG. To program the FPGA, on the top toolbar, click the {{: | + | >11.1) Make sure that the Zedboard |
| + | |||
| + | > | ||
| >11.2) Save the project. | >11.2) Save the project. | ||
| - | > | + | > |
| - | >11.4) The demo will be running on the ZYBO. Try playing around with the 4 switches. Doing so should light its respective LED. Also over the serial port, each button | + | > |
| + | |||
| + | >11.4) The demo will be running on the Zedboard. Try playing around with the 4 switches | ||
| + | |||
| + | >11.5) Tera Term or any serial terminal will work as a Console for displaying the output of the BTN' | ||
| + | |||
| + | > Set up the terminal as: | ||
| + | |||
| + | > | ||
| ----- | ----- | ||
| + | |||
| + | {{tag> | ||

