 introduction so this the goal of this demo is to show how easy it is but if you have a hardware then we can make a workshop in hackerspace that will take more time we can answer questions we can make sure that your small projects work and for these small projects the first question is what kind of hardware you want to have probably want something like this this is so-called Papillio we can see on the web page it it is pretty easy to buy it's actually popular you can buy something like this from sorry yeah I always make this mistake it's just one hell yes on this web page gadget factory it's basically simple Spartan board with shields I would recommend either Oberon project shield which basically has the VGA output and two ps ports so you can connect your peripherals it also has the mass storage so you can do most of the small projects yeah or logic start shield this is the example of logic start shield you have switches you have leds you have seven segment display you also have VGA and you have audio which is pretty practical also you have alternative way of connecting power there is also the third shield that you may want to have this is the so-called gaming shield that has VGA and two slots that look just like VGA they are actually joystick slots and that would be the best I would probably start with our Barrel Shield but as I will tell you in a minute as long as you have the right socket you can do everything if not you just need a extra connector that converts the pins to your socket yeah and that would be as for hardware so I would recommend either Spartan 6 so Papillio Pro probably this is Papillio just small Papillio one very practical for small projects but it doesn't have its own memory so it okay it has memory but it has like 40 kilobytes and the Papillio Pro has one megabyte so if you think about visual projects or gaming projects this is enough to have a mono display for example but if you want to have like color VGA resolution or HD HD resolution that would be already about one meg would be taken just for the display memory that is that is important also the common thing with FPGA is that you have two or three bits for each color here so you can count that that you need this at least frame buffer memory that that's really bare minimum and let's use the character generator but then the character memory will take some and it's of course mono program so now the hardware considerations are after us the next step is of course really visiting depending whether you'll have Zlinks or Altera FPGA these are two most popular producers yeah so depending of which one you need to visit either Altera.com web page or Zlinks.com web page and download the software I have the software already installed you basically need to download so-called ISE webpack from for Zlinks and Starter edition of the software for Altera these are kind of free editions so they are limited to working only on the producers devices and they are licensed for all the producers devices so that should not be a problem this is the bare minimum for the low end FPGA is completely sufficient and now I will show what happens when you download it already so this is Quartus so maybe I will start from I will switch off the pin planner because that's a bit ahead of what we are going to do yeah and it works on Linux yes the thing is there is a Linux version of all this software for these major producers and Windows versions okay even for Diamond or Lattice there is a Linux version but the problem with Lattice is that you have special to have special red cap version for it to work and it's pretty old so I would recommend either Zlinks or Altera software works on as far as I know like most platforms one most popular two most popular platforms maybe not on Mac but that's the only difficulty but you can have the parallel desktop with Linux it will also work because the only way it contacts the hardware is USB yeah and then when you start Altera Quartus you see the display like this the first step that you need to do is to create a new project not sure is it enough resolution everybody see it okay so I didn't need to zoom it so you create new Quartus project and then we call this a tutorial project and there are two important things this name is usually the same as this name and this name you need to remember because it has to be also the name of the top level entity in the project I will tell about it in a moment and we don't use existing project settings because I want to guide you through few things that are usually difficult because then everything else is simple so you create a directory it's very similar to Zlinks but I will also do it with Zlinks in a minute so something happened it's kind of slower than usual maybe I should just close the software so in case it is slow the the beginning projects are very small so we can just kill the software nothing bad happens so it's really robust so usually it installs in Opt Altera or of the Zlinks and you just need to call it from this the directory yeah and it started oh this is the Zlinks version so okay we have a new project okay we can also start it with this wizard so new project as I said this is the important part now we create the directory no now we create an empty project and we don't add the files we will add them later now is the most important part so the first thing you need to check is on the chip you have the code and this as opposed to other chips all the numbers here are important so I will show the two examples of chips so maybe in the camera if isn't visible the marking and here so this and this here they have a special code that we will use in a minute so whenever you have development for sometimes if it's say Altera or Zlinks development board you will have a tutorial that tells you what to choose but here you just need to copy this number in my case I know that it's EP4 now CE6 and now it will be E22C8 that's the beginning that's actually one of the most difficult things why because now we select the voltage now select the number of ios and pins now you set the arrangement of the banks and if you select the wrong device and you compile your project it will upload it will connect random things to other things or it will not upload at all so that that's a critical part so now I select this device have some problem with this actually no it works here yes and now is the the the things that is best to keep at the normal settings it just allows you to change the compiler and so on so I would not recommend to change it here it should now display the cyclone 4e the kind of device also other things that are probably not that important so now the compiler knows which device we target and the next thing is to add the source file for VHDL and it's also pretty simple you just add the VHDL source file say I have one prepared actually it's a very simple file here in the lead blink so how this file looks like it's basically VHDL code if you google for VHDL tutorial it will tell you everything about the language it has normal imports usually you import the i stuff because it's the standard types and declarations second is declaration of the inputs and outputs of your entity or your module in this case it's logic vector 1 of 8 bits both switches that are inputs and less that are outputs so this corresponds to what we see in on this board here we have four switches but I can always connect the pin to something that doesn't exist and hopefully nothing will happen as long as the voltage doesn't exceed this denominator voltage that is accepted and here we will say that depending on the state of the switch we will set first four LEDs and the second four LEDs we will set to zero so we don't care about four LEDs that much so this is very easy to to program and whenever you program it and you add this file to the project so we add it to the project we have to click add okay we have added the file the the only problem is that we need to rename the entity here to new project so that it's consistent with our project name okay that would be all now we are able to compile our project or should be able to compile it so now we can start compilation and the next most important thing is twofold so either we try to implement it directly in hardware and this is also the same in Zlinks and Altaira we have to oh there is some oh so I probably have another file that also specifies new project so I need to properly let bling VHD to the project directory and just keep it there and besides that yeah I should be okay so that was VGA tutorial a new project yes it probably generated another file that that was responsible for this so when we make this compile basically because I have only five minutes I need to to skip this this part of checking we need to assign the pins so in Altaira it's pretty simple because there is a graphical pin planner that has the pin numbers that correspond to the pins here and we just assign the pins to the names that are used in the VHDL top level project in Zlinks it's a bit different because we have so-called QCF file and the Constraints file yeah so if we look I have another project here and that's actually put in here there is also the CSV version but I didn't use it here it generated the whole general documentation here QCF sorry and that's the file that you should actually usually get as a template from your board manufacturer so that you know what is connected where basically in this case I got it here in this way and it defines basically which pin name corresponds to which name so on the left you have the clock rx receiving tx transmitting serial is set seven is seven segments display anode dot point and so on then lock is the pin name and then also there is an option of IO standard or period for the clock so basically options of how to treat these pins sometimes so usually FPGA have few sets of pins that are so-called IO banks and each IO bank can be used for either low voltage TTL sometimes also high voltage TTL so normal TTL and you can also modify the behavior of the slew so how is the edge detected so that the voltage races and the drive in this case selects a how strong it is the pin is driven when it's output of course you can also select the pin to be in out and then depending of whether you mark it in or out you will be able to to drive it as output and as input of course in this case beware do not set it as input and output at the same time yeah then the second thing is simulation so basically for each of your projects besides pin planner where you assign the names of pins you are able to run the simulation tools after compilation here it's RTL simulation in case of zilinx and i think in this case i will show the simulation in zilinx so this is actually a project where i added added few files already i created empty project added few files and selected the target zilinx device also from these numbers the same way and then i can run the simulation in zilinx tool the simulations are here as processes so basically you can click what you want it to generate here it would be generating programming file for the device and simulation tool is here then it should run other program that is just simulated because now we have we need to simulate explicitly switch the mode in zilinx in Altair i will just launch the simulation tool here we have either a selection of implementation mode or simulation mode okay i'm i'm finishing here when when you when you select certain time in my case this is a example vga controller like 100 microsecond and you run it for this hydrant microseconds you will see how the states of the outputs change you can also have a separate program that tells which inputs are set in what way so you can simulate what is on the pin pins that are outputs depending on what you set on the pins that are in input and that's the basically the whole philosophy besides knowing the language of ebhdl or varilog or clash whatever you prefer as an implementation language yeah so we simulate because some kinds of the programs basically work too fast in in case of vga the the step here is like the whole frame is generated for approximately i think 10 milliseconds and that's the the whole display so each pixel is generated for few or tens of microseconds so it's very hard to debug without simulation tool yeah that's also true for the most protocols if you write something to flash memory or read something from ram you need to do it pretty fast so you you check it in simulation tool that the pins the digital data is set appropriately or you directly go to the device and then you can see the LEDs but maybe you it's hard to see if they would change very quickly so the the first mistake that people usually do is setting the clock in a property but if you have your manufacturer's constraint file that settled the issue that's the the only thing that i would not have time to demonstrate but if somebody comes for a workshop session i will show you basically how you set the clock both in in quartus and in alteras tool and in in zilinx tool so you basically need to know your crystal frequency on board in this case i think it's 25 megahertz in this case this is 32 megahertz you set it in the in the tool and then whenever you want to wait for one second you also set the constant in your vhgl file to be 32 megahertz so 32 millions basically or if you have more accurate the crystal then it will be an appropriate power of two that is closest to 32 megahertz that would be all now time for questions say about the price of those boards yeah we may indicate you know it's not so this is for this one was uh i think $70 yeah the she was actually the red one i bought it from 12 gig for $70 this with shipment from china i i got i got a stock of chinese marked boards that are initially a little bit hard to work off because it's hard to obtain the pinout this is only a non-standard thing with with such a board but if you obtain the pdf with a pinout and if you decipher the Chinese it's actually very cheap board it was $66 with shipment and this board actually has not only the the cyclone itself which is a bit more powerful than this one because for example it has programmable cogs that you can change and a bit more of connectors which i i said i said for the hobbyist and for the initial experimentation it's very useful to have ps2 to have vga so i suppose the without the price would be 40 sink dollars that's what i think we'll go for one more question but where is the ngs maybe you can start studying so i can answer a question and yeah then you can set up while uh so uh rafim arvina could you talk a little bit about fpga group that we are also trying to start off okay so we created the group of facebook uh fpga so we will try to meet once a month the same basically the session and create some workshop slash introduction so basically introducing how to program fpga if people are interested to bring something on top of those boards with specific interface learning how to program to drive an lcd to some analog measurement sound synthesis and because those boards have also lga and hmi is to create some graphics etc etc so the first few sessions will be probably just to introduce vhgl or very lot and the first session you know exactly the format but people can come with a laptop install the tool and just simulate because we don't need really the hardware to to be too much we can also import an image into the tools using the vhgl code simulate what would be the results then the image is basically created because we can input and out export also the data so there could be some sessions where it's only a programming exercise without any hardware then later we can have more uh involved depending on the interest of people and i mean if you have done a vhgl and fpga school so maybe some of us were already done