This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Authoring a reference design for audio system on a ZYBO board

In this example, it is illustrated how to:

  1. Generate IP cores for peripheral interfaces using HDL Workflow Advisor

  2. Build a reference design to run an audio algorithm and access audio input and output on ZYBO board

Before You Begin

To run this example, you must have the following software and hardware installed and set up:

  • HDL Coder Support Package for Xilinx Zynq Platform

  • Embedded Coder Support Package for Xilinx Zynq Platform

  • Xilinx Vivado 2017.4

  • Digilent® Zybo Zynq™ development board with the accessory kit

To setup the ZYBO board, refer to the "Set up the Zybo board" section in the Define and Register Custom Board and Reference Design for Zynq Workflow article.

Introduction

In this example you will create a reference design which receives audio input from ZYBO board, performs some processing on it and transmits the processed audio data out of ZYBO board. To perform audio processing on ZYBO board, following 2 protocols are needed.

  1. I2C to configure the SSM2603 audio codec chip on ZYBO board.

  2. I2S to stream the digitized audio data between the codec chip and zynq fabric.

The above figure is a high level architecture diagram that shows how the reference design is used by the Filtering Algorithm IP on ZYBO board. This example is similar to the audio system reference design for Zedboard except that the ZYBO board uses a SSM2603 audio codec chip where as the Zedboard uses ADAU1761 audio codec chip. Rest of the operating parameters are same as the Audio System reference design for Zedboard. For more details please refer to Authoring a reference design for audio system on a Zynq board example.

The following steps are used to create the reference design described above:

  1. Generate IP Cores for peripheral interfaces

  2. Create a custom audio codec reference design in Vivado

  3. Create the reference design definition file

  4. Verify the reference design

1. Generate IP Cores for peripheral interfaces using HDL Workflow Advisor

In this example,

  1. I2C IP is developed using stateflow blocks & legacy VHDL code for tristate buffer.

  2. I2S IP is developed by modelling it in Simulink.

1.1 Creation of I2C IP

For creation of I2C IP to configure Audio Codec SSM2603, refer to IP Core Generation of an I2C Controller IP to Configure the Audio Codec Chip article.

1.2 Creation of I2S IP

Design a model in Simulink with a matlab function which implements the I2S protocol.

modelname = 'hdlcoder_I2S_ssm2603';
open_system(modelname);

Testing and IP core generation steps are same as Zedboard I2S model. For generation of I2S IP please refer to Authoring a reference design for audio system on a Zynq board example.

2. Create a custom audio codec reference design in Vivado

I2C, I2S and FIFO IPs are incorporated in the custom reference design. To create a custom reference design, refer to the "Create and export a custom reference design using Xilinx Vivado" section in the Define and Register Custom Board and Reference Design for Zynq Workflow example.

Key points to be noted while creating this custom reference design:

  1. We must understand the theory of operation of the audio codec chip on the ZYBO board.

  2. The FIFOs are set to default values for their configuration.

  3. For the IP cores generated using HDL Workflow Advisor, IPCORE_CLK and AXI4_Lite_ACLK should be connected to the same clock source.

  4. On validating the block design in Vivado, there should be no critical warnings except for the unconnected ports.

  5. In this reference design, the audio codec is configured to operate in the Master mode.

The following signals run between the reference design on Zynq Soc and the audio codec on ZYBO board:

  1. Bit_clock is the product of the sampling frequency, the number of bits per channel and the number of channels. It is driven by the audio codec in master mode. In this example, Sampling frequency is 48KHz, No of channels is 2, Number of bits per channel is 24.

  2. Serial_data_in is the analog to digital converted audio data from the codec.

  3. Serial_data_out is the digital audio data going to codec to be converted into analog form.

  4. I2C_CLK and I2C_DATA are standard I2C signals

  5. MUTEN is the Hardware mute pin connected to audio codec SSM2603.

  6. MCLK is the 12.288MHz clock signal required by the codec.

The custom audio codec reference design created for this example is shown below:

3. Create the reference design definition file

The following code describes the contents of the ZYBO board reference design definition file plugin_rd.m for the above reference design. For more details on how to define and register custom board, refer to Define and Register Custom Board and Reference Design for Zynq Workflow example.

Go to ZYBO folder using the following command:

cd ([matlabroot '/toolbox/hdlcoder/hdlcoderdemos/customboards/ZYBO']);

All files that are required for the reference design such as IP core files, XDC files, plugin_rd file etc should be added to the matlab path, inside ZYBO folder using the hierarchy shown below. The user generated IP core files should be in +vivado folder. plugin_rd.m, tcl files and xdc files should be in +vivado_audio_filter_2017_2 folder.

4. Verify the reference design

To verify the reference design, to generate Audio Filter IP core from a model and integrate it with the audio codec reference design, refer to Running an audio filter on live audio input using a Zynq board example.