Introduction to FPGA and its Architecture

Priyabrata Biswas
Towards Data Science
6 min readNov 20, 2019

--

Not so long ago, most software was permanently shipped along with their respective hardware, and there was no way to change it. But as technology matured, manufacturers found ways to update the software with additional features on existing hardware.

Now, imagine a future where hardware updates also become a possibility — wouldn’t that be fascinating?

Well, such programmable hardware whose sub-system configurations can be modified even after fabrication, falls under the category of Reconfigurable System. And the most predominant integrated circuit that supports reconfigurable computing is FPGA, an acronym for Field Programmable Gate Array.

FPGA enables you to program product features, adapt to new standards, and reconfigure hardware for specific applications even after the product has been installed in the field — hence the term ‘field-programmable’. Whereas ‘gate arrays’ refer to two-dimensional array of logic gates present in its architecture.

All modern personal computers including desktops, notebooks, smartphones, and tablets, are examples of general-purpose computers. General-purpose computing incorporates ‘Von Neumann’ approach, which states that an instruction fetch and a data operation cannot occur simultaneously. Therefore, being sequential machines, their performance is also limited.

On the other hand, we have the Application Specific Integrated Circuits (ASICs) which are customized for a particular task like a digital voice recorder or a high-efficiency Bitcoin miner. An ASIC uses a spatial approach to implement only one application and provides maximum performance. However, it can’t be used for the tasks other than those for which it has been originally designed.

So, how about trading off the performance of ASICs for the flexibility of general-purpose processors?

Well…

FPGAs act as a middle ground between these two architectural paradigms!

Having said that, FPGAs are less energy efficient when compared to ASICs and also not suitable for large volume productions. However, they are reprogrammable and have low NRE costs when compared to an ASIC.

You see, ASICs and FPGAs have different value propositions. Most device manufacturers typically prefer FPGAs for prototyping and ASICs for very large production volumes.

Photo by numato.com

FPGAs used to be chosen for lower speed and complex designs in the past, but nowadays FPGAs can easily surpass the 500 MHz performance benchmark.

Internal Architecture of FPGA

In 1985, a semiconductor manufacturing company named Xilinx invented the first commercially viable FPGA — XC2064. Another company Altera, which was acquired by Intel in 2015, also pushed the boundaries and drove this market forward along with Xilinx.

FPGA emerged from relatively simpler technologies such as programmable read-only memory (PROM) and programmable logic devices (PLDs) like PAL, PLA, or Complex PLD (CPLD).

It consists of three main parts:

  • Configurable Logic Blocks — which implement logic functions.
  • Programmable Interconnects — which implement routing.
  • Programmable I/O Blocks — which connect with external components.
The basic architecture of an FPGA

Logic blocks implement the logical functions required by the design and consist of various components such as transistor pairs, look-up tables (LUTs), flip flops, and multiplexers.

You can think of logic blocks as separate modules like lego blocks which can operate in parallel. Unlike a lego block, a logic block is configurable i.e. its internal state can be controlled and you can hook these together by programming the interconnects in order to build something meaningful.

This hierarchy of programmable interconnection is used for allocating resources among configurable logic blocks (CLBs); where routing paths contain wire segments of varying lengths that can be connected via anti-fuse or memory-based techniques.

Each CLB is tied to a switch matrix to access the general routing structure. The switch matrix provides programmable multiplexers, which are used to select the signals in a given routing channel and thereby connect vertical and horizontal lines.

Lastly, the I/O blocks (IOBs) are used to interface the CLBs and routing architecture to the external components.

In earlier FPGAs, there was no processor to run any software; hence implementing an application implied designing the circuit from scratch. So, we could have configured an FPGA to be as simple as an OR gate or as complex as the multi-core processor.

But we have come a long way since XC2064 and the basic FPGA architecture has developed through the addition of more specialized programmable function blocks like ALUs, block RAM, multiplexers, DSP-48, and microprocessors.

FPGA Design Flow

The design flow illustrates the pipeline for implementing and programming any given logic on the physical board. I chose to dub this design flow as FPGA Development Life Cycle or FDLC because of its analogy with SDLC.

FPGA architectural design flow comprises design entry, logic synthesis, design implementation, device programming, and design verification. However, the exact steps vary with manufactures.

Design Entry

The description of the logic can be made using either a schematic editor, a finite state machine (FSM) editor, or a hardware description language (HDL). This is done by selecting components from a given library and providing a direct mapping of the design functions to selected computing blocks.

When designs with a very large amount of function become difficult to manage graphically, HDL may be used to capture the design either in a structural or in a behavioral way. Besides VHDL and Verilog, which are the most established HDLs, several C-like languages are also available such as Handel-C, Impulse C, and SystemC.

Logic Synthesis

This process translates the above VHDL code into a device netlist format for depicting a complete circuit with logical elements. Synthesis involves checking the code syntax and analyzing the hierarchy of the design architecture. Next, the code is compiled along with optimization and the generated netlist is saved as a .ngc file.

Design Implementation

The design implementation process consists of the following steps:

  • Translate: This process combines all the input netlists into the logic design file which is saved as a .ngd file. Here user constraints file assigns the ports to the physical elements.
  • Map: This involves mapping the logic defined by the .ngd file into the components of FPGA and then generating a .ncd file.
  • Place and Route: Here routing places the sub-blocks from the above process into the logic blocks according to the constraints and then connect those blocks.

Device Programming

The above mentioned routed design must be loaded and converted into a format supported by the FPGA. Hence, the routed .ncd file is given to the BitGen program, which generates a bitstream file that contains all the programming information for an FPGA.

Design Verification

This is done all along with the design flow for ensuring that the logic behaves as intended. The following simulations are involved in this process:

  • Behavioral Simulation (RTL Simulation)
  • Functional Simulation
  • Static Timing Simulation

These simulations are done in order to emulate the behavior of the components by providing test patterns to the inputs of the design and observing the outputs.

Future of FPGA

Industry trends are driving FPGAs toward playing a big part in the heterogeneous computing paradigm. Here, heterogeneous computing refers to systems that use more than one type of processor to perform specialized processing capabilities. And all these different processors, including FPGAs, can be programmed via OpenCL — which is an industry-standard development platform.

The thing is FPGA provides cost-efficient parallel computing power which makes it suitable for rapid prototyping. There are cases where FPGA also outperforms GPU when testing a neural network. While GPU might be good for training but when it comes to real-time applications, FPGA is more adaptable. In fact, Microsoft is already putting Intel Stratix FPGA through Microsoft Azure cloud services for accelerating AI.

🔌 In a nutshell…

from automobile to encryption, from chip development to AI inference models, FPGAs offer a certain versatility that appeals to a wide range of users, thus making the future does seem brighter!

--

--