Real Time Hardware Co-Simulation of Edge Detection For Video Processing System
Real Time Hardware Co-Simulation of Edge Detection For Video Processing System
Abstract—A methodology for implementing real-time DSP presents a study case which is Sobel Edge Detector
applications on a field programmable gate arrays (FPGA) Application. In Section 4, Hardware/Software Co-Design in
using Xilinx System Generator (XSG) for Matlab is presented System Generator and experimental results are detailed.
in this paper. Section 5 shows some discussion and comparison .This
It presents architecture for Edge Detection using Sobel Filter
paper is concluded in Section 6.
for image processing using Xilinx System Generator. The
design was implemented targeting a Spartan3A DSP 3400 II. SYSTEM GENERATOR DESIGN FLOW FOR
device (XC3SD3400A-4FGG676C) then a Virtex 5 (xc5vlx50-
IMPLEMENTATION ON FPGA
1ff676). The Edge Detection method has been verified
successfully with no visually perceptual errors in the resulted The algorithms and concepts used to define the system
images. are modeled using high level software languages like
Matlab, Simulink and C. The Xilinx’s System Generator for
DSP is a new tool, which comes with a predefined block set
I. INTRODUCTION along with Matlab Simulink software packet and can be
used to implement the algorithms [1]. These high level
The emerging market for video processing systems languages can also be used to verify the accuracy of the
requires high-performance digital signal processing as well algorithms.
as low device costs appropriate for a volume application. Matlab is a high-level technical computing language and
Xilinx FPGA devices provide a platform with which to meet interactive environment for algorithm development, data
these two contrasting requirements. visualization, data analysis, and numeric computation [4]. In
A Xilinx tool, the System Generator for DSP [1], offers addition to the intellectual property functions provided in
an efficient and straightforward method for transitioning Matlab, the software packet is uniquely adept with vector-
from a PC-based model in Simulink to a real-time FPGA and array based waveform data at the core of algorithms,
based hardware implementation. which is suitable for applications such as image and video
The system model can be simulated in the Simulink processing.
environment. This higher abstraction level reduces the Matlab-Simulink is an environment for multidomain
analysis and debugging time. For real hardware testing, simulation and Model-Based Design for dynamic and
Xilinx System Generator supports the possibility to perform embedded systems. It provides an interactive graphical
hardware in-the-loop co-simulation [2]. environment, event-driven simulator, and extensive library
This methodology provides easier hardware verification of parameterizable functions that allow design, simulate,
and implementation compared to HDL based approach. The implement, and test a variety of time-varying systems,
Simulink simulation and hardware-in-the loop approach including communications, controls, signal processing,
presents a far more cost efficient solution than other image and video processing [4]. Matlab-Simulink is used in
methodologies. The ability to quickly and directly realize a this application as the high level development tool in the
control system design as a real-time embedded system design process.
greatly facilitates the design process [3]. Xilinx System Generator [1], is a system-level modeling
The goal of this project was to implement an image- tool from Xilinx that facilitates FPGA hardware design. It
processing algorithm applicable to Edge Detection system in extends Simulink in many ways to provide a modeling
a Xilinx FPGA using System Generator for DSP, with a environment well suited for hardware design. The software
focus on achieving overall high performance, low cost and automatically converts the high level system DSP block
short development time. diagram to RTL. The result can be synthesized to Xilinx
The remainder of this paper is divided into five sections. FPGA technology using ISE tools. All of the downstream
After introducing, a description of System Generator design FPGA implementation steps including synthesis and place
flow for implementation on FPGA is presented, section 3
1 2 1
G x, y 0 0 0 I , (2)
1 2 1
G x, y G x, y G x, y (3)
G x, y |G x, y | G x, y (4)
G ,
θ x, y Arctan (5)
G ,
853
The Black Box block provides a way to incorporate System Generator provides a generic interface that uses
hardware description language (HDL) models into System JTAG and a Xilinx programming cable (e.g., Parallel Cable
Generator. IV or Platform Cable USB) to communicate with FPGA
The design of our architecture with Xilinx System hardware. “Fig. 4” shows the model with the JTAG-based
Generator is shown in “Fig. 2”.The Black Box contains our hardware co-simulation block implemented on Virtex 5
defined VHDL description for sobel operator. The platform.
subsystems in the simulation model allow serialization and Point-to-point Ethernet co-simulation provides a
the reconstruction of the image when the pixel output is straightforward high-performance co-simulation
generated by the hardware model. environment using a direct, point-to-point Ethernet
connection between a PC and FPGA platform.
The target FPGA chip is Xilinx Spartan 3A DSP 3400
In
Step RST
Y2
input/output interfaces, and synchronization.
“Fig. 5” shows the software and hardware simulation for the
B uint 8
Data Type
In1 Out1 In
Blue
blue Sobel Edge Detection design for the input image.
Conversion 2 Subsystem2
Black Box
ModelSim
System
Generator
Data Type
In1 Out1 In
Red
Conversion Subsystem
Blue
Data Type
In1 Out1 In
Green
Green
JTAG
o_Y1 Out In1
Red Y2
scheduling simulation events, and handling the exchange of B uint 8 In1 Out1 In
data between the Simulink and the HDL simulator. This is Data Type
Conversion 2 Subsystem2
Blue
RST
Step
In
RST
sg Black Box hw Co-sim
FPGA directly into a Simulink simulation. "Hardware Co- Figure 4: System Generator project for hardware-in-the-loop testing on
Simulation" compilation targets automatically create a Virtex 5 Platform
bitstream and associate it to a block. (“Fig. 3”)
When the system design is simulated in Simulink, results
for the compiled portion are calculated in actual FPGA
hardware, often resulting in significantly faster simulation
times while verifying the functional correctness of the
hardware. System Generator for DSP supports Ethernet as
well as JTAG communication between a hardware platform
and Simulink.
854
Table 1: FPGA RESOURCES USED IN THE IMPLEMENTATION FOR THE SOBEL EDGE DETECTOR
Spartan 3A DSP 3400 Virtex 5 xc5vlx50-1ff676
Used Available % Used Available %
Number of Slice Registers 2302 23872 9% 1798 28800 6%
Number of Slice LUTs 1755 47744 3% 2299 28800 7%
Number of LUT-FF pairs 3023 47744 6% 370 3727 9%
Number of bonded IOBs 34 469 7% 34 440 7%
Number of BUFG/BUFGCT 1 24 4% 1 32 3%
Number of DSP48s 3 126 2% - - -
Maximum Frequency 59.552 MHz 103.616 MHz
Table 2: PERFORMANCE COMPARISON
Our Design Design [9]
Used Available % Used Available %
Number of Slices 177 768 23 % 204 768 26 %
Number of Slice Flip Flop 401 1536 26 % 280 1536 18 %
Number of 4 input LUTs 277 1536 18 % 202 1536 13%
Number of bonded IOBs 34 124 27 % 81 124 65 %
Number of GCLKS 1 8 12 % 1 8 12 %
Maximum Frequency 54.505 MHz 134.756MHz
V. DISCUSSON
To provide a proper performance evaluation, the frequency and uses 177 CLB slices with 23% utilization, so
implemented Sobel Edge Detector architecture using low there is possibility of implementing some more parallel
cost available Spartan 3 development system with Xilinx processes with this architecture on the same FPGA.
chip XC3S50 -5PQ208. The properties of other designs Future works include the use of the Xilinx System
along with ours are listed in Table 2. As seen from this Generator development tools for the implementation of
table, the design of the Sobel Edge Detector proposed by [9] other blocks used in computer vision like feature extraction
requires 204 CLB on the basis clock rate of 134.756 MHz. and object detection on Xilinx Programmable Gate Arrays
On the other hand, our resulting architecture spent about (FPGA).
177 CLB with a working frequency up to 54.505 MHz.
Obviously, our proposed architecture has lower complexity REFERENCES
and improved efficiency in area, thus providing a good [1] Xilinx System Generator User's Guide,www.xilinx.com
choice in terms of low-cost hardware. [2] K.Van Beeck, F.Heylen, J.Meel, T.Goedemé, “Comparative study of
Xilinx system generator is a very useful tool for Model-based hardware design tools”, In proceedings of European
Conference on the Use of Moder Electronics in ICT, ECUMICT 2010,
developing computer vision algorithms. It could be Ghent, Belgium, 25-26 March, 2010
described as a timely, advantageous option for developing in [3] T. Saidani, D. Dia, W. Elhamzi, M. Atri and R. Tourki, “Hardware
a much more comfortable way than that permitted by VHDL Co-simulation For Video Processing Using Xilinx System Generator”
or Verilog hardware description languages (HDLs). Proceedings of the World Congress on Engineering 2009 Vol I,WCE
2009, July 1 - 3, 2009, London, U.K.
[4] http://www.mathworks.com/
VI. CONCLUSION [5] H. Neoh, A. Hazanchuk, “Adaptive Edge Detection for Real-Time
Xilinx system generator has a unique hardware in the loop Video Processing using FPGAs”, Global Signal Processing (2004)
co-simulation feature that allows designers to greatly [6] SHIGERU.A, “Consistent Gradient Operators”, IEEE Transactions
on Pattern Analysis and Machine Intelligence, 22 (3), 2000.
accelerate simulation while simultaneously verifying the [7] Dong, Q., Song, C., Ben, C., Quan, L., “A fast subpixel edge
design in hardware. detection method using Sobel-Zernike moments operator”, Image and
The purpose of this paper was to demonstrate the use of Vision Computing, Vol.23, pp.11-17, 2005.
[8] S. Mittal, S. Gupta, and S. Dasgupta, “System Generator: The State-
System Generator to design a system Edge Detection for
Of-Art FPGA Design Tool For DSP Applications”, Third
image processing. This design is implemented in the device International Innovative Conference On Embedded Systems, Mobile
Spartan 3A DSP 3400 (XC3SD3400A-4FGG676C) and Communication And Computing (ICEMC2 2008), August 11-14,
Virtex 5 (xc5vlx50-1ff676). 2008, Global Education Center, Infosys.
[9] T. A. Abbasi and M.U. Abbasi, “A proposed FPGA based
The implemented Sobel Edge Detector architecture using
architecture for sobel edge detection operator”, J. of Active and
low cost available Spartan 3 development system with Passive Electronic Devices, Vol. 2, pp. 271–277.
Xilinx chip XC3S50 -5PQ208 has 54.505 MHz maximum
855