Professional Documents
Culture Documents
LABORATORY REPORT
Submitted to
Of
MASTER OF TECHNOLOGY
in
KURUKSHETRA–136119.
HARYANA
2019 – 2020
1
NATIONAL INSTITUTE OF TECHNOLOGY
(INSTITUTE OF NATIONAL IMPORTANCE)
KURUKSHETRA-136119
HARYANA
CERTIFICATE
This is to certify that Teekam Chand Khandelwal studying M.Tech in Embedded System
Design bearing the Roll No. 31911117 has successfully completed 2 modules during the
academic year 2019-20 in the subject Embedded Application Lab.
Lab Supervisor:-
Dr. R.K.Sharma
Professor
Department of ECE
2
INDEX
3
EXPERIMENT NO. 1
Hardware:
❖ Zybo-Zynq board
❖ Micro-USB cable
❖ Headphones or speakers
❖ Audio input device
Software:
❖ Vivado Design suit 2018.1
• Newer/older version can be used, but the procedure may vary slightly
• Digilent board support files for vivado
https://reference.digilentinc.com/learn/software/tutorials/vivado-board-
files/start?redirect=1
Flow Chart
Zynq
Development Tools
All Zynq projects are developed on Xilinx Vivado Suite. For this project following tools
is used
Vivado IDE
The IDE is used for creating the HW base system. All features of the HW system are
controlled here: PS configuration, IP cores, external connections etc. The HW system can
be created using block design. The HW design can be exported from Vivado IDE to
Vivado SDK.
Vivado SDK
It is used for software design suite for the PS SW development. The programming
language supported by Vivado SDK is C and C++. It contains GCC compiler and drivers
for all Xilinx IP blocks.
5
The Vivado SDK is also launched from Vivado IDE for project to build SW application
that will be run on PS.
6
Required IPs
❖ LMS Filter
❖ LED controller
❖ NCO
❖ GPIO
❖ ZYNQ Processing system
❖ Processor System Reset
❖ ZYNQ audio controller
❖ AXI interconnect
Select board->ZYBO->next->Finish
7
IP Catalog->add repository->ok
8
Click on Create Block design->ok
9
Add IP->nco->double click
10
Led_controller_0->click on LEDs_out[3:0]->click external
11
Click on Run block Automation->ok
12
Click on Run connection automation->click on all automation->ok
13
Connect (if not connected) lms_pcore_0 (pcore_clk to axi4_lite_aCLK) and lms_pcore_0
(p_core_resetn to nco_0 (ap_rst_n))
14
Make external Zybo_audio_ctrl_0 pin (BCLK, PBLRCLK, RECLRCLK, PBDATA)
For make external, click on BLCLK->Right click->make external same follow for
(PBLRCLK, RECLRCLK, and PBDATA)
15
Click on clock Configuration->PL fabric clocks->check on FCLK_CLK1->DDR PLL->12.288
16
Make external pin IIC_0 and FCLK_clk1
17
RUN auto connection->click on S_AXI->OK
18
Make external AXI_GPIO_0
19
20
Address Editor (edit range as shown below)
Run synthesis
21
Generate bit stream->File->export hardware->File->launch SDK->OK Application project-
>project_ name->next->empty application->finish Right click on ‘LMS Filter’->import->file
system->next
>ok
22
System.mss->modify the BSP’s settings->drivers->ok Project name->src->import->general-
>file system->next
Drivers->browse-
>zybo/book/sources/zybo/adventures_with_ip_integrator/drivers>lms_pcore_adder.h>audio.h-
>finish
Src->software->browse->adventures_with_ip_c->adventures_with_ip.h->audio.c-
>ip_functions_c->finish Select “lms filter” in project explorer than click on ‘built debug’
Connect the zybo board with your pc using usb cable then right click on Xilinx tool->program-
>FPGA-
>Program
CONCLUSION:
In the FPGA, implementation of the audio processing system different input signals with a
large number of noises like sinusoidal noise etc. is sent to the programmed device. In each
combination of input and noise, the performance of the system is reliable with the noise being
effectively eliminated in each of the case. Thus, it can be concluded that LMS based Noise
filter is a effective algorithm to remove unwanted noise present in audio signals and thus be
used in Audio Processing applications.
OBJECTIVE:
To take the video signal from video player or Camera through HDMI input and process it
(using Sobel algorithm) and send it to VGA display.
PRE REQUISITE:
• Basic knowledge in using vivado HLS, HLx software and C language.
• Basic Knowledge on Zybo Board
THEORETICAL BACKROUND:
The entry cost of application-specific integrated circuit (ASIC) design is still high
despite advancements in fabrication technologies. Depending on the product, forecasts and
ASIC design might not be viable economically. Bridging the gap between generic processor
circuits and ASICs are FPGAs, allowing the use of blank reprogrammable hardware logic
elements to implements a custom circuit. It offers a lower barrier of entry to power savings and
performance benefits of fabrication technologies without the cost of ASIC. In addition, an
algorithm optimized for FPGA implementation benefits from the inherently parallel nature of
custom circuits.
HARDWARE USED:
Digilent ZYBO Z7 Development Boards are ready-to-use embedded software and digital circuit
development boards built around the Xilinx Zynq-7000 family. The family is based on the
Xilinx All Programmable System-on-Chip (AP-SoC) architecture, which integrates a dual-core
ARM Cortex-A9 processor with the Xilinx 7 FPGA logic. The Zybo Z7 comes in a Zybo Z7-10
variant that features Xilinx XC7Z010-1CLG400C and a Zybo Z7-20 variant that features the
larger Xilinx XC7Z020-1CLG400C. The Zybo Z7-20 variant includes SDoC voucher that
provides a familiar embedded C/C++ application development experience.
The Zybo Z7 surrounds the Zynq with a set of multimedia and connectivity peripherals to create
a formidable single-board computer. The Zybo platforms are video-capable and include MIPI
CSI-2 compatible Pcam connector, HDMI input, HDMI output, and high DDR3L bandwidth
FPGA ARCHITECTURE:
24
called a fabric, that routes signals between CLBs. Input/output (I/ O) blocks interface
between the FPGA and external devices. An individual CLB is made up of several logic
blocks. A lookup table (LUT) is a characteristic feature of an FPGA. An LUT stores a
predefined list of logic outputs for any combination of inputs: LUTs with four to six input
bits are widely used. Standard logic functions such as multiplexers (mux), full adders (FAs)
and flip-flops are common. This simplified CLB has two modes of operation. In normal
mode, the LUTs are combined with Mux 2 to form a four-input LUT; in arithmetic mode,
the LUT outputs are fed as inputs to the FA together with a carry input from another CLB.
Mux 4 selects between the FA output and the LUT output. Mux 6 determines whether the
operation is asynchronous or synchronized to the FPGA clock via the D flip-flop.
Vivado HLx
The Vivado Design Suite offers a new approach for ultra-high productivity with next generation
C/C++ and IP-based design. The new HLx editions include HL System Edition, HL Design
Edition and HL Web PACK Edition. When coupled with the new Ultra-Fast High-Level
Productivity Design Methodology Guide, users can realize a 10-15X productivity gain over
traditional approaches.
Unlike traditional RTL-based design where the majority of the design effort is spent in the
backend of the design process, C and IP based design allows for reduced development cycles in
verification, implementation and design convergence, so designers can focus on their
differentiated logic. This flow includes:
Rapid generation of the platform connectivity design, along with the necessary software stack.
Using high levels of abstraction, design teams can quickly get overall better or equal Quality of
Results (performance, power, utilization).
Vivado HLS
Advanced algorithms used today in wireless, medical, defense, and consumer applications are
more sophisticated than ever before. Vivado® High-Level Synthesis included as a no cost
upgrade in all Vivado HLx Editions accelerates IP creation by enabling C, C++ and System C
specifications to be directly targeted into Xilinx programmable devices without the need to
25
manually create RTL. Supporting both the ISE® and Vivado design environments Vivado HLS
provides system and design architects alike with a faster path to IP creation by:
FLOW CHART:
PROCEDURE: In this experiment, we will decode DVI input and forwards it to the VGA output.
1. Launch Vivado from the start menu and create a new project.
26
2. Click Next to name the project and then choose a folder for Project Location Click Next
twice
3. Choose "RTL Project" for project type and make sure "Do not specify sources at this time" is
ticked. Click Next.
27
4. Choose Zybo from the list and click next and then open project settings.
5. Select the IP category, ands in repository manager tab select the IP definitions and then click
OK.
6. Double-click on System Clock 16.Accept the default of instantiating a new Clocking Wizard.
28
Select HDMI In and accept the default DVI to RGB converter IP.
7. Add IP for VGA I.e. RGB to VGA output. Repeat for Video In to AXI4-Stream, AXI4
Stream to Video Out, Video Timing Controller and two instances of constants.
8. Right-click the doubt interface on the xlconstant_1 block and choose "Make External" Repeat
for rgb2vga_0/vga_pRed, rgb2vga_0/vga_pGreen, rgb2vga_0/vga_pBlue, rgb2vga_0/vga_pHS
sync, rgb2vga_0/vga_pVSync . Double click the v_tc_0 block and configure it.
29
9. Select clk_wiz_0 block and configure it. It should generate 200 Mhz clock from 125 MHz
onboard clock.
30
11. Click on the external port created for xlconstant_1, named dout[0:0] by default.
On the left, under External Port Properties modify the name field to "hdmi_hpd.
12. In the same manner, rename xlconstant_0 to zero, and set its value to ‘0’. Repeat it for
xlconstant_1 block and set its value to 1.
31
13. Click-and-hold on one interface and drag it to another to establish a connection. The
Regenerate Layout button on the toolbar to the left of the diagram will re- arrange the blocks
into a more readable layout.
32
14. Validate the design by clicking on the corresponding button on the toolbar on the left. There
should be no errors reported 41.If there are, revisit the wiring between blocks
15. Click on add sources and the n add constraints. Then click next and add files. Browse to the
provided video.xdc.
16. Click Generate Bit stream in the Flow Navigator on the left. Save the design and confirm
that synthesis and implementation should be run. When bit stream generation is completed,
choose "Open Hardware Manager", which is also accessible in Flow Navigator
33
17. Make sure the Zybo is connected to the PC via USB, it is turned on and the red PGOOD
LED is lit. Choose Open Target and Auto Connect from the Flow Navigator on the left
18. Click on Program device on the top 53.Click Program to download the bit stream file shown
there to the Zybo. The green DONE LED on the Zybo should light up
The video pipeline created above provides a good basis for image processing functions. The bus
between blocks “Video In to AXI4-Stream” and “AXI4-Stream to Video Out” is a streaming
interface sending data pixel-by-pixel in raster format. While it may seem unnecessary to convert
the RGB video data to AXI-Stream then back, this step ensures the greatest interoperability
between IPs. The RGB video stream is a continuous stream of pixels forming lines interleaved
by blanking intervals. It lacks a handshake mechanism that could stop the stream for a while when
the downstream processing logic requires it. AXI-Stream transmits data more efficiently by
packing pixel data and framing signals. Furthermore, thanks to handshake signals it allows for
buffering and stopping the stream momentarily. All Xilinx Video Processing IP use AXI-Stream
interfaces, if needed these can be easily inserted into the stream. Due to the streaming nature of
34
the data, different processing blocks can even be daisy- chained by attaching the output of one
to the input of another. This is called video processing pipeline. Therefore, our task is writing a
processing block that accepts an AXI-Stream RGB video input (argument), and outputs the
similarly formatted processed video data (argument).
1. Switch back to the video_pipeline project in Vivado we created above. Click Project
Settings on the left toolbar Select IP and Repository Manager Click the green plus sign
Browse to the project path For sobel edge detect ip Click Select and OK
2.Add HLS IP i.e Edge detect. click on the wire between v_vid_in_axis4s /video_out and
v_axi4s_vid_out /video_in Press the Delete key Wire video_out to stream_in of edge_detect
Wire stream_out to video_in.
3. Wire ap_clk of edge_detect to the pixel clock of the pipeline (PixelClk of dvi2rgb) Click the
plus icon next to ap_ctrl . Wire ap_start to the "one" Constant block Wire ap_rst_n to the same
"one" Constant block
35
4. Generate Bitstream. Click program to download to programmable logic on the Zynq.
After applying the edge detextion algorithm, we will get the required output from the incoming
Video data as shown below:
36
CONCLUSION:
The video processing using Sobel edge detection algorithm is performed for Real time video
input from HDMI cable and VGA output is observed. The edges are detected properly and
sharply
37
38