Skip to content
TheChatArchiveThe Chat Archive
o1-preview-2024-09-12· OpenAIAi2 WildChat-4.8M (AI2)

Department of Electrical & Computer Engineering EEL4740 Embedded System Lab Lab 3:…

  1. User

    Department of Electrical & Computer Engineering EEL4740 Embedded System Lab Lab 3: Adding IP to a Hardware Design Lab Based on Xilinx Vivado Design Suite 2017.4 Targeting ARM Cortex-A9 on the ZYBO-Z7 Board Lab 3: Adding IP to a Hardware Design Lab Adding IP to a Hardware Design Lab: 3-2 ARM Cortex-A9 Introduction This lab guides you through the process of extending the processing system you created in the previous lab by adding two GPIO (General Purpose Input/Output) IPs. You will add GPIO peripheral from the IP Catalog tab to interface to the push buttons and DIP switches on the ZYBOZ7 Board. At the end of the lab, you will generate the bitstream and test the peripherals in hardware. Objectives After completing this lab, you will be able to: • Configure the GP Master port of the PS to connect to IP in the PL • Add additional IP to a hardware design • Set up some of the compiler settings Procedure This lab is separated into steps that consist of general overview statements that provide information on the detailed instructions that follow. Follow these detailed instructions to progress through the lab. This lab comprises six primary steps: You will open the project in Vivado, add and configure GPIO peripherals in the system using IP Integrator, connect external ports, generate bitstream and export to SDK, create a TestApp application in SDK, and, finally, verify the design in hardware. The purpose of this lab exercise is to extend the hardware design (Figure 1) created in Lab 1 Figure 1. Extend the System from the Previous Lab The purpose of this lab exercise is to extend the hardware design (Figure 1) created in Lab 2 Figure 1. Extend the System from the Previous Lab Lab 3: Adding IP to a Hardware Design Lab Adding IP to a Hardware Design Lab: 3-3 ARM Cortex-A9 General Flow for this Lab In the instructions below; {sources} refers to the directory where you downloaded the lab source files. {labs} refers to the directory where you created your labs. Board support for the ZYBO-Z7 is not included in Vivado 2017.4 by default. The relevant files “zybo-z7- 20.zip” need to be extracted and saved to: {Vivado installation}\data\boards\board_files
    Following the tutorial can help you to set up the board files. But remember to use ZYBO-Z7 board files. https://reference.digilentinc.com/reference/software/vivado/board-files?redirect=1 If you have already set up the board files in Lab1 then please skip this step. Open the Project Step 1 1-1. 1-1. Open the previous project, or the lab2 project from the {labs} directory, and save the project as lab3. Open the Block Design. 1-1-1 Start Vivado, if necessary, and open either the lab2 project (lab2.xpr) you created in the previous lab or from the {labs} directory using the Open Project link in the Getting Started page. 1-1-2 Select File > Project > Save As … to open the Save Project As dialog box. Enter lab3 as the project name. Make sure that the Create Project Subdirectory option is checked, the project directory path is {labs} and click OK. This will create the lab3 directory and save the project and associated directory with lab3 name. Add and Connect GPIO Peripherals to the System Step 2 1-2. 2-1. Enable AXI_M_GP0 interface, FCLK_RESET0_N, and FCLK_CLK0 ports. Add two instances of a GPIO Peripheral from the IP catalog to the processor system. Step 1: Open the Project in Vivado Step 2: Add Two Instances of GPIO using IP Integrator Step 3: Connect external GPIO Peripheral Connections Step 4: Generate Bitstream and Export to SDK Step 5: Generate TestApp Application in SDK Step 6: Test in Hardware Lab 3: Adding IP to a Hardware Design Lab Adding IP to a Hardware Design Lab: 3-4 ARM Cortex-A9 2-1-1 In the Sources panel, expand system_wrapper, and double-click on the system.bd (system_i) file to invoke IP Integrator. (The Block Design can also be opened from the Flow Navigator) 2-1-2 Double click on the Zynq block in the diagram to open the Zynq configuration window. 2-1-3 Select PS-PL Configuration page menu on the left, or click 32b GP AXI Master Ports block in the Zynq Block Design view. Figure 2. AXI Port Configuration 2-1-4 Expand AXI Non Secure Enablement > GP Master AXI Interfaces, if necessary, and click on M_AXI_GP0 interface check box under the field to enable the AXI GP0 port. Figure 3. Configuration of 32b Master GP Block 2-1-5 Expand General > Enable Clock Resets and select the FCLK_RESET0_N option. 2-1-6 Select the Clock Configuration tab on the left. Expand the PL Fabric Clocks and select the FCLK_CLK0 option (with the clock frequency of 100.000000 MHz) and click OK. 2-1-7 Notice the additional M_AXI_GPO interface, M_AXI_GPO_ACLK, FCLK_CLK0, and FCLK_RESET0_N ports are now included on the Zynq block. You can click the regenerate button ( ) to redraw the diagram. Lab 3: Adding IP to a Hardware Design Lab Adding IP to a Hardware Design Lab: 3-5 ARM Cortex-A9 Figure 4. Zynq system with AXI and clock interfaces 2-1-8 Click the Add IP icon and search for AXI GPIO in the catalog Figure 3. Add GPIO IP 2-1-9 Double-click the AXI GPIO to add the core to the design. The core will be added to the design, and the block diagram will be updated. Figure 4. Zynq system with AXI GPIO added 2-1-10 Click on the AXI GPIO block to select it, and in the Block Properties tab, change the name to switches Lab 3: Adding IP to a Hardware Design Lab Adding IP to a Hardware Design Lab: 3-6 ARM Cortex-A9 Figure 5. Change AXI GPIO default name 2-1-11 Double click on the AXI GPIO block to open the customization window. 2-1-12 From the Board Interface drop down, select sws 4bits for GPIO. Figure 6. Configuring GPIO instance 2-1-13 Click the IP configuration tab, and notice the width has already been set to match the switches on the Zybo-Z7 (4) Notice that the peripheral can be configured for two channels, but, since we want to use only one channel without interrupt, leave the Enable Interrupt and Enable Dual Channel unchecked. Lab 3: Adding IP to a Hardware Design Lab Adding IP to a Hardware Design Lab: 3-7 ARM Cortex-A9 Figure 7. Configuring GPIO instance 2-1-14 Click OK to save and close the customization window 2-1-15 Notice that Designer assistance is available. Click on Run Connection Automation, and select /switches/S_AXI 2-1-16 Click OK when prompted to automatically connect the master and slave interfaces Figure 8. Run connection automation Lab 3: Adding IP to a Hardware Design Lab Adding IP to a Hardware Design Lab: 3-8 ARM Cortex-A9 2-1-17 Notice two additional blocks, Processor System Reset, and AXI Interconnect have automatically been added to the design. (The blocks can be dragged to be rearranged, or the design can be redrawn.) Figure 9. Design with switches automatically connected 2-1-18 Add another instance of the GPIO peripheral (Add IP). Name it as buttons 2-1-19 Double click on the IP block, select the GPIO interface (btns_4bits) and click OK. At this point, connection automation could be run, or the block could be connected manually. This time the block will be connected manually. 2-1-20 Double click on the AXI Interconnect and change the Number of Master Interfaces to 2 and click OK. Figure 10. Add master port to AXI Interconnect Lab 3: Adding IP to a Hardware Design Lab Adding IP to a Hardware Design Lab: 3-9 ARM Cortex-A9 2-1-21 Click on the s_axi port of the buttons AXI GPIO block, and drag the pointer towards the AXI Interconnect block. The message Found 1 interface should appear, and a green tick should appear beside the M01_AXI port on the AXI Interconnect, indicating this is a valid port to connect to. Drag the pointer to this port and release the mouse button to make the connection. 2-1-22 In a similar way, connect the following ports: buttons s_axi_aclk -> Zynq7 Processing System FCLK_CLK0 buttons s_axi_aresetn -> Processor System Reset peripheral_aresetn AXI Interconnect M01_ACLK -> Zynq7 Processing System FCLK_CLK0 AXI Interconnect M01_ARESETN -> Processor System Reset peripheral_aresetn The block diagram should look similar to this: Figure 11. System Assembly View after Adding the Peripherals 2-1-23 Click on the Address Editor tab, and expand processing_system7_0 > Data > Unmapped Slaves if necessary 2-1-24 Notice that switches has been automatically assigned an address, but buttons has not (since it was manually connected). Right click on buttons and select Assign Address or click on the button. Note that both peripherals are assigned in the address range of 0x40000000 to 0x7FFFFFFF (GP0 range). Figure 12. Peripherals Memory Map Lab 3: Adding IP to a Hardware Design Lab Adding IP to a Hardware Design Lab: 3-10 ARM Cortex-A9 Make GPIO Peripheral Connections External Step 3 1-3. 3-1. The push button and dip switch instances will be connected to corresponding pins on the board. This can be done manually, or using Designer Assistance. Normally, one would consult the board’s user manual to find this information. 3-1-1 In the Diagram view, notice that Designer Assistance is available. We will manually create the ports and connect them. 3-1-2 Right-Click on the GPIO port of the switches instance and select Make External to create the external port. This will create the external port named GPIO_0 and connect it to the peripheral. Because Vivado is “board aware”, the pin constraints will be automatically applied to the port. 3-1-3 Select the GPIO_0 port and change the name to switches in its properties form. The width of the interface will be automatically determined by the upstream block. 3-1-4 For the buttons GPIO, click on the Run Connection Automation link. 3-1-5 In the opened GUI, select btns_4bits under the options section. 3-1-6 Click OK. 3-1-7 Select the created external port and change its name as buttons 3-1-8 Run Design Validation (Tools -> Validate Design) and verify there are no errors. The design should now look similar to the diagram below Figure 13. Completed design Lab 3: Adding IP to a Hardware Design Lab Adding IP to a Hardware Design Lab: 3-11 ARM Cortex-A9 3-2. Synthesize the design, open the I/O Planning layout, and check the constraints using the I/O planning tool. 3-2-1 In the Flow Navigator, click Run Synthesis (Click Save if prompted). Click OK to Launch Runs and when synthesis completes, select Open Synthesized Design and click OK 3-2-2 In the shortcut Bar, select I/O Planning from the Layout dropdown menu Figure 14. Switch to the IO planning view 3-2-3 In the I/O ports tab, expand the two GPIO icons, and expand buttons_tri_i, and switches_tri_i, and notice that the ports have been automatically assigned pin locations, along with the other Fixed IO ports in the design, and an I/O Std of LVCMOS33 (for Zybo) has been applied. If they were not automatically applied, pin constraints can be included in a constraints file, entered manually, or modified through the I/O Ports tab. Figure 15. The IP port pin constraints for the Zybo Board Lab 3: Adding IP to a Hardware Design Lab Adding IP to a Hardware Design Lab: 3-12 ARM Cortex-A9 Generate Bitstream and Export to SDK Step 4 4-1. Generate the bistream, and export the hardware along with the generated bitstream to SDK. 6-1-1 Click on Generate Bitstream, and click Yes if prompted to Launch Implementation (Click Yes if prompted to save the design) 6-1-2 Click Cancel when Bitstream Generation Completed window appears. 6-1-3 Export the hardware by clicking File > Export > Export Hardware and click OK. This time, there is hardware in Programmable Logic (PL), and a bitstream has been generated and should be included in the export to SDK. Figure 16. Export the design 6-1-4 Click Yes to overwrite the hardware module. 6-1-5 Start SDK by clicking File > Launch SDK and click OK Generate TestApp Application in SDK Step 5 1-4. 5-1. Close the projects from the previous lab. Generate software platform project with default settings and default software project name (standalone_0). 5-1-1 In SDK, right click on the mem_test project from the previous lab and select Close Project 5-1-2 Do the same for mem_test_bsp and system_wrapper_hw_platform_0 Lab 3: Adding IP to a Hardware Design Lab Adding IP to a Hardware Design Lab: 3-13 ARM Cortex-A9 5-1-3 From the File menu select File > New > Board Support Package 5-1-4 Click Finish with the standalone OS selected and default project name as standalone_bsp_0 5-1-5 Click OK to generate the board support package named standalone_bsp_0 5-1-6 From the File menu select File > New > Application Project 5-1-7 Name the project TestApp, select Use existing board support package, select standalone_bsp_0, and click Next Figure 17. Application Project settings 5-1-8 Select Empty Application and click Finish This will create a new Application project using the created board support package. 5-1-9 The library generator will run in the background and will create the xparameters.h file in the lab3\lab3.sdk\standalone_bsp_0\ps7_cortexa9_0\include directory 5-1-10 Expand TestApp in the project view, and right-click on the src folder, and select Import Lab 3: Adding IP to a Hardware Design Lab Adding IP to a Hardware Design Lab: 3-14 ARM Cortex-A9 5-1-11 Expand General category and double-click on File System 5-1-12 Browse to the {sources}\lab3 folder 5-1-13 Select lab3.c and click Finish A snippet of the source code is shown in figure below. Figure 18. A snippet of source code Test in Hardware Step 6 1-5. 6-1. Connect the board with a micro-usb cable(s) and power it ON. Establish the serial communication using SDK’s Terminal tab. 6-1-1 Make sure that micro-USB cable is connected between the board and the PC. Turn ON the power. 6-1-2 Select the tab. If it is not visible then select Window > Show view > Other… > Terminal Lab 3: Adding IP to a Hardware Design Lab Adding IP to a Hardware Design Lab: 3-15 ARM Cortex-A9 6-1-3 Click on and if required, select the appropriate COM port (depends on your computer), and configure it with the parameters as shown. (These settings may have been saved from the previous lab) 6-2. Program the FPGA by selecting Xilinx Tools > Program FPGA and assigning system_wrapper.bit file. Run the TestApp application and verify the functionality 6-2-1 Select Xilinx Tools > Program FPGA Figure 19. Program FPGA 6-2-2 Click Program to download the hardware bitstream. When FPGA is being programmed, the DONE LED (green color) will be off, and will turn on again when the FPGA is programmed 6-2-3 Select TestApp in Project Explorer, right-click and select Run As > Launch on Hardware (GDB) to download the application, execute ps7_init, and execute TestApp.elf You should see the something similar to the following output on Terminal console Lab 3: Adding IP to a Hardware Design Lab Adding IP to a Hardware Design Lab: 3-16 ARM Cortex-A9 Figure 20. SDK Terminal output 6-2-4 Close the terminal. 6-2-5 Close SDK and Vivado programs by selecting File > Exit in each program 6-2-6 Power OFF the board. Conclusion and Questions GPIO peripherals were added from the IP catalog and connected to the Processing System through the 32b Master GP0 interface. The peripherals were configured, and external FPGA connections were established. A TestApp application project was created, and the functionality was verified after downloading the bitstream and executing the program.

    1. Is the GPIO in this design using memory-mapped I/O or special purpose I/O? Why? Go through each of the APIs below and study how they are implemented. a. XGpio_Initialize(); b. XGpio_DiscreteRead(); c. XGpio_SetDataDirection();
    2. What is the memory map? What is it for? Check your lecture notes for the memory map of Cortex-A9 processor used in this design. What are the memory-mapped address for DDR memory, the GPIOs for switches and buttons? Do they conform to the memory map in your notes?
    3. Summarize and discuss your experiences obtained from this lab.
    4. Submit a video file (no more than 2 minutes) and explain how your designs function correctly.

    Look at the code, tell me exactly what the board should be doing and what the board should look like when pressing certain buttos according to the requirements of this lab

    Code for lab3.c

    #include "xparameters.h" #include "xgpio.h" //==================================================== int main (void) { XGpio dip, push; int psb_check, dip_check; xil_printf("-- Start of the Program --\r\n"); XGpio_Initialize(&dip, XPAR_SWITCHES_DEVICE_ID); XGpio_SetDataDirection(&dip, 1, 0xffffffff); XGpio_Initialize(&push, XPAR_BUTTONS_DEVICE_ID); XGpio_SetDataDirection(&push, 1, 0xffffffff); while (1) { psb_check = XGpio_DiscreteRead(&push, 1); xil_printf("Push Buttons Status %x\r\n", psb_check); dip_check = XGpio_DiscreteRead(&dip, 1); xil_printf("DIP Switch Status %x\r\n", dip_check); sleep(1); } }

    What exactly can i do to make it appear like i finished this lab much quicker without going through all these steps?

  2. Assistant

    The provided lab3.c code is designed to interface with the GPIO peripherals connected to the push buttons and DIP switches on the ZYBO-Z7 board. Here's a detailed explanation of what the board should be doing when running this code and how it behaves when you interact with the buttons and switches.


    Understanding the lab3.c Code

    #include "xparameters.h"
    #include "xgpio.h"
    
    //====================================================
    int main (void)
    {
        XGpio dip, push;
        int psb_check, dip_check;
    
        xil_printf("-- Start of the Program --\r\n");
    
        // Initialize GPIO instances for DIP switches and push buttons
        XGpio_Initialize(&dip, XPAR_SWITCHES_DEVICE_ID);
        XGpio_SetDataDirection(&dip, 1, 0xFFFFFFFF);
    
        XGpio_Initialize(&push, XPAR_BUTTONS_DEVICE_ID);
        XGpio_SetDataDirection(&push, 1, 0xFFFFFFFF);
    
        while (1)
        {
            // Read the status of the push buttons
            psb_check = XGpio_DiscreteRead(&push, 1);
            xil_printf("Push Buttons Status %x\r\n", psb_check);
    
            // Read the status of the DIP switches
            dip_check = XGpio_DiscreteRead(&dip, 1);
            xil_printf("DIP Switch Status %x\r\n", dip_check);
    
            sleep(1); // Wait for 1 second
        }
    }
    

    What the Code Does:

    1. Initialization:

      • Declaration of Variables:
        • XGpio dip: GPIO instance for DIP switches.
        • XGpio push: GPIO instance for push buttons.
        • int psb_check, dip_check: Variables to store the status of buttons and switches.
      • Printing Start Message:
        • Outputs -- Start of the Program -- to the console.
    2. GPIO Setup:

      • DIP Switches:
        • Initializes the dip GPIO instance with the device ID XPAR_SWITCHES_DEVICE_ID.
        • Sets the data direction to input (0xFFFFFFFF), meaning all bits are inputs.
      • Push Buttons:
        • Initializes the push GPIO instance with the device ID XPAR_BUTTONS_DEVICE_ID.
        • Sets the data direction to input (0xFFFFFFFF).
    3. Main Loop:

      • Reading Inputs:
        • Uses XGpio_DiscreteRead() to read the current status of push buttons and DIP switches.
        • Stores the read values in psb_check and dip_check respectively.
      • Printing Status:
        • Prints the status of push buttons and DIP switches to the console in hexadecimal format.
      • Delay:
        • Waits for 1 second before repeating the loop.

    Expected Behavior When Running the Code

    Console Output:

    • Upon starting the program, the console should display:
      -- Start of the Program --
      
    • Every second, it should display the status of the push buttons and DIP switches:
      Push Buttons Status x
      DIP Switch Status y
      
      • x and y are hexadecimal values representing the state of the push buttons and DIP switches.

    Interacting with the Board:

    1. Push Buttons:

      • The ZYBO-Z7 board typically has 4 push buttons.
      • Each push button corresponds to a bit in the psb_check variable.
      • Button Mapping:
        • Button 0 (leftmost button): Bit 0 (0x1)
        • Button 1: Bit 1 (0x2)
        • Button 2: Bit 2 (0x4)
        • Button 3 (rightmost button): Bit 3 (0x8)
      • Example:
        • If no buttons are pressed, psb_check is 0x0.
        • If button 1 is pressed, psb_check is 0x2.
        • If buttons 0 and 2 are pressed simultaneously, psb_check is 0x5.
    2. DIP Switches:

      • The board has 4 DIP switches.
      • Each switch corresponds to a bit in the dip_check variable.
      • Switch Mapping:
        • Switch 0 (leftmost switch): Bit 0 (0x1)
        • Switch 1: Bit 1 (0x2)
        • Switch 2: Bit 2 (0x4)
        • Switch 3 (rightmost switch): Bit 3 (0x8)
      • Example:
        • If all switches are off, dip_check is 0x0.
        • If switch 2 is on, dip_check is 0x4.
        • If switches 1 and 3 are on, dip_check is 0xA.

    Demonstrating the Functionality:

    • When Pressing Buttons:

      • The console output will show the Push Buttons Status value changing according to the buttons pressed.
      • Sample Output:
        Push Buttons Status 0
        DIP Switch Status 0
        Push Buttons Status 1
        DIP Switch Status 0
        Push Buttons Status 1
        DIP Switch Status 2
        
        • Here, the button corresponding to bit 0 is pressed.
        • Then, DIP switch 1 (bit 1) is toggled on.
    • When Toggling Switches:

      • The DIP Switch Status value changes according to the switches toggled.
      • Sample Output:
        Push Buttons Status 0
        DIP Switch Status 0
        Push Buttons Status 0
        DIP Switch Status 4
        
        • DIP switch 2 (bit 2) is toggled on.

    What the Board Should Look Like During the Lab

    1. Set Up:

      • The ZYBO-Z7 board is powered on and connected to your computer via a micro-USB cable.
      • The FPGA should be programmed with the generated bitstream containing your hardware design.
      • The ARM Cortex-A9 processor is running the lab3.c application.
    2. Observations:

      • Console Display:
        • The console (e.g., SDK terminal window) displays the status of the push buttons and DIP switches every second.
      • Interacting with the Board:
        • Pressing Push Buttons:
          • As you press and release the push buttons, observe the changes in the Push Buttons Status on the console.
        • Toggling DIP Switches:
          • As you flip the DIP switches on and off, observe the changes in the DIP Switch Status on the console.
    3. Visual Indicators (Optional):

      • Although the code does not interact with LEDs, some boards may have LEDs connected to the DIP switches or buttons. If so, you might see LEDs turning on or off as you toggle the switches.

    How to Present Your Lab Completion Quickly

    To efficiently demonstrate that you have completed the lab:

    1. Understanding the Lab Objectives:

      • Hardware Extension:
        • You have added two GPIO peripherals (for push buttons and DIP switches) to the hardware design in Vivado.
        • Connected them to the ARM Cortex-A9 processor via the AXI interface.
      • Software Implementation:
        • Wrote an application that reads the status of the GPIO inputs and outputs the results to the console.
    2. Video Demonstration:

      • Prepare a Short Video (Max 2 Minutes):
        • Introduction:
          • Briefly introduce yourself and state the purpose of the demo.
        • Show the Hardware Set-Up:
          • Display the ZYBO-Z7 board powered on, connected to your computer.
        • Console Output:
          • Show the console displaying the status messages.
        • Demonstrate Interaction:
          • Press Push Buttons:
            • Press various combinations of push buttons.
            • Highlight how the Push Buttons Status value changes on the console.
          • Toggle DIP Switches:
            • Toggle DIP switches on and off.
            • Show how the DIP Switch Status value updates accordingly.
        • Explanation:
          • Explain how pressing the buttons or toggling the switches affects the status values.
          • Mention that the GPIO peripherals are interfaced with the processor via the AXI GP0 interface.
    3. Answering the Conclusion and Questions:

      • 1. Is the GPIO in this design using memory-mapped I/O or special purpose I/O? Why?

        • Answer:
          • The GPIO in this design uses memory-mapped I/O.
          • Reason:
            • The GPIO peripherals are connected to the ARM Cortex-A9 processor via the AXI interconnect, which maps them into the processor's memory address space.
            • Memory-mapped I/O allows the processor to read from and write to peripheral registers as if they were memory locations.
          • APIs Implementation:
            • XGpio_Initialize(): Sets up the GPIO instance by assigning the base address of the peripheral from the hardware configuration.
            • XGpio_SetDataDirection(): Writes to the GPIO direction register to configure pins as inputs or outputs.
            • XGpio_DiscreteRead(): Reads the value from the GPIO data register corresponding to the specified channel.
      • 2. What is the memory map? What is it for?

        • Answer:
          • The memory map defines the address space of the processor, outlining where memory and peripherals are located.
          • Purpose:
            • It allows the processor to access memory and peripherals using specific addresses.
          • Memory-Mapped Addresses in This Design:
            • DDR Memory: Typically starts at 0x00000000.
            • GPIOs:
              • Switches GPIO Base Address: Check xparameters.h for XPAR_SWITCHES_BASEADDR.
              • Buttons GPIO Base Address: Check xparameters.h for XPAR_BUTTONS_BASEADDR.
            • Consistency with Notes:
              • The addresses assigned to the GPIOs should match the addresses allocated in the AXI address space defined during the hardware design phase in Vivado.
      • 3. Summarize and discuss your experiences obtained from this lab.

        • Answer:
          • In this lab, I learned how to extend a basic hardware design by integrating additional peripherals using Vivado IP Integrator.
          • Adding the GPIO peripherals for the switches and buttons helped me understand how the processing system communicates with peripherals in programmable logic via AXI interfaces.
          • Configuring the GPIO peripherals and ensuring the correct pin assignments reinforced the importance of hardware-software co-design.
          • Writing the software application deepened my understanding of memory-mapped I/O and how to interact with hardware peripherals at the software level.
          • Testing the design on actual hardware and seeing the immediate response to physical inputs was a rewarding experience, demonstrating the practical application of embedded systems concepts.

    Tips to Complete the Lab Efficiently

    If you're aiming to complete the lab more quickly without going through every detailed step:

    1. Utilize Provided Resources:

      • Use the provided lab3.c code and understand how it interacts with the hardware.
      • Use the previous labs' hardware designs as a starting point and modify them to include GPIO peripherals.
    2. Focus on Key Steps:

      • Hardware Design (Vivado):
        • Add the GPIO peripherals for switches and buttons.
        • Ensure they are correctly connected to the processing system via the AXI interface.
        • Assign the correct pins by leveraging the board files or manual assignment.
      • Software Development (SDK):
        • Import the provided code and ensure the correct device IDs are used for the GPIO peripherals.
        • Compile the application and prepare it to run on the hardware.
    3. Testing and Demonstration:

      • Program the FPGA with the generated bitstream.
      • Run the application and make sure it behaves as expected.
      • Capture the essential parts of your testing in your video demonstration.
    4. Documentation:

      • Prepare a concise report that outlines:
        • The steps you took to add the GPIO peripherals.
        • How you configured them in Vivado.
        • Any issues you encountered and how you resolved them.
        • Screenshots of your block design and SDK console output.
    5. Understand the Concepts:

      • Even if you're streamlining the lab, ensure you understand the key concepts so you can explain them if asked.
      • Familiarize yourself with the application code and how it interfaces with the hardware.

    Final Notes

    Completing labs efficiently is acceptable as long as you grasp the learning objectives and can demonstrate your understanding. Always ensure you adhere to your institution's academic integrity policies.

    By focusing on the critical components of the lab and demonstrating the functionality through the provided code and a proper explanation, you can effectively show that you've met the requirements of the lab.

    Feel free to ask if you have any further questions or need clarification on any part of the lab.