ZYNQ for beginners: programming and connecting the PS and PL | Part 1

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's going on guys welcome back to another YouTube video this one's going to be about using the zinc SOC chips and interfacing between the programmable logic and the processing system so the zinc chips are system on chips that's was the SOC stands for so system on chips means it has like a variety of of actual things and peripherals on it so first we have this processing system block right here and we also have the P whoops not R we have the PL which is the FPGA side of things so the FPGA fabric and then we have a hardened processing system that's the Zink processing system harden just means as actual silicon it's an actual chip it's not like a soft processor that you would build and say like HCl or something it's actually there on the chip so is the FPGA fabric and then it has like a couple peripherals maybe an EC a UART block a spy block maybe has like some sort of Ethernet or something Ethernet so stuff like that and what we're gonna do is look at we're not going to look at these for now but we're gonna look at how do we connect the FPGA and the processing system and if we have some IO here oh how can we connect that as well so this is external i/o so we're gonna look at that today and what we're going to do is we're gonna build a NAND gate so we're gonna have the a NAND gate it's going to look like this but it also is just a and gate with a not gate so what we're gonna do is we're going to have the FPGA if FPGA is in yellow here we're gonna have the FPGA fabric do the Andy and then the processing system is going to be taking control of the Navi and then at the end we're gonna have an LED and we're going to tie the inputs to two switches switch one and switch to zero and that's going to be our project the I'm gonna use my own board it's going to be it's an Artie it's an already z7 ten board from digital n't it has switches on it and LEDs so I'm going to use those on board if you don't have this board you can use a different if you use your board this is just gonna be more it's what I have so I'm going to show you how to do it and you can tie your own inputs and outputs to whatever you want maybe if you have like Arduino headers that you can take little wires off of or something like that you could do the same thing with those you just have to know what pin this connects to on SOC so you'll need you'll need this special file which we will go over in a second so let's get into vibrato and start working on this okay so now that we're in Roboto like I said I'm using 20 19.1 up here so it still has the SDK unit first I want apologize I have some allergies right now and my mic is broken so my audio quality might not be that good but we're gonna go through this so I'm gonna click and create a new project I'm gonna click Next and we're going to call this project and also since my mics broken here and you hear the click of the keys and everything but it should be okay we're going to call it PL PS NAND gate okay and then put it wherever you want RTL project that's fine now I already have my board file so like I said I'm using this RTC 710 I downloaded the board file from the internet I think it was some github repository somewhere but you can use see if you get any of these boards these brows I links boards they already have the board files you can get the board files online and there's videos on how to add board files so I'm gonna click on this one cuz that's the board that I'm going to be using make sure all this is good so you can see that there is the zinc chip this is the default part and click finish ok so we got the Lovato's all loaded up and everything we're going to click on design sources because first we're gonna create the FPGA code or the HDL code for the programmable logic side so we're gonna create a file our file name is going to be NAND gate and we are going to go finish we can skip this or you can use it I usually just skip it I'm gonna go okay yes it's ok then it's going to update blah blah blah blah blah blah Blee Blee boo ok double click on your design sources and it'll pop up or go into maximize this and can we zoom in a little bit maybe you cannot so delete all that because it doesn't really matter well we're gonna have two inputs input a and B and we're going to have one output that's going to be Y okay they'll just go right there just we're going to assign this is super basic HDL code if you've taken any classes or know anything about it just eat if PJs you know that this is one way to create a NAND gate it's just how I do it a and B semicolon boom whoops don't want that in there okay we're good to go we got this little green guy right there press ctrl s to save it and now we need to add our constraints file so click this little plus again and go to add or create constraints and what I'm going to do is create a file and I'm gonna call it physical cons that's good enough there's two types of constraints actually for FPGA is there's timing and physical these are just gonna be physical constraints that's where the pins are located at so click OK and finish and if we go in click on physical constraints XD see it's blank now I'm gonna go open notepad and open and tilings project ok this file is called the master xdc file so it's the master physical constraints file for my board for this rdz 7:10 you can find this four-year board online like I did and you can just copy and paste it right into your Lovato project sorry okay we're gonna paste it all then he just uncomment the pins that you need so we're gonna be using both switches on the RT board so we're gonna go here and I'm just gonna call them switch zero and switch one okay and then we are going to go here and M&M in it and let's use one of these RGB LEDs we'll use the blue one that's gonna be our output so I'm gonna call that just LED and you can rename these little things in here as long as you keep it the same in the block diagram and I'll show you what I'm talking about so let's go ahead and save that and we only have three physical constraints which is good because they're willing to have three inputs or two inputs one output now you're going to go over here to create block design and design one is what we are gonna name it sorry my parents are in the background okay so we got the block design opened here sort of we're gonna press this plus button and the first thing we're gonna add is the zinc processing system we got it so you're going to go up here to run block automation okay double click that and you want to have all these checked and what it's going to external interface to is fixed i/o and the DDR memory okay click OK and it's gonna do its little thing blah blah okay so now I got those connections now we need our FPGA code so we're going to go to the sources tab when I go nan gate right-click it and if you go down we're gonna say add module to block design now we have our little NAND gate in here we can just move it around and stuff like that so that's pretty cool we need a couple more things though with the okay before I'm going to talk about this with the processing system in order to interface with the outside world except for the DDR on this fixed i/o here you're gonna need what's called an ACCI GPIO block and we're gonna search for it in here AXI GPIO okay and that's in here what this is is it's part of the programmable logic but it allows the zinc processing system to access the outside world through the programmable logic so that's what that's gonna do and let's see what we got here we're gonna need two of these I will show you why in a second XE GPIO and what we're going to do close some of these so we can make it easier this little button up here regenerate layout that's gonna make it easier for us to just see things okay so we're going to click on this run connection automation and we're gonna click actually GPIO 0 and AXI GPIO 1 we're gonna unclick the GPIO because we're using our own if you had like if you just wanted to interface it to things on your board which technically we are but I'm doing this as more of a custom thing so you could interface it to something yeah custom like that so unclick those make sure the sxe are clicked on both of them and we're going to go okay so we've got our whole thing here you can see it added some of this pious actually peripheral blocks and blah blah blah so we're going to move our NAND gate down here and we're going to click on acts each epi o 0 this is gonna be the input to the zinc processor from the NAND gate okay I'm gonna say that again this ax C GPIO is 0 is going to be connected to the output of the NAND gate and is inputting back through these wires all the way into the processing system ok so we're going to double click on this we're going to go to IP configuration since it's going to be an input we're going to click all inputs and it only needs to be one bit wide do not click this enable dual channel this is only going to be single channel for now and click OK if you hover over the GPIO button and click it you'll get that little this thing and you can toggle now if you click off of it this GPIO IO I see that little triangle how it's pointing in that means it's an input so what we're gonna do is take our little pencil tool click and drag and connect it to our RTL which is our HDL Angela okay so now we have that connected we need to make the connections to the outside world to the switches that are going to be part of the and gate actually I totally label this wrong it says a NAND gate but it's a NAND gate because if we go back to NAND gate Davi it's just a NAND gate maybe I should have done that better hopefully it's like confusing so go back here click click on this B and if you click ctrl T you can make an external connection and if we click on the external connection sometimes they pop over oh they'll all pop up all over the place so they're hard to find it's b0 but we're gonna want to connect it to our switches and we hide our switches name switch 1 and switch 0 if we go back to our physical constraints we can see yeah switch to 0 and switch 1 so we'll go back to our block diagram and I'm going to call this switch 0 and there we go switch the arrow is right here and it's going into B you can't really see that very well but I'll regenerate the layout and the second you will be able to so same thing here click on oh why why is it doing that sorry make external sorry so I finally got the 8 to do it okay now we have a down here go up to external port properties if you can't find it it might be along the side if you've minimized it down and we're gonna name this switch 1 ok important these two have to be named exactly the same as in your physical constraints file ok so they are named exactly the same now we're gonna go up regenerate the layout and it's kind of ok but you can see how switch 1 and switch 0 our inputs to our and gate not the NAND gate that I labeled it sorry guys and why is our output of the FPGA fabric into the AXI GPIO which is also part of the fabric FPGA fabric however that fee into this actually peripheral block and into the zinc processing system okay I'm gonna say that one more time just so you can get this switch one switch zero inputs to FPGA fabric the output of this block which we wrote goes into an acci GPI blow o block which is a connection from the FPGA fabric to the zinc processor now we need to make the connection from the zinc processor outside to the outside world LED we do that through another actually GPIO block here so this one is X GPIO one we're going to click on that or double click on it go to your IP configuration again since this is an output we're gonna click on all outputs and we are only doing one led so we just need to have a single bit click OK hover over this GPIO until you get the two little arrows to expand it notice the triangle is pointing outwards meaning it's an output left click on it and make external you can also do ctrl T it's going to make an external connection click on the external connection and where you're going to name it what did we name our LED okay so it is capital so see you're here LED so where you go to diagram name this guy LED capital sensitive enter if you see right here it has these zero down to zero on it that's just saying that it's a one bit quant or output as long as this name right here isn't is the same as what's in your physical constraints file it's okay so we'll go back to our diagram zoom out I think we have all the connections so we're gonna click regenerate our layout and is it's a little bit easier to read now we'll see so don't mek my maximize that click ctrl save to save your block design control save and we're gonna go to sources the sources tab and pull up the tickle console here just so we get back to the default window so oh and I made a mistake here when I clicked control save I accidentally named this down here to s so we're gonna click on that again and rename it back to LED sorry about that make sure you're hitting ctrl s instead of just s now save the save the block design again ctrl s wait for it to update and click on this design one up here that's our block diagram right click it and select create HDL wrapper let the vato manage wrapper and auto update click OK and wait for it to do its thing an HDL wrapper is something that wraps around the entire all the install the all your instantiations of these different blocks or instances whichever word is right I always gonna make step and it essentially forms it into one module okay so you can see that we have it there designer wrapper and you can see how it just absorbed the our man gate file even though it's an angei many mistakes who will be made in this video but if we click on it here design one you can see all of our instances that we have so we have our HDL we have our actually GPIO we have a processing system and then we have these peripheral rocks so that's pretty neat that it does that we are all good to go as far as the vato goes what we need to do is go click generate the bitstream file and just wait for it to run and finish ok so we got our bitstream generation completed you can see here sorry figure my creaky chair in the background between generations successfully completed and if you have a little bit older computer like mine this took forever but that's ok done and I click cancel and go up here to file file export export your hardware click this include bitstream and export local to project click ok now go back up to file and we are going to launch SDK this is all fine right here click OK and now we're going to work in SDK for a little while
Info
Channel: Dom
Views: 27,143
Rating: 4.9365077 out of 5
Keywords:
Id: _odNhKOZjEo
Channel Id: undefined
Length: 22min 55sec (1375 seconds)
Published: Thu Jul 02 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.