Part 7: Access to DDR from PL

Objective

This tutorial contains information on how to create a module in PL that can access to DDR memory without AXI DMA. The module does a black and white image invert operation.

Source Code

This repository contains all of the code required in order to follow this tutorial.


1. Hardware Design

1.1. RTL Design of Image Invert Core

This RTL module does a simple image invert operation for black and white image. It has one 8-bit input and one 8-bit output. Every input will be subtracted from 255 to produce the output.

1.2. Controller to Access DDR Memory

To access DDR memory from PL, we are going to use AXI Data Mover IP. This IP handles the AXI-Full protocol to provide access to DDR memory.

To use the AXI Data Mover IP, we need a simple state machine that generated instruction to control the AXI Data Mover IP.

The state machine consists of core (img_inv_ctrl.v) and AXI-Lite wrapper (axi_img_inv_ctrl.v).

This is the code for img_inv_ctrl.v.

This is the code for axi_img_inv_ctrl.v.

1.3. System Design

This diagram shows our system. It consists of an ARM CPU, DRAM, AXI Image Invert Control (), AXI Data Mover, and our AXI-Stream image invert module. Our AXI-Stream image invert module is connected to the AXI Data Mover. Between them, we also add AXI-Stream FIFO IP.

The following figure shows the Zynq IP high-performance port configuration. There are two pots enabled, which are AXI HP0 and AXI HP2.

The following figure shows the AXI Data Mover configuration.

This is the final block design diagram as shown in Vivado.

2. Software Design

First, we need to create access to the state machine module for the AXI Data Mover. Because it is just a memory map IP, so we use MMIO.

Prepare the input image. Declare several black and white image as arrays. The image is MNIST digit image 28x28 pixels.

This is the input image plotted by pyplot.

Process the image bytes with the image invert module.

Read and check the result.

This is the output image plotted by pyplot.

3. Full Step-by-Step Tutorial

This video contains detailed steps for making this project.

4. Conclusion

In this tutorial, we covered a tutorial on how to create a module in PL that can access to DDR memory without AXI DMA, but using AXI Data Mover. This method is suitable if the main control in in PL.

Last updated