Introduction to FPGA Part 1 - What is an FPGA? | Digi-Key Electronics

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
fpga stands for field programmable gate array it's an integrated circuit or chip that allows you to design completely custom digital logic over the next few episodes i'm going to show you how to get started with fpgas so that you can create your own custom digital circuits i recommend understanding some of the basics of digital logic such as binary and how and or and not gates work as we're going to be mostly focusing on implementing those designs in a hardware description language i'll then show you how to upload your designs to an fpga so that you can see them working let's jump in [Music] the big question i often hear is what can i do with an fpga you might get a response like it's faster than a microcontroller or it lets you do things in parallel these might be true but they don't really offer a complete picture of what an fpga is if you just want fast and parallel you might be better off just buying a big honking graphics card or tying a bunch of processors together fpgas are made up of a bunch of logic cells that act as fundamental building blocks for creating digital circuits we'll explore what's in these cells later in the series but for now you can think of them as a collection of lego bricks you can configure the individual cells to operate in certain ways and you can connect the cells together to form the basis of any number of digital circuits much like you would use lego bricks to build a toy car you also have access to things like clock signals and blocks of ram for storing data note that some fpgas can have other peripherals like analog to digital converters or analog outputs cells are often grouped into logic blocks and this reconfigurable group of interconnected hardware is often referred to as the fpga fabric going back to our car analogy if you just want a toy car to take some sweet jumps you might be better off buying a toy car it's likely going to be easier and probably cheaper than building your own this is similar to say using a microcontroller it's capable of doing a lot of things but it's a purpose-built processor with some static peripherals that you can use to connect sensors motors lights and so on contrast this to an fpga which gives you the building blocks to make a lot more things in fact you can use these building blocks to make your own processor in the fpga this is known as a soft core processor and it allows you to run code like you would on a microcontroller or microprocessor if you have the space you might even be able to implement more than one processor on the fpga note that you may or may not have access to some of the peripherals you find on a microcontroller like those analog to digital converters implementing a soft core processor is quite popular as it allows you to both customize the processor as well as connect it to other digital circuits you create on the fpga fabric time permitting my goal is to show you how to load a very simple risc-5 processor on some fpga fabric later in the series before we go there though let's take a look at some example use cases where you might want to use an fpga instead of a microcontroller or microprocessor for example these mesmerizing led cubes are controlled by fpgas most microcontrollers would struggle to feed that much data at such a high rate to all of those panels you can also find fpgas used in communication equipment performing various digital signal processing tasks like filtering compression and computing the fourier transform while processors can be used for dsp custom logic in an fpga might be needed to handle higher frequencies and higher data rates you can even find fpgas in some consumer electronics for example this teardown of a mercedes-benz infotainment center shows a xilinx fpga on the pcb sometimes it's cheaper to use reconfigurable logic like an fpga rather than produce your own chip which can have a high tooling cost speaking of making your own chip you can also use fpgas as a quick way to prototype your design as they can be reconfigured over and over again if you are looking to make thousands or millions of units and off-the-shelf integrated circuits won't work you can have an application specific integrated circuit or asic manufactured note that sometimes it's more cost effective to just put the fpga into the final product if you're only making a few units as in the case of the mercedes-benz infotainment center we just saw if i tear open my beloved analog discovery 2 you can find another xilinx fpga here it's being used for data acquisition where it can sample and buffer data very quickly from the analog front end of the oscilloscope or as part of the logic analyzer you can also find very large and powerful fpgas being used for specialized computations such as mining cryptocurrency or training neural networks the specific calculations used for those operations can be optimized in hardware so you'll often find that an fpga can outperform a general purpose processor or graphics processing unit for that one application i hope these examples give you some ideas where you might find fpgas being used let's take a moment to summarize why you might want to use an fpga over a traditional microcontroller or microprocessor the big thing is that you can create custom reconfigurable digital logic circuits in an fpga if you can't find a processor with the peripherals you need like say three usb host controllers you might be able to make your own in an fpga you can use an fpga as an external chip to supplement your processor or you might be able to implement a processor in the fpga itself some cpu designs such as many risc-5 implementations are open source that means you can view and modify the source code which opens up the possibility of changing how the processor functions if you need to add a unique assembly instruction or support some specialized function like the ability to multiply and add in a single clock cycle you can do that in an fpga they also offer the ability to create optimized digital circuits for performing specialized computations like calculating the fast fourier transform in only a few clock cycles a microcontroller or microprocessor might be too slow to meet your needs for a particular application finally if you're looking to have your digital logic manufactured as a chip for sale or part of a larger project the fpga is a good tool to help you prototype your design now let's talk about how you might program or more accurately create a design for your fpga in most cases you will use a hardware description language such as verilog or vhdl to describe the circuit you want to create while some of the syntax might look like c or python it's important to note that hdls do not operate like programming languages in that we are not creating a sequential set of instructions for a processor to execute instead think of an hdl more like a markup language you would use to design a website everything more or less happens at once as individual lines are not executed sequentially the snippet of verilog code i've shown would define this simple logic circuit note that how the fpga implements this circuit might not exactly be a collection of logic gates we'll explore how this works in a future episode the two most common hardware description languages you'll come across are vhdl which stands for very high speed integrated circuit hardware description language and verilog which is a portmanteau of verification and logic both were introduced in the early 1980s vhdl was developed by the united states department of defense it's a strongly typed language and it's often considered very strict and verbose verilog was created by the company gateway design automation which was later bought by cadence design systems it's a weakly typed language and has a more c-like syntax both languages are examples of register transfer level design they describe how a circuit moves and manipulates data between registers but they do not describe the exact hardware necessary to do so you will find many online discussions arguing the merits of one language over another the truth is that they are both industry standards and are similar enough that once you are comfortable working in one the other is relatively easy to pick up because the open source tool set that we are going to be working with in this series supports only verilog right now that's what we're going to use there are a few other languages and tools you should be aware of system verilog is quite popular as it simply extends the functionality of the 2005 version of verilog it adds features that help you write test benches which are used to verify that your design works many of the large fpga vendors are pushing high level synthesis tools these tools are powerful programs that can automatically convert high level languages like c c plus plus and matlab into rtl code they allow newcomers to write programs in a more familiar language that is then converted to a design for an fpga while it might not be as optimal as writing rtl by hand it could potentially save you a lot of design time you might also save time by using intellectual property or ip blocks you can often download or purchase ip blocks from the major fpga vendors or their partners these are like closed source libraries you might use when writing software they take up some of your logic blocks and have documented interfaces that you can connect to however you can't see what's on the inside they can provide various features like soft core processors specialized dsp filters compression neural networks and so on with ip blocks you often don't need to worry about making the hard stuff and can instead focus on creating the glue logic for your specific application the terminology for creating an fpga application is quite different from what you might hear for writing software as there's no compiler or assembler here's what a typical design flow might look like you'll first write code in your hardware description language we'll be using verilog for this from there you'll often want to simulate your design many fpga development environments have simulators included but will be using the open source gtk wave as a visualizer you'll often need to write verilog to test your original design this is known as a test bench while the simulation step is often recommended before synthesis we're actually going to save it for later in the series as playing with designs on actual hardware is a lot more fun next we synthesize our code and we'll be using the open source yosis tool for that synthesis tools take your hdl code and translate it into gate level representations the output of this step looks something like a net list that tells the fpga how the various cells logic and registers should be connected however this netlist is fairly generic and our particular fpga would likely not know what to do with it so we have a place and route step much like you would do if you were designing a printed circuit board this is another automated tool that converts the netlist output from synthesis to the actual gate and wire connections that need to be made in our particular fpga we'll use next pnr for that like the others this is also an open source tool the output of our pnr tool is an ascii file that tells the fpga exactly what it needs to do in order to create the circuit we defined in our code however it's in a mostly human readable format so we use the ice pack tool to convert it to a binary file that can actually be read by the fpga configuration process finally we'll use iceprog to upload that binary file to the external flash memory chip connected to the fpga to make this whole process easier and so you don't have to remember all of the tool names we're going to use appio which is a tool that calls all of these low-level tools for us note that the collection of tools we're going to use work only with the lattice ice 40 line of fpgas these are generally considered to be fairly low powered and inexpensive fpgas but that's perfect for our learning experience while you can use these individual tools for much of the ice40 product line opio is made to work with dev boards if you look at the github page for next pnr you can see an example of its graphical place and route tool this is something optional that you're welcome to play with but we won't need to use it in this series you can see how the tool makes actual routing connections among the cells in your fpga if you head to the opio github page and scroll down on the readme you can see the various boards that appio works with while i can't promise they'll all work for the series the chances are high that most of them will i'll be using the istick from lattice this is a development board built around the ice 40 hx 1k fpga i recommend getting a usb extension cable for it and you'll need some basic components like a breadboard jumper wires and some buttons i'll let you know if you need additional components in each episode the idea behind this series is to give you the basic building blocks to start creating stuff with fpgas in the next episode we'll install the opio tool set and upload our first fpga design happy hacking [Music] you
Info
Channel: Digi-Key
Views: 110,030
Rating: undefined out of 5
Keywords: fpga, lattice, ice40, yosys, apio, electronics, digital logic
Id: lLg1AgA2Xoo
Channel Id: undefined
Length: 15min 20sec (920 seconds)
Published: Mon Nov 08 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.