Tema 1
Tema 1
FPGA
“Cuando tu única
herramienta es un martillo,
tratas todos los problemas
como si fueran clavos”
Estos lenguajes son estándares ANSI e IEEE. Esto quiere decir que son independientes de la
tecnología empleada y del fabricante. Gracias a ello, el intercambio entre los fabricantes y
los usuarios es más fácil permitiendo a los usuarios usar una descripción de un componente
en la simulación de sus diseños. Además estos modelos son reutilizables permitiendo ser
sintetizados por diferentes librerías de distintos fabricantes.
1. Introducción al lenguaje de descripción de Hardware
1.1 EL VHSIC Hardware Description Language (VHDL)
VHDL se trata de un lenguaje de descripción de circuitos electrónicos digitales, esta
significa que mediante él se pueden describir los comportamientos de los circuitos. Este
comportamiento puede transferirse a algún dispositivo con sus componentes propios, con
ellos logrará el comportamiento deseado. El comportamiento el dispositivo es
independiente al hardware del dispositivo.
VHDL no es un lenguaje de programación, por ello, para saber diseñar circuito con él, no solo
se necesita conocer su sintaxis, sino que también es necesario tener una serie de cuestiones
en cuenta:
1950 2000
La librería ieee.numeric_std define una serie de operadores matemáticos que podemos utilizar
con estos tipos, a diferencia de std_logic_vector que no soporta estas operaciones.
Operador Operación
+ Suma
- Resta
* Multiplicación
/ División
mod Modulo
rem Modulo con signo
3. Tipos de datos, operadores y atributos
Operador Operación
> Mayor
< Menor
>= Mayor o igual
<= Menor o igual
/= Diferente
El tipo de datos entero se utiliza para expresar un valor que es un número entero en VHDL. Es
similar al tipo entero en otros lenguajes de programación como C.
El tipo entero es similar a los tipos signed y unsigned. Podemos utilizar el tipo entero para
expresar números y realizar las mismas operaciones aritméticas y de comparación básicas.
3. Tipos de datos, operadores y atributos
3.4 Conversiones de Tipos
4. Funciones y paquetes
4.1 Funciones en VHDL
e1
e2
Función: n e3 Z
. ..
en
Utilizamos funciones para implementar pequeñas porciones de código que podemos reutilizar en
nuestros diseños. En VHDL, una función es un subprograma que toma cero o más valores de
entrada y devuelve un valor de salida calculado. La sintaxis general de una función en VHDL:
4. Funciones y paquetes
4.2 Paquetes en VHDL [Link]
Un paquete VHDL proporciona una forma práctica de
F1
mantener agrupadas una serie de funciones, Funciones
procedimientos, definiciones de tipos, componentes F2
y constantes relacionados entre sí. F3
. ..
Esto nos permite reutilizar cualquiera de los
Fn
elementos del paquete en diferentes diseños VHDL.
En este sentido, los paquetes pueden considerarse
[Link]
similares a las cabeceras en lenguajes de
programación como C.
CONFIGURACION
CIRCUITO 1
CIRCUITO 2
descripción
síntesis
configuración
5. La FPGA
5.3 Estructura Interna de la FPGA
VHDL's strong typing feature ensures that only values of the same type can be assigned to variables or signals, which reduces errors related to type mismatches. This feature requires programmers to be explicit about data types, promoting robustness and reliability in designs . Additionally, strong typing in VHDL necessitates the use of conversion functions for data types, which adds an additional layer of type safety to the design .
The complexity of VHDL's syntax, which derives from ADA, contributes to code verbosity and detailed documentation. This makes VHDL particularly suited for projects requiring thorough documentation and high reliability, such as aerospace and defense systems . The extensive syntax also allows for modular design, making it possible to break down a hardware design into smaller modules, facilitating easier debugging and maintenance .
VHDL's origins, particularly its development by the US Department of Defense in the 1980s and its standardization by IEEE in 1987, laid the groundwork for its use in critical applications like aerospace and defense systems where precision and reliability are paramount . This historical focus on robustness and detailed documentation has made VHDL the preferred choice for systems requiring comprehensive testing and validation, influencing its continued use in high-stakes environments and setting a benchmark for other HDL developments .
Packages in VHDL enhance modularity and reusability by encapsulating related functions, procedures, type definitions, and constants within a single module that can be reused across different designs . This modular approach is analogous to header files in C, enabling designers to apply common functionality to various parts of a project without redefining them, thus streamlining development and ensuring consistency .
An FPGA comprises three fundamental components: Configurable Logic Blocks (CLBs), programmable input/output blocks, and programmable interconnections. CLBs are responsible for implementing the core logical functions and can include elements like Logic Gates and Lookup Tables (LUTs). The input/output blocks determine how the FPGA interfaces with external devices, while the programmable interconnections provide the flexibility needed to configure the logic blocks and the layout of the design dynamically .
The IEEE standardization of VHDL in 1987 (IEEE 1076-1987) marked a significant milestone by providing a universally accepted framework for hardware description, ensuring compatibility and interoperability across different platforms and tools . This standardization facilitated the exchange and reuse of design components, boosted the development of VHDL-centric tools, and solidified VHDL's role in sectors requiring rigorous design standards, thus influencing subsequent generations of hardware description languages .
The signed and unsigned data types in VHDL differ primarily in how they interpret binary data. Signed types interpret values as two's complement numbers, allowing representation of both positive and negative integers . In contrast, unsigned types treat values as non-negative binary integers . This distinction affects arithmetic operations; for example, a signed type can handle negative results while an unsigned type cannot, necessitating careful selection based on the intended operation and expected results .
The bitstream configuration crucially influences FPGA functionality by detailing every connection within the device, essentially programming the "blank slate" to perform specific tasks. It transforms the FPGA from an unconfigured state into a customized circuit, defining how each Configurable Logic Block (CLB) and interconnection operates . This flexibility allows designers to upload new designs without physically altering the hardware, making FPGAs highly adaptable for different applications .
VHDL and Verilog differ significantly in their design focus and use cases. VHDL is derived from ADA and is strongly typed, making it more verbose and detailed. This verbosity is an advantage in critical system designs like aerospace and defense due to its high-level modeling capabilities . Verilog, based on C, has a simpler and more concise syntax, often preferred for commercial applications like ASICs and FPGAs due to its efficiency in simulation and synthesis . While VHDL supports more complex user-defined data types, Verilog offers a less flexible but more straightforward approach .
Hardware description languages, including VHDL, support three main styles of description: structural, behavioral, and dataflow. Structural description specifies the elements and their interconnections, providing a blueprint that closely mirrors physical circuits . Behavioral description focuses on how a system behaves, simulating functionality without detailing physical implementation, which is left to synthesis tools . Dataflow description outlines the flow of data through the system, capturing dependencies and operations in concurrent expressions .