vhdl-I

54
Objetivos del Lenguaje Descriptor de Hardware Especificar circuitos electr´ onicos Simular el circuito previo a su construcci´ on Utilizar las ventajas que brinda un compilador en el control de errores en la construcci´ on del circuito. Ejemplos : Conectar dos salidas a un mismo nodo. Interfaces el´ ectricas incompatibles. ´0´ => 0V < Vout < 0.8V Vin < 1V => ´0´ Vin > 4V => ´1´ ´1´ => 2.8V < Vout < 3.5V Miguel Angel Sagreras () Introducci´on al VHDL 22 de abril de 2010 1 / 53

description

vhdl- basico primera parte

Transcript of vhdl-I

Page 1: vhdl-I

Objetivos del Lenguaje Descriptor de Hardware

Especificar circuitos electronicos

Simular el circuito previo a su construccion

Utilizar las ventajas que brinda un compilador en el control de erroresen la construccion del circuito.Ejemplos :

Conectar dos salidas a un mismo nodo.

Interfaces electricas incompatibles.

´0´ => 0V < Vout < 0.8VVin < 1V => ´0´Vin > 4V => ´1´

´1´ => 2.8V < Vout < 3.5V

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 1 / 53

Page 2: vhdl-I

El Lenguaje Descriptor de Hardware VHDL

VHDL sigla que significa VHSIC Hardware Description Language.

VHSIC significa Very High Speed Integrated Circuit. Fue un programagubernamental del Departamento de Defensa de EE.UU.

Su especificacion se encuentra en la NORMA IEEE-1076.

Objetivos:

Normalizar la descripcion de los circuitos integrados de aplicacionespecıfica o A.S.I.C provistos al DoD.Especificar el comportamiento de circuitos digitales pero no suconstruccion.

Permite la descripcion de los circuitos en base a tres modelos

ComportamientoEstructuralData Flow

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 2 / 53

Page 3: vhdl-I

Entidad de diseno

La entidad de diseno es equivalente al encapsulado de los circuitosintegrados.

Define cuales son sus puertos y los modos de dichos puertos.

Ejemplos de encapsulados:

DIP SMD PLCC

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 3 / 53

Page 4: vhdl-I

Ejemplo de diseno

Contador de dos bits de flanco ascendente y con una entrada de resetasincronica que cuando tenga el valor 1 las salidas deben ponerse en ’0’

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 4 / 53

Page 5: vhdl-I

Encapsulado y entidad de diseno

RST

CONT2

Q1

CLK Q0

Diagrama

e n t i t y cont2 i spo r t (

r s t : i n b i t ;c l k : i n b i t ;q0 : bu f f e r b i t ;q1 : bu f f e r b i t ) ;

end ;

Codigo VHDL

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 5 / 53

Page 6: vhdl-I

Descripcion de la Entidad de diseno

Pasos a seguir

Indentificar la entidad con un nombre.

Definir parametros de construccion generic.

Indentificar y declarar los puertos de acceso port.

Definir los modos de los puertos in, out, inout, etc.

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 6 / 53

Page 7: vhdl-I

Descripcion de modelos estructural y data flow

Las instrucciones que se utilizan en estos modelos se llaman concurrentes.La secuencia en que se escriben no afecta el comportamiento del circuitoespecificado.

Modelo estructural : se interconectan componentes por medio de lassenales.

Modelo data-flow : se asigna un valor a una senal mediante unaexpresion. Tambien se la conoce como Lenguaje de Transferencia deRegistro o RTL.

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 7 / 53

Page 8: vhdl-I

Diagrama en bloque

Q1Q

CLR

CK

QD

CK

CLR

D

RST

CLK

Q0

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 8 / 53

Page 9: vhdl-I

Identificacion de los nodos de interconexion

D0

Q

CLR

CK

QD

CK

CLR

D

RST

CLK

Q0

Q1

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 9 / 53

Page 10: vhdl-I

Identificacion de los nodos de interconexion

D0

Q

CLR

CK

QD

CK

CLR

D

RST

CLK

Q0

Q1

D1

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 9 / 53

Page 11: vhdl-I

Identificacion de unidades de los componentes

D0

Q

CLR

CK

QD

CK

CLR

D

RST

CLK

Q0

Q1

D1

FFD0

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 10 / 53

Page 12: vhdl-I

Identificacion de unidades de los componentes

FFD1

Q

CLR

CK

QD

CK

CLR

D

RST

CLK

Q0

Q1

D0

FFD0

D1

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 10 / 53

Page 13: vhdl-I

Compuertas y componentes

Las compuertas se pueden describir directamente con expresioneslogicas del propio lenguaje por medio de los operadores not, and, or,xor, nor, nand.

Los componentes son los equivalentes de los zocalos en donde luegose conectaran los circuitos integrados representados por la entidad dediseno.

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 11 / 53

Page 14: vhdl-I

Zocalos

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 12 / 53

Page 15: vhdl-I

Declaracion de componentes

En el diagrama se tienen dos unidades de un flip-flop D. Se debe declararun componente cuyo nombre arbitrario sera ffd que luego se referira a unaentidad que cumpla con la funcion de dicho flip-flop.

component f f dport (

c l r : i n b i t ;ck : i n b i t ;d : i n b i t ;q : out b i t ) ;

end component ;

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 13 / 53

Page 16: vhdl-I

Sintaxis del Cuerpo de arquitectura

arch i tec tu re nombre of e n t i d a d i s

Conjunto de d e c l a r a c i o n e s

begin

Conjunto de i n s t r u c c i o n e s

end ;

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 14 / 53

Page 17: vhdl-I

Cuerpo de arquitectura del contador de 2 bits

arch i tec tu re mix of cont2 i ss i gna l d0 , d1 : b i t ;component f f d

port (c l r : i n b i t ;ck : i n b i t ;d : i n b i t ;q : out b i t ) ;

end component ;begin

f f d 0 : f f d port map ( r s t , c l k , d0 , q0 ) ;f f d 1 : f f d port map ( r s t , c l k , d1 , q1 ) ;d0 <= not q0 ;d1 <= q0 xor q1 ;

end ;

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 15 / 53

Page 18: vhdl-I

Pasos a seguir

Realizar un diagrama en bloque.

Identificar los nodos de interconexion.

Declarar los componentes a utilizar.

Declarar las senales que representan los nodos de interconexion.

Interconectar los componentes a traves de dichas senales.

Realizar las asignaciones de senales para generar las compuertasnecesarias que acompanen el circuito.

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 16 / 53

Page 19: vhdl-I

Especificacion completa del contador de dos bits

e n t i t y cont2 i spo r t (

r s t : i n b i t ;c l k : i n b i t ;q0 : bu f f e r b i t ;q1 : bu f f e r b i t ) ;

end ;

a r c h i t e c t u r e mix of cont2 i ss i g n a l d0 , d1 : b i t ;component f f d

por t (c l r : i n b i t ;ck : i n b i t ;d : i n b i t ;q : out b i t ) ;

end component ;beg in

f f d 0 : f f d por t map ( r s t , c l k , d0 , q0 ) ;f f d 1 : f f d por t map ( r s t , c l k , d1 , q1 ) ;d0 <= not q0 ;d1 <= q0 xor q1 ;

end ;

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 17 / 53

Page 20: vhdl-I

Diagrama en bloque completo del contador de dos bits

FFDQ

CLR

CK

QD

CK

CLR

DQ1

Entity

Architecture

in

in

buffer

buffer

not xor

instantiationcomponent

FFD0 FFD1

D1Q0

Q1

Q0

RST

CLK CLK

RST

D0

D0 Q0

CLK

RST

D1Q0 Q1

componentinstantiation

cont2

mix

FFD

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 18 / 53

Page 21: vhdl-I

Diseno por modelo de comportamiento

El circuito se especifica en base a una secuencia de instrucciones que indicacomo sus salidas se modifican en base al valor y/o cambio de sus entradas.

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 19 / 53

Page 22: vhdl-I

Entidad de diseno del flip-flop D

Q

CK

FFD

CLR

D

Diagrama

e n t i t y f f d i spo r t (

c l r : i n b i t ;ck : i n b i t ;d : i n b i t ;q : out b i t ) ;

end ;

Codigo VHDL

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 20 / 53

Page 23: vhdl-I

Descripcion por comportamientoCuerpo de arquitectura del flip-flop D

arch i tec tu re beh of f f d i sbegin

process ( ck , c l r )begin

i f c l r = ’1 ’ thenq <= ’ 0 ’ ;

e l s i f ck ’ e v e n t and ck = ’1 ’ thenq <= d ;

end i f ;end process ;

end ;

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 21 / 53

Page 24: vhdl-I

Entidad de simulacion

e n t i t y t e s t b e n c h i send ;

a r c h i t e c t u r e s i m u l of t e s t b e n c h i ss i g n a l c l o c k : b i t ;s i g n a l r e s e t : b i t ;s i g n a l t s t q 0 : b i t ;s i g n a l t s t q 1 : b i t ;

component cont2por t (

r s t : i n b i t ;c l k : i n b i t ;q0 : bu f f e r b i t ;q1 : bu f f e r b i t ) ;

end component ;beg in

r e s e t <= ’ 1 ’ , ’ 0 ’ a f t e r 30 ns ;c l o c k <= not c l o c k a f t e r 50 ns ;t e s t c o n t 2 : cont2 por t map ( r e s e t , c l o c k , t s t q 0 , t s t q 1 ) ;

end ;

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 22 / 53

Page 25: vhdl-I

Diagrama de tiempos

entity testbench

component testcont2

component ffd0

component ffd1

0 100 200 300 400 500

entity testbench

/testbench/reset

/testbench/clock

/testbench/tstq0

/testbench/tstq1

component testcont2

/testbench/testcont2/rst

/testbench/testcont2/clk

/testbench/testcont2/q0

/testbench/testcont2/q1

/testbench/testcont2/d0

/testbench/testcont2/d1

component ffd0

/testbench/testcont2/ffd0/clr

/testbench/testcont2/ffd0/ck

/testbench/testcont2/ffd0/d

/testbench/testcont2/ffd0/q

component ffd1

/testbench/testcont2/ffd1/clr

/testbench/testcont2/ffd1/ck

/testbench/testcont2/ffd1/d

/testbench/testcont2/ffd1/q

141 ns

Entity:testbench Architecture:simul Date: Thu Aug 17 15:49:27 ART 2006 Row: 1 Page: 1

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 23 / 53

Page 26: vhdl-I

Descripcion por comportamiento

El circuito digital se describe en base a una secuencia de instruccionesque se llaman secuenciales

Las instrucciones secuenciales solo pueden ir dentro de un bloque quepermita su uso. Dichos bloques solo permiten este tipo deinstrucciones y se encuentran en las instrucciones process, function,procedure

Las instrucciones secuenciales son las siguientes :if-then-elsecaseloopnextexit

returnwaitasignacion de senalesasignacion de variablesllamadas a procedimientos

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 24 / 53

Page 27: vhdl-I

Instruccion process

Es una instruccion concurrente. Su bloque de instrucciones permite ladescripcion de circuitos en base al modelo de comportamiento.

Sintaxis :

[ etiqueta : ] process [ ( lista de sensibilidad ) ]declaraciones

begininstrucciones

end process ;

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 25 / 53

Page 28: vhdl-I

Instruccion processBloque de instrucciones

Pueden ir todas instrucciones secuenciales excepto por la instruccionreturn.

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 26 / 53

Page 29: vhdl-I

Instrucciones secuencialesif-then-else

[ etiqueta: ] if condicion thensecuencia de instrucciones secuenciales

{ elsif condicion thensecuencia de instrucciones secuenciales }

[ elsesecuencia de instrucciones secuenciales ]

end if ;

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 27 / 53

Page 30: vhdl-I

Instrucciones secuencialesEjemplo de uso de la instruccion if-then-else

Descripcion por medio del modelo de comportamiento el circuito logicocorrespondiente al siguiente mapa de Karnaugh:

1

1

0

X2

0

1

1

X3

0

1

0

X0

0 0 1 10X1

1 1 0

1 1

1 1

1

1

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 28 / 53

Page 31: vhdl-I

Ejemplo de uso de la instruccion if-then-elseEntidad de diseno

X3

FUN

O

X0

X1

X2

ent i t y FUN i sport (

x0 : i n b i t ;x1 : i n b i t ;x2 : i n b i t ;x3 : i n b i t ;o : out b i t ) ;

end ;

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 29 / 53

Page 32: vhdl-I

Descripcion por comportamiento

a r c h i t e c t u r e compt of fun i sbeg in

p roce s s ( x0 , x1 , x2 , x3 )beg in

o <= ’ 0 ’ ;i f x0 = ’0 ’ then

i f x2 = ’0 ’i f x3 = ’0 ’ then

o <= ’ 1 ’ ;e l s i f x1 = ’1 ’ then ;

o <= ’ 1 ’ ;end i f ;

e l s i f x3 = ’0 ’ and x1 = ’0 ’ theno <= ’ 1 ’ ;

end i f ;e l s e

i f x1 = ’1 ’ theni f x2 = ’0 ’ and x3 = ’1 ’ then

o <= ’ 1 ’ ;e l s i f x2 = ’1 ’ and x3 = ’0 ’ then

o <= ’ 1 ’ ;end i f ;

e l s i f x2 = ’1 ’ and x3 = ’1 ’ theno <= ’ 1 ’ ;

end i f ;end i f ;

end p roce s s ;end ;

X0

1

0

X2

0

1

1

X3

0

1

0

0 0 1 10X1 1 1 0

1 1

1 1

1

1 1

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 30 / 53

Page 33: vhdl-I

Instrucciones secuencialesInstruccion case

[ etiqueta : ] case expresion is

when value { — value } =>secuencia de instrucciones secuenciales

{ when value { — value } =>secuencia de instrucciones secuenciales }

end case ;

value puede ser others en referencia el resto de los casos no enumerados.Ejemplo :

case x i swhen ”00” | ”11” =>

z <= ’ 1 ’ ;when othe r s =>

z <= ’ 0 ’ ;end case ;

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 31 / 53

Page 34: vhdl-I

Declaracion de tipos

Un tipo se caracteriza por un conjunto de valores y un conjunto deoperaciones.

Por ejemplo

el tipo bit permite tener solo dos valores el ’1‘ y el ’0‘.Un tipo mas concreto permitirıa poseer otros valores como por ejemplo0 debil, 1 debil, etc.

Dos tipos distintos podrıan caracterizar dos interfaces electricasdiferentes.

Los tipos se declaran en la parte declarativa de cualquier instruccion.

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 32 / 53

Page 35: vhdl-I

Tipos enumerados

Indica los valores que puede tomar un objeto : signal, variable, constant,declarado con dicho tipo.

Sintaxis:

type identifier is ( emumeration literal {, emumeration literal } )

emumeration literal ::= identifier — character literal

identifier es una de las alternativas posibles que puede tener dicho tipodescripto como un identificador. Ej: TRUE, FALSE

character literal es otra forma de representar una alternativa como uncaracter. Ej: ’1‘, ’0‘.

Ejemplos :type bit is ( ’0‘, ’1’) ;type boolean is ( FLASE, TRUE ) ;

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 33 / 53

Page 36: vhdl-I

Declaracion de variables

Se declaran en la parte declarativa de las instrucciones cuyo bloque solo puedentener instrucciones secuenciales. Ejemplo : process, function, procedure.

Sintaxis :

variable declaration :==variable idenifier list : subtype indication [ := expression ] ;

identifier list es la lista de variables a declarar. Ej : aux1, aux2.

subtype indication indica el tipo de dato que tendran las variables de datosdeclaradas. Ej : bit .

:= expression inicializa la lista de variables con el valor de la expresion. Ej ::= ’1‘

Ejemplo :variable aux : bit := ’1’;

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 34 / 53

Page 37: vhdl-I

Asignacion de variables

variable assignment statement :==[ label : ] target := expression ;

target es el nombre de la variable que se quiere asignar. Ej : aux.

expression es una expresion cuyo valor se asignara en la variable. Ej :cols*rows

Ejemplo :aux := cols*rows ;

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 35 / 53

Page 38: vhdl-I

Diagrama en bloque de un circuito de Mealy

OOMBINACIONAL

EM

MORIA

Qn

Qn+1

XC

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 36 / 53

Page 39: vhdl-I

Ejemplo de un circuito de MealyEntidad de diseno y Diagrama de estados

SEQMLY

X

CLK

O

e n t i t y seqmly i spo r t (

c l k : i n b i t ;x : i n b i t ;o : out b i t ) ;

end ;

X/O

C B

A1/0

0/0

0/0

1/0

1/0

0/1

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 37 / 53

Page 40: vhdl-I

Ejemplo de un circuito de MealyCuerpo de arquitectura y tabla de transiciones

a r c h i t e c t u r e beh of seqmly i sbeg in

p roce s s ( c l k , x )type e s t a d o s i s ( a , b , c ) ;v a r i a b l e e s t a d o : e s t a d o s ;

beg ini f c l k = ’1 ’ and c l k ’ e v e n t then

i f x = ’0 ’ thencase e s t a d o i swhen a =>

e s t a d o := a ;when b =>

e s t a d o := c ;when c =>

e s t a d o := a ;end case ;

e l s ee s t a d o := b ;

end i f ;end i f ;i f x = ’0 ’ then

case e s t a d o i swhen a =>

o <= ’ 1 ’ ;when othe r s =>

o <= ’ 0 ’ ;end case ;

e l s eo <= ’ 0 ’ ;

end i f ;end p roce s s ;

end ;

A

B

C

A B

B

B

C

A

,1

,0

,0 ,0

,0

,0

0 1

X

q

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 38 / 53

Page 41: vhdl-I

Diagrama en bloque de un circuito de Moore

OM

MORIA

COMBINACIONAL

COMBINACIONAL

Qn

Qn+1

X

E

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 39 / 53

Page 42: vhdl-I

Ejemplo de un circuito de MooreEntidad de diseno y diagrama de estados

Q(1)

X

CLK

SEQ

Q(0)

e n t i t y seq i spo r t (

c l k : i n b i t ;x : i n b i t ;q : out b i t v e c t o r (0 to 1 ) ) ;

end ;

01

1

1 1

1

00

00

00

11

10

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 40 / 53

Page 43: vhdl-I

Ejemplo de un circuito de MooreCuerpo de arquitectura y tabla de transiciones

a r c h i t e c t u r e beh of seq i sbeg in

p roce s s ( c l k )v a r i a b l e e s t a d o : b i t v e c t o r (1 downto 0 ) ;

beg ini f c l k = ’1 ’ and c l k ’ e v e n t then

i f x = ’0 ’ thencase e s t a d o i swhen ”00” =>

e s t a d o := ”01” ;when ”01” =>

e s t a d o := ”10” ;when ”10” =>

e s t a d o := ”11” ;when ”11” =>

e s t a d o := ”00” ;end case ;

e l s ecase e s t a d o i swhen ”00” =>

e s t a d o := ”11” ;when ”01” =>

e s t a d o := ”00” ;when ”10” =>

e s t a d o := ”01” ;when ”11” =>

e s t a d o := ”10” ;end case ;

end i f ;q <= e s t a d o ;

end i f ;end p roce s s ;

end ;

10

01

00 01

10

11

00

00

01

10

11

11

10

X

q

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 41 / 53

Page 44: vhdl-I

Diagrama en bloque de un circuito asincronico

Y

retardos

m

co

binacional

X Z

y

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 42 / 53

Page 45: vhdl-I

Ejemplo de un circuito asincronicoEntidad de diseno y diagrama de estados

X

ASINC

Z

Y

e n t i t y a s i n c i spo r t (

x : i n b i t ;y : i n b i t ;z : out b i t ) ;

end ;

XY

d

a a a

b

c c cd

a

c a

c

b 0

0

1

1

00 01 11 10 Z

−−

−−

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 43 / 53

Page 46: vhdl-I

Ejemplo de un circuito asincronicoCuerpo de arquitectura

e n t i t y a s i n c i spo r t (

x : i n b i t ;y : i n b i t ;z : out b i t ) ;

end ;

a r c h i t e c t u r e beh of a s i n c i stype e s t a d o s i s ( a , b , c , d ) ;s i g n a l e s t a d o : e s t a d o s ;

beg inp roce s s ( x , y , e s t a d o )beg in

case e s t a d o i swhen a | b =>

z <= ’ 0 ’ ;when c | d =>

z <= ’ 1 ’ ;end case ;

case b i t v e c t o r (0 to 1 ) ’ ( x&y ) i swhen ”00” =>

case e s t a d o i swhen b =>

e s t a d o <= a ;when c =>

e s t a d o <= d ;

when othe r s =>n u l l ;

end case ;

when ”01” =>case e s t a d o i swhen a =>

e s t a d o <= b ;when d =>

e s t a d o <= c ;when othe r s =>

n u l l ;end case ;

when ”11” =>case e s t a d o i swhen b =>

e s t a d o <= c ;when othe r s =>

n u l l ;end case ;

when ”10” =>i f e s t a d o = d then

e s t a d o <= a ;end i f ;

end case ;end p roce s s ;

end ;

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 44 / 53

Page 47: vhdl-I

Instruccion loop

loop statement ::=[ loop label : ] [ iteration scheme ] loop

sequence of statementend loop ;

iteration scheme ::=while condition

— for identifier in discrete range

discrete range indica un rango de valores. Ej : 0 to 9. Los rangostambien pueden ser identificadores que representen un discrete range.

identifier es el nombre de un ındice que puede referenciarse luegodentro del loop. Alcanza los valores especificados por discrete range.

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 45 / 53

Page 48: vhdl-I

Instruccion next

[ label : ] next [ loop label ] [ when condition ] ;

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 46 / 53

Page 49: vhdl-I

Instruccion next : Ejemplo I

next;

etiqueta2:

etiqueta1: loop

loop

If

secuencia_de_instrucciones

end loop;

secuencia_de_instrucciones

end loop;

secuencia_de_instrucciones

end if;

then......

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 47 / 53

Page 50: vhdl-I

Instruccion next

;

etiqueta2:

etiqueta1: loop

loop

If

secuencia_de_instrucciones

end loop;

secuencia_de_instrucciones

end loop;

secuencia_de_instrucciones

end if;

then......

next etiqueta1

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 48 / 53

Page 51: vhdl-I

Instruccion exit

[ label : ] exit [ loop label ] [ when condition ] ;

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 49 / 53

Page 52: vhdl-I

Instruccion exit : Ejemplo I

exit;

etiqueta2:

etiqueta1: loop

loop

If

secuencia_de_instrucciones

end loop;

secuencia_de_instrucciones

end loop;

secuencia_de_instrucciones

end if;

then......

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 50 / 53

Page 53: vhdl-I

Instruccion exit : Ejemplo II

exit

etiqueta2:

etiqueta1: loop

loop

If

secuencia_de_instrucciones

end loop;

secuencia_de_instrucciones

end loop;

secuencia_de_instrucciones

end if;

then......

etiqueta1;

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 51 / 53

Page 54: vhdl-I

Descripcion de la sintaxis

Los nombres en minusculas se usan para indicar una categorıa sintactica. Por ejemplo:expression

Las palabras escritas en negritas simbolizan palabras claves. Por ejemplo :array, port, entity, . . . .

Una expresion sintactica consiste de un lado izquierdo, el sımbolo ::= que se puede leercomo “se reemplaza por”, y un lado derecho. El lado izquierdo es una categorıa sintactica,el lado derecho es la regla que lo reemplaza.

La barra vertical ” —”separa alternativas a menos que ocurra inmediatamente despues de laapertura de una llave ”{”, en ese caso significa el mismo.

letter or digit ::= letter — digit

choices ::= chioce { — choice }Los corchetes [ ] encierran items opcionales. Las siguientes expresiones son equivalentes.

return statement ::= return [ expression ] ;

return statement ::= return ; — return expression ;

Las llaves { } encierran items que se repiten en el lado derecho de la expresion. Los itemspueden aparecer cero o mas veces. Las siguientes expresiones son equivalentes.

term ::= factor multiplying operator factor

term ::= factor { — multiplying operator factor

Miguel Angel Sagreras () Introduccion al VHDL 22 de abril de 2010 52 / 53