Getting Started with the Avnet Ultra96, Part 2: Simulate Using Model Composer

Getting Started with the Avnet Ultra96, Part 2: Simulate Using Model Composer



hello there how would you like to work with the color detection algorithm and then learn how to simulate it within Xilinx model composer I'm John Petrus with MathWorks and today I'm going to talk about getting started with the Abnett alter 96 Development Board this is the four-part video series and today's topic is simulation for the Xilinx model composer here's of the workflow we talked about in part 1 the blue arrows represent different stages in the project and the black text below describes products and companies where you can get the software and hardware pieces perform each stage today's focus is going to be building a system model and running simulation so we'll do that all within Xilinx model composer so I'll provide an overview of model composer I'll show you how to run tests explore trade-offs generated IP blocks create test benches and so forth and then as a summary I'll review what we've learned where to go for more information and I'll provide a preview a video number three model composer is a simulation and modeling environment that targets design links at PGA's it runs as an add-on to MATLAB and Simulink for math works if you want to learn more about model composer here's the main project product page on the design links website there's more detailed documentation here educational videos and a spot where you can download a 90 day evaluation copy so let's go ahead and start up design links model composer so you can see it invokes MATLAB from the math works and here's our main view screen our file hierarchy is on the Left column our command window is in the center column and our workspace isn't the right so we're going to call up a file named xmc color detection this is a simulant file that ships as a design example for model composer we're going to use this file instead of starting from scratch so we can get a jump start on our project work and here's the file this is a block diagram of our color detection system it accepts a input file dot avi format which is streaming red-green-blue data coming into our color detection block and then there's a dealer on the input the view around the output to show us what's happening during simulation we go down on one level there are three main pieces to this next function there's a converter stage that takes the input streaming data and converts the hue saturation and value format there's a threshold encase that picks out a specific color range and then an open and closed P piece that formats the output data correctly let me show you the function library model composer elements are here on the bottom there's a rich set of functions and blocks you can use for any new design or any existing design for example there's computer vision functions there's math operations and they're very rich feature set of functions to choose from so let's go ahead simulate and see what happens so here's our input viewer on the left and our output viewer on the right the input viewer is data coming from a camera mounted on a car driving down a street and it's picking out yellow street signs and sending that to the output so that's working correctly but suppose you wanted to change the color that the algorithm is detecting you would do that by going into the threshold change the low Q range to 100 change the high here and to 115 that happens to correspond to light blue so we'll Reese emulator and you can see the algorithm is now picking a picking out the light blue sky so that's functioning correctly let's go back to the yellow but let's pick a different input file so we do that by clicking on the input and browsing selecting apply and hitting recently in dat this is a maybe a different camera with different properties the different room with distinct lighting conditions different types of movement you know algorithm is still picking out yellow books behind the man in the office as the target and it's working correctly well let's suppose we're satisfied how our color detection algorithm is performing through simulation and different types of conditions and we want to generate an IP block on a test bench so you'd go into this model composer held here open it up and you would pick the hardware block you want to target which in our case is the Avnet alter 96 board and you can see it's here so I'll select that hit apply and then in the other compilation tab you can specify a target directory you've got a name your project for the output you can specify the IP block sits in generator output or C++ we're gonna leave that as IP catalog you can create an executed test bench here hit apply and then hit generate yeah and this part of the program takes a while to run so I am going to go ahead and pause and come back when we're done and it looks like our program is finished running and it's telling us here is the file path where the output is notice that you get a neat little report when everything's done regarding color detection performance estimates latency utilization etc so we now have an IP block and a test bench and we're ready to take that downstream and our project flow to the next step so let's go ahead and summarize what we saw in the video I showed you how to build up a system model using a design example of color detection I showed you how to run simulations with a model composer changing both the color and the input file and I showed you how to experiment and then at the end create a IP block on a test bench in the next video I'll go through how to elaborate the design and target a specific hardware architecture using lavato design suite from Xilinx thank you for listening

Leave a Reply

Your email address will not be published. Required fields are marked *