Download presentation
Presentation is loading. Please wait.
Published byRudolph Douglas Modified over 9 years ago
1
www.xilinx.com Section A A Step-By-Step Description of the System Generator Flow For a Colour Space Convertor In this section, a colour image stored as a bit map file is converted into 3 files containing pixel data for each of the primaries Red, Green and Blue. A script executed in the Matlab domain is used to create these files in the Matlab Workspace These separate files can then be accessed by a Simulink block diagram, which describes the structure of the RGB2YP B P R convertor of Figure 25. The Simulink model contains both an RGB2YP B P R and YP B P R 2RGB convertor core, so in addition to being able to review the monochrome YP B P R outputs, we can also review the output of the YP B P R 2RGB convertor core as a reconstructed bitmap. This exercise also identifies the need to have prior knowledge of the latency of the cores being used in the Simulink domain; this is easily obtainable from CORE Generator, but it demonstrates that you cannot be totally ignorant of the hardware implementation. Andy Miller © Copyright 2000 Xilinx - All Rights Reserved
2
www.xilinx.com System Generator Flow - Source Image 500 rows 500 pixels/row x 362 rows = 181000 pixels = 4.344 Million bits (24-bit colour). Each pixel = 8-bit Red + 8-bit Green + 8-bit Blue 362 lines Andy Miller © Copyright 2000 Xilinx - All Rights Reserved
3
www.xilinx.com SysGen Flow - Start New Project 1 Start Matlab, and then Simulink Andy Miller © Copyright 2000 Xilinx - All Rights Reserved
4
www.xilinx.com SysGen Flow - Open Simulink Project Use a Z -1 token to imply a register. A single register next to the inputs and outputs of the Xilinx domain will get mapped to the IOBs of the device. This will reduce the clock to setup and clock to out times of the FPGA. (i.e., data bandwidth increases.) Use a Z -1 token to imply a register. A single register next to the inputs and outputs of the Xilinx domain will get mapped to the IOBs of the device. This will reduce the clock to setup and clock to out times of the FPGA. (i.e., data bandwidth increases.) Red, Green and Blue pixel data are loaded from variables in the Matlab Workspace Red, Green and Blue pixel data are loaded from variables in the Matlab Workspace Andy Miller © Copyright 2000 Xilinx - All Rights Reserved
5
www.xilinx.com SysGen Flow - RGB2YP B P R core Note the use of CORE Generator Full multipliers with a constant input! This is None Optimal use of the device, as one input of the mutiplier is constant. A Constant Coefficient Multiplier should be used; however, at present, the CORE Generator Constant Coefficient Multiplier is not supported by the System Generator. It was decided to use the full multipliers to demonstrate the Smart-IP design advantages. Note the use of CORE Generator Full multipliers with a constant input! This is None Optimal use of the device, as one input of the mutiplier is constant. A Constant Coefficient Multiplier should be used; however, at present, the CORE Generator Constant Coefficient Multiplier is not supported by the System Generator. It was decided to use the full multipliers to demonstrate the Smart-IP design advantages. Andy Miller © Copyright 2000 Xilinx - All Rights Reserved
6
www.xilinx.com SysGen Flow - Setup Workspace This Matlab script is used to set up variables in the Matlab workspace. This script scans each pixel of the picture, splitting it into three separate arrays of Red, Green and Blue data. This Matlab script is used to set up variables in the Matlab workspace. This script scans each pixel of the picture, splitting it into three separate arrays of Red, Green and Blue data. Andy Miller © Copyright 2000 Xilinx - All Rights Reserved
7
www.xilinx.com SysGen Flow - Set up Workspace Execute the PreProc_flowers.m script to set up Matlab workspace. Notice how the variables appear in the Workspace viewer. Execute the PreProc_flowers.m script to set up Matlab workspace. Notice how the variables appear in the Workspace viewer. Andy Miller © Copyright 2000 Xilinx - All Rights Reserved
8
www.xilinx.com SysGen Flow - Run the Simulation Having set up the source and destination variables in the Matlab workspace, the simulation can be started. Be prepared to wait a while as it works its way through a lot of data!……. And consider that this is just a single frame. Any temporal processing that requires multiple frames may require considerable time to process. Having set up the source and destination variables in the Matlab workspace, the simulation can be started. Be prepared to wait a while as it works its way through a lot of data!……. And consider that this is just a single frame. Any temporal processing that requires multiple frames may require considerable time to process. Andy Miller © Copyright 2000 Xilinx - All Rights Reserved
9
www.xilinx.com Run a Post-Processing Script Now run a second script to perform two tasks: 1) Create images of the separate Y Cb Cr outputs; 2) Read the RGB outputs from the YPbPr2RGB convertor and see if the picture that has been converted from RGB to YPbPr and back to RGB has any visible differences from the original. Now run a second script to perform two tasks: 1) Create images of the separate Y Cb Cr outputs; 2) Read the RGB outputs from the YPbPr2RGB convertor and see if the picture that has been converted from RGB to YPbPr and back to RGB has any visible differences from the original. Andy Miller © Copyright 2000 Xilinx - All Rights Reserved
10
www.xilinx.com SysGen Flow - View the Output Execute the PostProc_flowers.m script to display the Luma and Colour difference channels as images; also, display the reconstructed images. (All RGB2YP B P R channels viewed as monochrome signals.) Execute the PostProc_flowers.m script to display the Luma and Colour difference channels as images; also, display the reconstructed images. (All RGB2YP B P R channels viewed as monochrome signals.) Y PBPB PRPR Andy Miller © Copyright 2000 Xilinx - All Rights Reserved
11
www.xilinx.com SysGen Flow - Check the Results Picture Out, … Oh dear! Picture In Something has clearly gone wrong, either in one or both of the conversions; the colours are clearly skewed within this image. Andy Miller © Copyright 2000 Xilinx - All Rights Reserved
12
www.xilinx.com - Remember to balance latency! Beware! At present, you must add the correct silicon latency to the cores via their masks, because this information isn’t characterized into the current Simulink models. Beware! At present, you must add the correct silicon latency to the cores via their masks, because this information isn’t characterized into the current Simulink models. Z -5 Z -2 Note how the delays are not balanced because we forgot to add delay to this mutliplier. Note how the delays are not balanced because we forgot to add delay to this mutliplier. Andy Miller © Copyright 2000 Xilinx - All Rights Reserved
13
www.xilinx.com SysGen Flow - Corrected output Picture In Picture Out - this is better! The pipeline delays are now balanced, and the image is reconstructed correctly, as the Y, P B and P R components are all associated with the same pixel. Andy Miller © Copyright 2000 Xilinx - All Rights Reserved
14
www.xilinx.com SysGen Flow - Export VHDL Files Double-click on this icon to set up the System Generator options... Double-click on this icon to set up the System Generator options... Andy Miller © Copyright 2000 Xilinx - All Rights Reserved
15
www.xilinx.com SysGen Flow - SysGen Token GUI Select your target technology: - Virtex - Virtex-II - Spartan-II Select your target technology: - Virtex - Virtex-II - Spartan-II Select a target directory for all the System Generator: -EDIFs -VHDs -TestBenches -Data files Select a target directory for all the System Generator: -EDIFs -VHDs -TestBenches -Data files Andy Miller © Copyright 2000 Xilinx - All Rights Reserved
16
www.xilinx.com SysGen Flow - Generating The Files Generate the output files Andy Miller © Copyright 2000 Xilinx - All Rights Reserved
17
www.xilinx.com SysGen Flow - Successful Process Completed. All output files are now written in the target directory and the next stage of the flow can take place...synthesis! All output files are now written in the target directory and the next stage of the flow can take place...synthesis! Andy Miller © Copyright 2000 Xilinx - All Rights Reserved (Press your “Page Down” key to end the presentation.)
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.