First project with Vivado

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay so today I want to do a kind of a first project with Lovato and the Z board and do that I want to kind of walk through just a very basic blinking light project we're going to start off by making a new new project so we've got the lotto up and we're going to walk through the wizard here and we'll give it a name republic blinking light and I keep my project in a their own kind of directory automatically append a project name onto your project location folder this is a runtime logic project RTL and so we're going to go ahead and just leave it as that and I'm not going to do anything at this point we could either try to go through and select the exact set of parts that we want to include or build for or in this case we can use one of the existing reference boards that come with the of Abbado software the Zed board is the first choice here and this is actually what we're going to try to build for so as we make our way through this wizard we are now ready to begin the actual logic part of this thing we know that there's eight LEDs across the front of the board and I want to kind of make them into a blinker that blinks from right to left or left to right so to do that you know you need to use very log or VHDL this is going to be a barrel log based project called thank you and let's finish now we could go through here and enumerate all of the input ports where I want to have so we might want to have an input array set we might want to have a direction and we'll probably want to have the LED from the 12 and so basically we can roll through this definition or we could just type of this in ourselves this is just a little wizard to make the top module for us and save us a little bit of typing later on all right so here's our module one of the things I always do and I wish this was all to the wall is I want to change the default net type to become none so that way if I have a typo in the name of one of my signals down here it doesn't impact the rest of my project I've had that happen so many times so especially you're just learning this is a way to go normally we would still in this comment block in this case I want to make it kind of disappear so I'll click on this little minus sign so that it's out of my lab so now that we don't have a default net site all of these signals need to become wires and I'm going to go ahead and just use the output register form here so that the LEDs become a register so that I kind of sign right into it out why I have to have another register and then do another assign statement that's a little redundant so basically we're going to have is an always block and so always three says the one LEDs is equal to one and then basically we're just going to have direction don't miss the tas tiles here the indentation can be a little better alright so basically we just have our general logic here go off the lensman comment and so basically normally we could just do a shift but of course eyes shift is going to cause the light LED just kind of fall off the end and so i want to do a shift going to a rotate so if we're going to go from left to right then the least significant bit moves over one position sure from the right to left the least significant bit is going to move one position towards the most significant bit so that's the case LEDs is equal to the concatenation of LED of 6 per 0 so the position 0 moves over 1 the left and then LED 5 7 and that's actually a standard rotation similarly I can now rotate to the left to the right as you'd kind of expect I hope the most significant bit is going to move one position down and the zero is going to wrap from the most specific interest so then we're going to fill in LEDs of zero concatenated with LEDs of six to one and so this is a seven bit field here or shifted downwards okay so this is the basic blinky light and at this point I could easily go in here and make a simulation for this thing I'm pretty sure it's going to work just to kind of give you guys a net reduction to this thing I'm not going to worry about the simulation and do that in it in a different video normally at this point what we would do is go through the run synthesis and really we're going to get down to run implementation and once we get to that run implementation we'll be able to do the next couple of steps the first time through we need to be able to assign each of these wires and registers to a location on the FPGA so that they can be connected to the corresponding parts on the board when that's all done we'll come back so this took just a few minutes and at this point silence Lovato has generated an implementation and file and if we were ready to move to the next step I would go ahead and click on generate bitstream but in this case I want to open the implemented design and what this is going to do now is it's going to take me to a view of the actual kind of organization of the part and this you is showing me all of the different sites on the FPGA and so this is a 500 pin part and we have locations a through a B and then coordinates 1 through 22 and each one of these corresponds to a particular location on the ball grid array which is just a fancy name for all these different locations and so if we were imagine this part sitting on the board for instance part a one is connected somewhere now they're telling me some information for example a site type PS that stands anything it begins with that PS means it's part of the processing system that's the on board on board ARM cores are part of this zinc chip that the Z board uses so those are the terms that board refers to the reference board itself the zinc is the name for this at PG a series from filing we scroll down is another okay so this is a DDR so this is PS for the the DDR memory let's take a look at another guy here just let it mix day why so some of these guys like this user IO this is available for us to use there's no built-in assignment for one of these things when we see this it has decided kind of randomly that these pins here are already part of our design and in fact if I expand this down we see that the Xilinx tools have kind of randomly picked 10 assignments for the parts on our board and they're not right like they're just kind of randomly chosen and we need to fix that so what we're going to do is we're going to find the violent list of where things are and to do that we'll find the master constraint file so I'll bring up a web browser and do the board master constraint file we're going to look here at zed Borg and it was like scroll down so a hardware user's guide will give you some idea of where things are and so for example if I'm looking for the clock it says here that there are some clock sources on the board so for example we have differential clocks which I'm not really interested in at this point I'm looking for the 100 megahertz clock of kind of our general purpose user clock and it says here an onboard 100 megahertz oscillator I see 17 is a fox 70 whatever part number and that gives us a input clock to the processor logic system this is the fabric of the FPGA so this is exactly what it is that we're looking for and that's going to be on pen y9 so one of the first things I can do over here is use that to kind of assign where the clock goes our push buttons here let me go back just for a moment the power-on reset signal is not exposed directly to the FPGA like I can't use that as my reset signal because it resets the whole chip and I just wanna be able to reset this one logic program switch button 6 toggles the programmer and that initial initiate the reconfiguration of the processor logic so that's not going to be a good reset switch just for this one piece of logic the processor subsystem reset this is connected to the PS logic and any races all function and then that's not what I want either and so instead what we want to be able to do is maybe just have push-button here there's several push buttons on the board but not right down center and left those are connected to the PL subsystem whereas push button 1 and push button 2 are connected only to the PS system so those are not exposed to the processor logic I can't use those in my FPGA design I could only use those from the arm arm core because on the PS side so we can maybe say that the center button P 16 will be our reset switch so what I often do is just write these things down so we need Y 9 we need p16 those will be my resets which is maybe what I'll do is I'll use one of these dip switches like say swishes euro to be f-22 and now I can keep scrolling down and look here are all of our LEDs and our LEDs go t20 to t21 u-22 u21 v-22 w22 u19 and you 14 now I could have easily had just looked over at the board the board actually has all of this information on the silks main so systems the parts that can be used by the proxy illogic the fabric of the FPGA are going to be labeled with their location the parts on the silkscreen that are only available through the processing subsystem are going to begin with mio as opposed to one of these alpha numeric locations now it would be great if we are ready to go the problem is that unlike a microcontroller the FPGA is frequently have a very very configurable logic block and part of what we can do is we can actually go in and specify what voltage we're going to use for the actual i/o pin and that's kind of a completely different strategy from what we're used to seeing normally you just run that whatever the microcontroller uses and that's about it but these are much more powerful devices so the next step here is we can download this UCF this is a user constraint file this is a master UCF for the jet board and it will condemn as a zip file as we open this thing up we can bring in this file and what we'll see in particular are the locations that are connected to the pl sides of PGA a side I'll notice here that they have their IO standard so for instance this ad R 0 is connected to something that requires LV CMOS 3-3 so 3.3 volts and if we were to keep on going down through here for instance here's our clock our clock needs 3.3 volts if we looked at our various push buttons the push buttons are 1.8 volts and we got to find those LEDs here's our switch the switches are 1.8 and one more time here looking for these LEDs clearly our LED 0 is the 3.3 volt so it looks like everything is living on the 1.8 volt except for the LED I guess you'd kind of expect that just because LEDs need just a little bit more voltage to manage the current so that's the case we can come now and roll through this configuration and my LED 0 is going to be u 14 I'm sorry t 22 and C 21 and u 22 and you 21 and 322 and well your 22 and you 19 and you 49 now I got to change all of these guys to the LV CMOS 3-3 and it turns out because these are all one bus I can just click on up here and make this change okay so they're all set our clock we said was on y9 and that's one that you'll probably end up using every one of your design we said that our reset switch was going to be P 16 for the button and the directions switch sorry the directions click is f 22 and then the recess which was P 16 if you get this wrong if you get the voltage wrong oh and we have to give save this so we'll give us a name of blinky if we get this wrong for example we might get an error during the last implementation stage that the voltages don't match and that we have for instance two different things on different banks with different voltages or on the same Bank with different voltage differences everything here is on Bank 33 and we change the voltage for one pin we're actually setting the whole Bank and be very careful that we don't have two things on the same Bank with different voltages this software doesn't allow for that so while there are more more powerful than its typical microcontroller there are still some limits alright so we've saved this file I'm going to go ahead and close the implementation and we're going to rerun this thing all right so we'll rerun to implementation and again this let's take just a few minutes so this took another two minutes to go through an implementation I'm going to go ahead and click on generate bitstream this time and we'll let that go ahead and run this will take another few minutes by the way you can watch the progress by kind of watching what's going on up in this little status window up here the something unexpected happened this one's a kid says that stream generation failed and so we can look at the log file and kind of hard to tell exactly what happened instead I'll look over here at the message it's tile and we see over here that it says rule violation unspecified IO standard three of eleven logical ports use iOS standard default instead of a specific value and so normally we could choose to ignore this we could go to the project settings and make this a warning the proper thing to do would be to go here to the implemented design and change that it's these three scalar ports remember they said default here and will actually specify what their values are supposed to be I'm going to take a moment here and I'm going to save this file and I'm going to go back to the project manager now I just want to show you that we can go here to our constraints and we can actually modify the file by the text file so for example I think it's copy and paste this thing to set i/o property and we call this reset so this is the xdc format we could also maybe have used the UCF format they both do the same thing the reason why I show you this is that there are times when this just gets kind of absurd where maybe what we have is we have a master Excel spreadsheet of the pins and their function and then their voltages and whatever other constraints and then we could easily make a little macro function or a Perl program or even a C or Java program that would read that and turn it into this big list of xdc constraint and that way maybe we are database because n could be used to drive this configuration instead of having to do it by hand and then accidentally have things in the wrong place so at this point I need to regenerate all of that I'm just going to go and skip ahead and say generate bitstream and it says synthesis is out of date and so that tells me it's just going to go ahead and do the whole process from the very beginning so this will take about four or five minutes on this computer okay so at this point the bitstream is finished and we'll go ahead and do the open harbor manager to configure the board I have my Zed board plugged into a USB port is powered on pencil now I have open target and do how to connect it's going to scan the USB ports to look for any connected board here found one and now I can say program device and one of the things that loyal links drives me crazy these little pop-up boxes that are easy to miss I was looking around for five minutes trying to find why wasn't programming my device I wasn't hitting that one little pop-up button what you're doing is really picking which of the different programmable parts it found so on a complicated board you may have multiple targets that you can connect to and program and in this case I just want to program the sync now at this point it's probably hard to read or see but I have the board running and those LEDs are flashing but they are flashing at a hundred and so just be back for us slow humans to see so normally to fix this what we need to do is slow that down and to do that I'm going to just go back to my project manager here I need to make some changes so we'll go ahead and open up the blinky light project and in this case what I want to do is I want to add a clock divider and a lot of students when you're first learning barrel logs you want to put that right in here and that's just so wrong please don't do that what we'll do is we'll make another vera log file in this case it's going to be a clock divider and in our clock divider well I could fill them in here or I can just go back here edit this file bring them up to the flow to the front or I can just type them in here so we're basically we're going to have a clock in one of the other things that one be able to do is configure the speed Oh add to my fault type none okay and we'll get rid of this common block so in this case I'm not going to have a reset switch like I did before although I guess we could instead about like be able to do is to say that initial clock out equals zero the problem is that that would then drive that register for more than one block and we'll find out that we can't do that and simulation you can do that but we can't do that in hardware so instead what I'm going to do is I'm going to make it my own reset switch here and so our reset logic is going to start off as 1 and then we're going to always have edge clock in reset is equal to 1 reset equals zero clock out is equal to zero okay now I mentioned I want to be able to configure this number of divisions to this and so we're going to have a parameter will call that divider and we're going to have that equal to they come a number like 10,000 that's going to be still too fast but as a default that'll work I also then want to have my standard countdown that's going to kind of as this thing we can't clock in edges and so then as we count those I want to be able to divide my clock once I reach that camp so I need a count register and that count register needs to be wide enough to hold whatever my current parameter is and I don't know what that's going to be so I can use that key log to function it almost universally is going to look like this see log two and I notice this is a system function because it's built with the dollar sign in front of it and because this is a constant when filled this véra log file and compiles it it can actually resolve that number for what it really needs to be so this is kind of a standard way to take a parameter find out how many bits it needs to be the log base two of a number gives you the number of bits that are required to store it the minus one gives me the most significant bits is it down to the zero is the least significant bit so with that being the case now I can do a reset here and count is equal to zero and in here if count is equal to provider out equals not out so there's our kind of standard divider so I can now use this pretty much anywhere I want to have a clock divider so I'll go here to my blinky light project and watch the Nicklin and so my clock in is going through clock and my clock out with the disk off work I need to make one of these wire just park of course if I didn't have this default in that type none if I left that default and it would automatically make they've caught be a one bit wide wire but this way it forces me to instantiate a wire and give it a name alright the last thing I'm going to do is modify this logic down here to be triggered by disk locks and also a second last thing the house I also need to get this module a name last thing I need to do is the Stan shape that parameter and so we had a divider with ten thousand I actually wanted to be like half a second half a second one hundred megahertz clock it's going to be 50 and now we are ready to go back and rebuild so unless I have any hardware errors I said hard workers there I meant syntax errors so good news everybody I didn't have any syntax errors took about five minutes on this computer and we're going to go ahead and open the hardware manager and we'll reprogram the device when I say things take five minutes in this computer this is a really really heavy-duty processor running on a solid-state hard drive and so your mileage may vary what may take five minutes for me may take quite a bit longer for you just depending on the regular prepare the performance characteristics of your computer so ah I know I did wrong so I'm looking at the performance of the board there's been no change and I know why there's been no change after I followed the clock here are they reflect account and so of course it then doesn't actually do anything so we'll go ahead and do that one more time oops okay so the file is generated and already done a program or device and now if you can see the light moving around there on the camera if I change the direction switch we can change the direction of the light move really high quality photography work here I apologize for the the crudity of the model but there it is there's our our first project nice hierarchical design all the way through the tools I'm going to do a whole bunch more of these videos hope you like this one hope it was helpful thanks bye bye
Info
Channel: BOPV
Views: 41,959
Rating: 4.9511003 out of 5
Keywords: vivado, zedboard, blinking light, first project, tutorial
Id: 6lDzz8tzXck
Channel Id: undefined
Length: 31min 4sec (1864 seconds)
Published: Thu Mar 02 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.