Introduction to Xilinx System Generator
-
Upload
shruthig29111988 -
Category
Documents
-
view
68 -
download
6
description
Transcript of Introduction to Xilinx System Generator
![Page 1: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/1.jpg)
Introduction to Xilinx System Generator
![Page 2: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/2.jpg)
SimulinkoDeveloped by MathworksInc.oA Model-based design environment integrated
with Matlabo Provides various sets of block libraries to help you
create , simulate, and test a complicated system,including control system, communication, image processing, etc.
Introduction To Simulink And System Generator
![Page 3: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/3.jpg)
System GeneratoroDeveloped by Xilinx Corp.o Provides device-optimized DSP block library for
Simulinko Let you model DSP algorithm, generate HDL code,
and verify FPGA designs for Xilinx devices in a intuitive and efficient way.
![Page 4: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/4.jpg)
System Generator• Type Simulink at the MATLAB command prompt or
open the Simulink Library Browser by clicking the corresponding button in the MATLAB toolbar
![Page 5: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/5.jpg)
Simulink Library Browser
![Page 6: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/6.jpg)
Create a “new model” blank sheet by clicking the Create a new model button in the Simulink Library Browser
![Page 7: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/7.jpg)
Example 1 To read and display an image
![Page 8: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/8.jpg)
Go to Video and Image processing blocksets Sources
Image from file
Simulink Model
![Page 9: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/9.jpg)
![Page 10: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/10.jpg)
Go to Video and Image processing blocksets Sources
Image from file
Xilinx SysGen Model
![Page 11: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/11.jpg)
![Page 12: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/12.jpg)
• Reshape is an operator that is used to convert the dimensions.
• The parameter one dimensionality is chosen as 1-D array since the XSG accepts 1-D as the inputs.
![Page 13: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/13.jpg)
![Page 14: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/14.jpg)
![Page 15: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/15.jpg)
![Page 16: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/16.jpg)
• The number of bits is chosen as 8 since we are using a gray scale image.
• Quantization and overflow is kept as round and saturate by default.
![Page 17: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/17.jpg)
![Page 18: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/18.jpg)
• Buffer size:If an image of a X b is taken then the
buffer size should always be a*b.
Eg: 64X64 is the image size then buffer size must be 4096.
![Page 19: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/19.jpg)
• Reshape:At the output the parameters of reshape operator must
be:oDimentionality: CustomiseoDimension: it must be 2D since we are converting
back to the original image. Hence specify the size of original image
![Page 20: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/20.jpg)
![Page 21: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/21.jpg)
SYSTEM GENERATOR TOKEN
![Page 22: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/22.jpg)
SETTING THE STOP TIME• The run time/ stop time is always calculated as twice
the dimension of the matrix.• If the image is 64X64 then the stop time= 2*64*64.
![Page 23: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/23.jpg)
Simulation
![Page 24: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/24.jpg)
Stop time
![Page 25: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/25.jpg)
• Using Matrix Viewer
![Page 26: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/26.jpg)
•Workspace
![Page 27: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/27.jpg)
Output using Workspace
• After simulation the “output” is seen in the workspace.
![Page 28: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/28.jpg)
Output obtained is 1-D array.It has to be converted to 2-D array.
![Page 29: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/29.jpg)
•Write the callback function in the editor window and link to the model
![Page 30: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/30.jpg)
Output obtained
![Page 31: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/31.jpg)
NOTE:-
In order to carry out processing on an image the modules have to be placed between gateway in and gateway out
![Page 32: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/32.jpg)
Example 2 RGB to Gray Conversion
![Page 33: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/33.jpg)
• Reading RGB Image
![Page 34: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/34.jpg)
• Reading RGB Image
![Page 35: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/35.jpg)
• Conversion of RGB to Gray Image I=0.29*R+0.59*G+0.11*B• Creating module for
conversion
![Page 36: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/36.jpg)
• Creating module for conversion
![Page 37: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/37.jpg)
• Implementation of RGB Equation
![Page 38: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/38.jpg)
• RGB TO GRAY Conversion
![Page 39: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/39.jpg)
• RGB TO GRAY Conversion Output from Matrix Viewer
![Page 40: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/40.jpg)
• RGB TO GRAY Conversion Output from Workspace
![Page 41: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/41.jpg)
![Page 42: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/42.jpg)
• RGB TO GRAY Conversion Output from Workspace
![Page 43: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/43.jpg)
Example 3 Filtering
![Page 44: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/44.jpg)
• Filtering
• Reading an image
![Page 45: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/45.jpg)
• Filtering module
![Page 46: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/46.jpg)
• 5 x 5 Filter
![Page 47: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/47.jpg)
• Filtering
![Page 48: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/48.jpg)
• Set the Simulink System Period to 1/5 as 5*5 filter is used.
![Page 49: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/49.jpg)
• Filtering Output from Matrix Viewer
![Page 50: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/50.jpg)
• Filtering Output from Workspace
![Page 51: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/51.jpg)
• Filtering Output from Workspace
![Page 52: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/52.jpg)
Example 3 Enhancement
![Page 53: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/53.jpg)
• Enhancement
• Reading an image
![Page 54: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/54.jpg)
• Enhancement
![Page 55: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/55.jpg)
• Enhancement Output from Matrix Viewer
![Page 56: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/56.jpg)
• Enhancement Output from Workspace
![Page 57: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/57.jpg)
• Enhancement Output from Workspace
![Page 58: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/58.jpg)
Example 4 Negation
![Page 59: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/59.jpg)
• Negation
• Reading an image
![Page 60: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/60.jpg)
• Negation
![Page 61: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/61.jpg)
• Negation Output from Matrix Viewer
![Page 62: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/62.jpg)
• Negation Output from Workspace
![Page 63: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/63.jpg)
• Negation Output from Workspace
![Page 64: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/64.jpg)
Example 4 Binarization
![Page 65: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/65.jpg)
• Binarization
• Reading an image
![Page 66: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/66.jpg)
• Binarization
![Page 67: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/67.jpg)
• Binarization Output from Matrix Viewer
![Page 68: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/68.jpg)
• Binarization Output from Workspace
![Page 69: Introduction to Xilinx System Generator](https://reader031.fdocuments.us/reader031/viewer/2022020715/55cf9915550346d0339b7717/html5/thumbnails/69.jpg)
• Binarization Output from Workspace