Designing with FPGA

So.. again its a bit of technology.... lets discuss..

Start Bit....
FPGAs.. or Field Programmable Grid Arrays... awesome things.. but complex to understand and start with...
So a small write up like this would be nice at least for some one who is struggling to get a start with FPGA programming in Verilog/VHDL.

Data bits ..
  FPGAs in its simplest form is just a Digital IC with few basic digital logic blocks arranged in repeated order along with some interconnecting fabric. So a user can rearrange or connect these blocks in different fashion to bring up any digital functionality. This rearranging can be done using a Synthesis tool  based on the User logic defined using a Hardware description Language (HDL) like VHDL/Verilog, System verilog etc..

  So it is just like a bread board with fundamental digital blocks like FFs, MUXes, LUTs, Block RAMS, Shift Registers, Clock Buffers and much more. All these are at the disposal of FPGA designer for his imagination. So the glamour part of FPGA design is that we are defining a Hardware  itself.. not any application to run over a hardware platform.

   FPGA designs can extent from simple NOT gates to 32 or more bits processors. More clearly anything that can be done in digital domain is realizable within FPGA. This wide spectrum gives a whole new possibility of research and fast prototyping. But restrictions are there on what can be realized in a particular family of FPGA. It depends on the available resources (Configurable space) in a FPGA. Some other factors are the maximum speed, in built memory, and much more...

So where are FPGAs used  ??
  At the simplest form it is used to learn Digital System Design. Hectic wiring in Digital Design Kit is a history now.. Students get exposure to HDLs and can start with simple encoder/decoder designs. State machine Based designs can be practiced in FPGA. Tons of fun projects and hobby designs can be found in internet. All kind of Synchronous , Asynchronous, Sequential circuits can be tried out...

  The next level of designs include some embedded device prototyping. Here FPGAs are included on PCB boards of embedded devices like Set Top boxes, Routers etc for executing dedicated processing needs. Lets consider a scenario, where someone needs to add a specific heavy duty functionality (HDvideo decoding) on an existing Design. But situations arise where such a software addition make the already existing CPU to work overload or reduce its efficiency. In such a case a suitable FPGA could be added to the existing circuit with the very same heavy function implemented in it. So the CPU could just offload its job to FPGA and work happily. This kind FPGA addition is more favorable if the offloaded job needs timely technology or revision upgrades...since FPGAs are re-configurable on the fly.

Methods of FPGA design
  As i already told, anything digital can be realised in FPGA. There are few trends in the way of designing with FPGAs. One method is the development of IP cores for a particular task or function and make it work with external world by its own. These are standalone designs and are bit harder to bring up as a working prototype.
 Another method is to integrate this IP core with a well known soft processor in FPGA with the help of a BUS architecture like PLB, AXI, AMBA, Wishbone and many more. So that the IP core acts as a memory mapped or interrupt driven Peripheral. So the processor just calls up and utilize it whenever required. This is a methodology where software integration is also needed to initialize, call, assign and pool the IP core through the processor. In this method, we will eventually use the SDK of that soft processor to declare and define variables, functions for our custom IP to be utilizes in circuit.

[Yep.. u got it.. Soft Processors are IP cores by themselves.. They are HDL codes defining a processor for configured to work in FPGA. Some examples are NIOS 2, Microblaze, Zet, Pico Blaze, ZPUino, etc:- Many complex and expensive FPGAs also have some real Processor like ARM, power PC etc:- hardwired into FPGA silicon die itself ].

How to start with ??
   Yes.. definitely an FPGA is needed. But for the starting urge simple simulations of HDL code in Modelsim is enough. Lot of syntax, logical errors are waiting u there...  Also learn about both synthesisable an Non-synthesisable HDL coding.. Its important if u r taking FPGAs seriously...because synthesisiable codes could only make into FPGAs, while both can be simulated in modelsim. Debugging complex designs in hardware is so difficult, hence simulation tools are needed. Also a successful simulation can make sure that  design could be fed to any FPGA synthesis tool.
Some Simulation tools are
ModelSim, QuestaSim, Iverilog, Isim, Rivera etc:

  Next step is to deal with a synthesis tool. It does the job of reading your HDL logic (verilog/ vhdl files) , understanding the logic, arranges the block hierarchy, checks the interconnection, place and route, implementation and so many things.... Synthesis tools are FPGA vendor specific. Which means that results made from synthesis are entirely meant for that particular FPGA.
Some Synthesis tools are
Xilinx ISE  : for Xilinx FPGAs.
Quartus II  : for Altera FPGAs.
Leonardo Spectrum : Tool from Mentor Graphics supporting major FPGA families

Please note:- i am skipping about steps like pin planning, timing constraints and analysis, area constraints, design verification, place and route, net-list generation etc to make this article understandable for any starters. So if anybody needs some clarification, can just drop a comment below. 

  Yep.. once your design is simulated and synthesized successfully its time to load into FPGA. Here onwards you would be requiring a FPGA development Board. But in Indian scenario, getting a cheap FPGA development board is too narrow. Some third party boards are available in very few online stores at rocket high prices. Some good but still not cheap options are Pappilo boardMojo Board and DE0-nano.

  The synthesis tool provides an output file with definitions in FPGA understandable format to configure itself for the logic defined by the Designer. Once it is loaded, the FPGA mimics the functionality of defined HDL logic. Suitable peripherals/communication protocols are interfaced to check and verify the hardware.

Extra Bit.........
SoCs in FPGA.
 System on Chip or SoCs are already a booming design field in VLSI. And again FPGAs are the best choice for the R&D of SoC logic in giant semiconductor companies.. So lets conclude this article with an introduction to SoCs in FPGA.
  SoC.. defines a complete set of electronic system inside a single chip/silicon die. So what includes in an SoC... ??
Obviously a Processor, a GPU, a DSP Co processor, Video Subsystems, Audio Codecs, RAM/ROM memories, Peripheral controlers PLL/PWM modules, Communication controllers like Ethernet PHY/MAC , LTE/GSM radios etc.. and many more..
 All these together inside a chip is literally just like an ecosystem, which only needs some power and I/O capabilities from external world. So the design and validation of these silicon super cities are like heck of a job. FPGAs help design engineers to design, debug, validate and verify these designs before they are promoted to Silicon Fab process. This literally saves whopping amount of money if a flaw is found in an SoC after production.
 So to get started with SoC designs in FPGA, the first step is to understand the method of incorporating soft processor with other components inside an FPGA, and get them running....
Tools are
Xilinx XPS   : for Microblaze and PowerPC based SoCs
Altera Qsys : for NIOS II based SoC design
Xilinx VIVADO : for the much advanced Zynq series FPGAs which contain ARM cores and highly sophisticated designs.

Stop Bit...

And for anyone who is obsesed with FPGAs i recommend you to subscibe the Xilinx publication XCELL which is quite an updated bleeding edge source of information. It was started at year 1988 !! . All its issues are available as pdf in below link.
http://www.xilinx.com/publications/xcellonline/xcell-past-issues.htm

A good resource on purchasing FPGA boards
http://tristesse.org/FPGA/CheapFPGADevelopmentBoards

















Comments

Popular posts from this blog

Bidirectional 3.3v 5v Level Shifter

DIY Fixing a Laptop Battery

USB-UART console using old nokia DKU-5 datacable. (3.3v TTL)