sistemes electrÒnics digitals -...

20
EX2: Synthesising sequential systems in CPLD and FPGA using VHDL EX2 de Sistemes Electrònics Digitals GRUP: DATA: Descripció de les aportacions realitzades i de les conclusions d’aquest exercici TEMPS D’ESTUDI I DE PREPARACIÓ DE L’EXERCICI: Sessions TGA a l’aula: Sessions TGB al laboratori Sessions TGC fora de l’horari Aquest apartat és obligatori. Si no és present, no es corregeix l’exercici i s’ha de tornar a lliurar Heu d’apuntar tot el temps d’estudi que heu dedicat a l’exercici 1

Upload: truongdat

Post on 06-Mar-2018

216 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: SISTEMES ELECTRÒNICS DIGITALS - digsys.upc.esdigsys.upc.es/.../2AT4/exercicis/EX2/SED_Curs_08-09_Q…  · Web viewDocument the work using a predefined word processor ... board from

EX2: Synthesising sequential systems in CPLD and FPGA using VHDL

EX2 de Sistemes Electrònics Digitals

GRUP:

DATA:

Descripció de les aportacions realitzades i de les conclusions d’aquest exercici

TEMPS D’ESTUDI I DE PREPARACIÓ DE L’EXERCICI:

Sessions TGA a l’aula:

Sessions TGB al laboratori

Sessions TGC fora de l’horari

Treball individual

Estudiant 1:

Estudiant 2:

Estudiant 3:

Mitjana de temps total (per estudiant)

Aquest apartat és obligatori. Si no és present, no es corregeix l’exercici i s’ha de tornar a lliurar

Heu d’apuntar tot el temps d’estudi que heu dedicat a l’exercici

1

Page 2: SISTEMES ELECTRÒNICS DIGITALS - digsys.upc.esdigsys.upc.es/.../2AT4/exercicis/EX2/SED_Curs_08-09_Q…  · Web viewDocument the work using a predefined word processor ... board from

EPSC – SED: Sistemes Electrònics Digitals

ÍNDEX DE CONTINGUT

Synthesising sequential systems in CPLD and FPGA using VHDL.......................................................3

1.1 Description.....................................................................................................................................3

1.2 Objectives......................................................................................................................................3

1.3 Study time:.....................................................................................................................................3

1.4 First exercise..................................................................................................................................4

1.4.1 Implementation of a sequential system in VHDL...................................................................4

1.5 Second exercise..............................................................................................................................4

1.5.1 Install Quartus II and obtain a valid license file...................................................................4

1.5.2 Run an example project.........................................................................................................6

1.5.1 And migrate your previous design.........................................................................................6

1.6 CPLD and FPGA technology........................................................................................................6

1.7 Implementing the UART transmitter and receiver operational unit..............................................6

1.7.1 VHDL design styles for a sequential system..........................................................................6

1.7.2 UART transmitter block diagram..........................................................................................6

1.8 Desenvolupament de la pràctica/problema. Treball del grup (títol 2)...........................................8

1.8.1 El vostre primer subtítol (títol 3)...........................................................................................8

1.9 Bibliografia i referències consultades............................................................................................8

1.10 Pla de treball que heu preparat per resoldre el disseny..................................................................9

1.11 “Fulls de dubtes” de l’EX2..........................................................................................................10

1.11.1 Sobre l’apartat A) del disseny d’un sistema seqüencial en ispLEVER + Proteus..............10

1.11.2 Sobre els apartats B) i C) d’instal·lació dels programes i tutorial.....................................10

1.11.3 Sobre l’apartat D) de migració d’un disseny anterior VHDL.............................................10

1.11.4 Sobre l’apartat E) de teoria dels CPLD i FPGA.................................................................11

1.11.5 Sobre l’apartat F) d’estils de disseny en VHDL..................................................................11

1.11.1 Sobre l’apartat G) altres components seqüencials del UART.............................................11

2

Page 3: SISTEMES ELECTRÒNICS DIGITALS - digsys.upc.esdigsys.upc.es/.../2AT4/exercicis/EX2/SED_Curs_08-09_Q…  · Web viewDocument the work using a predefined word processor ... board from

EX2: Synthesising sequential systems in CPLD and FPGA using VHDL

MOLT IMPORTANT: Aquest curs s’espera de vosaltres que ja prepareu i editeu textos de certa qualitat, per tant: preneu aquest document de plantilla d’estils i formats. Amplieu-lo i modifiqueu-lo per plantejar, desenvolupar, solucionar i verificar el funcionament del vostre disseny. NO ES POT LLIURAR CAP TREBALL QUE NO SEGUEIX EXACTAMENT AQUESTA PLANTILLA:

- Fixeu-vos que l’índex de contingut de l’exercici es genera automàticament si respecteu els estils: Normal, Títol 1, Títol 2 i Títol 3.

- Respecteu i useu l’estil del peu de figura (Llegenda) i les referències creuades a les figures que s’actualitzen automàticament quan n’inseriu de noves.

- Respecteu i useu les referències creuades a la bibliografia numerada

- Passeu el corrector ortogràfic i repasseu la gramàtica tant si escriviu en anglès, castellà o català.

- Per eliminar errors, feu una segona lectura a través dels companys de grup abans de lliurar l’exercici

Consulteu-nos també qualsevol dubte que tingueu sobre l’edició de documents i aquesta plantilla en particular.

Tingueu en compte les anotacions i indicacions que us han fet els professors en els vostres treballs previs, per tal de no cometre les mateixes errades en aquest treball

ACTIVITATS

Qui Què Com Quan

Grup de treball cooperatiu Edició impresa (primera versió) de l’informe de l’exercici. Imprimiu la pàgina 1 i 2 amb l’índex actualitzat 1 i a partir de la pàgina 12

Amb la plantilla i seguint el documents de criteris de qualitat

Abans de la data límit que trobareu al pla de treball o bé al tauló d’anuncis de la web de SED

Els professors o els companys a través d’una correcció creuada

Correcció de la primera versió

Amb la plantilla d’avaluació

Com a màxim una setmana desprès del lliurament de la primera versió impresa

(amb caràcter voluntari)2

Grup de treball cooperatiu Edició electrònica (segona versió) del document complet amb la incorporació de les millores assenyalades pels correctors

Amb un generador de fitxers PDF

Com a màxim una setmana desprès del lliurament de la correcció. S’enviarà per correu electrònic als professors.

1 Recordeu que l’índex de continguts el genera automàticament el processador de textos

2 És clar que la realització d’aquesta feina addicional millora la qualificació de l’exercici

3

Page 4: SISTEMES ELECTRÒNICS DIGITALS - digsys.upc.esdigsys.upc.es/.../2AT4/exercicis/EX2/SED_Curs_08-09_Q…  · Web viewDocument the work using a predefined word processor ... board from

EPSC – SED: Sistemes Electrònics Digitals

Professors Penjar a la web de SED el document per evidenciar el treball desenvolupat

A través d’un enllaç al document a l’apartat de Grups de Classe

Durant el quadrimestre, si s’escau

NOTA: També es valora la iniciativa. Si el grup cooperatiu vol realitzar una aplicació similar a la presentada en aquest exercici que incorpori els conceptes introduïts, bàsicament el disseny d’un altre sistema digital combinacional amb VHDL, que ho comuniqui als professors i es considerarà.

4

Page 5: SISTEMES ELECTRÒNICS DIGITALS - digsys.upc.esdigsys.upc.es/.../2AT4/exercicis/EX2/SED_Curs_08-09_Q…  · Web viewDocument the work using a predefined word processor ... board from

EX2: Synthesising sequential systems in CPLD and FPGA using VHDL

Synthesising sequential systems in CPLD and FPGA using VHDL

1.1 DescriptionFirstly, you will design a synchronous sequential circuit like a counter or a register using the same EX1 tools (ispLEVER and Proteus) with the objective to comprehend the basic points of a clock based device.

Secondly, you will install the Altera Quartus-II computed aided design (CAD) software for design, simulate and synthesise any kind of electronic digital system into complex programmable logic devices (CPLD) or field-programmable gate arrays (FPGA). As in the previous exercise, you will run a tutorial for analysing the design flow from an initial VHDL project to the final chip programming. In this case, board UP2 from Altera will be used as the hardware platform, and the internal Quartus-II simulator instead of the Proteus, will allow us to verify every component before its final implementation.

Finally, as the third point, you will try to synthesize using VHDL the main components of the asynchronous transmitter and receiver (UART) already started in EX1, with the exception of the FSM (finite state machine) in control of the whole subsystem, which will be reserved for the final EX3.

One of the main characteristics of the proposed design is that it has to be carefully planned (structured) due the large number of blocks involved. Essentially, the project will consist in many VHDL source files to define components to be afterwards instantiated following a hierarchical top-down design approach.

1.2 Objectives After completing the task and studying Units 1.5, 1.6, 1.7, 1.8 and 1.9 students will be able to:

- Remember how to design synchronous sequential systems revisiting ED materials

- Explain how a sequential system can be described as (1) a state register, (2) the next state logic, and (3) the outputs logic

- Search books and the Internet to find information about the basics if VHDL language for analyzing a frequency divider and design cascadable universal BCD counters

- Describe and conceptualize a digital system as an operational unit (OU) or datapath and a control unit (CU)

- Explain the concepts of flat and hierarchical designs using components and their instantiation

- Install and make projects using Quartus-II software following the design flow which basically consists in: (1) VHDL source files; (2) functional simulation; (3) pin assignment and synthesis; (4) gate-level simulation; (5) device programming; and (6) prototype verification

5

Page 6: SISTEMES ELECTRÒNICS DIGITALS - digsys.upc.esdigsys.upc.es/.../2AT4/exercicis/EX2/SED_Curs_08-09_Q…  · Web viewDocument the work using a predefined word processor ... board from

EPSC – SED: Sistemes Electrònics Digitals

- Verify the design using the integrated Quartus-II simulator which runs both, functional and gate-level simulation.

- Use RTL and technology views as a help to interpret the synthesis process

- Explain the basics of the CPLD and FPGA technologies and the way they are programmed.

- Document the work using a predefined word processor template and utilities: spelling and grammar, chapter enumeration, page headers and footers, hyperlinks, cross-references, figure captions, text styles, etc.

- Analyze their own study time

1.3 Study time: The estimated study time for this exercise is 2 weeks3: that means about 13 hours of cooperative work in laboratory sessions (TGA, TGB) or anywhere (TGC).

1.4 First exercise1.4.1 Implementation of a sequential system in VHDL

A) Start and develop a project to implement a synchronous programmable 1/N divider like the one represented in Fig. 1. A 3-bit binary code will be used as the number N by which the input clock frequency is divided. A pulsed waveform

a. Search bibliographical references or the Internet to find a similar design for the entity.

b. Represent a time diagram to show the expected outputs for several N numbers

c. Plan the internal architecture for the entity to be designed using components and interconnections (signals). Translate your architecture into the high-level VHDL file, which also must contain the components’ instantiations.

d. Produce the flux diagram or the ASM (algorithmic state machine chart) for every sequential component and the matching VHDL file.

e. Synthesize and run the application in Proteus. Check the output waveform using the virtual logic analyzer instrument.

3 Students will work in cooperative groups for the whole semester. They will work an average time of 6.5 hours per week.

6

Page 7: SISTEMES ELECTRÒNICS DIGITALS - digsys.upc.esdigsys.upc.es/.../2AT4/exercicis/EX2/SED_Curs_08-09_Q…  · Web viewDocument the work using a predefined word processor ... board from

EX2: Synthesising sequential systems in CPLD and FPGA using VHDL

DIV[2..0]DIV0

DIV2

DIV1

RESET

VCC

R2

10k

CLK

SEQ_SYS

CLOCK_DIV_N

CLK_IN

CD

100

DIV[2..0]

CLK_OUT 0

DIV[2..0] N

000 1

001 2

010 4

011 8

100 16

101 32

110 64

111 128

fCLKOUT=f ¿

N

Fig. 1 Programmable 1/N divider entity

1.5 Second exercise 1.5.1 Install Quartus II and obtain a valid license file

B) Start a process very similar to the one followed to install and validate Lattice Semiconductor software:

a. Get a copy of Quartus II Web edition software version 7.0 or 7.2 (from the Altera web page or from your instructor)

b. Fill in the questionnaire for obtaining a valid licence file from Altera licensing. Use your “professional information” as an EPSC student.

c. Connect the UP2 development board to the computer using the parallel port and the ByteBlasterMV JTAG programming port.

d. Print or draw in a sheet of paper the Altera design flow for CPLD and FPGA for VHDL-only projects. Remark and comment the differences (if any). The design flow, which may be found here4, consists essentially in:

a. VHDL or schematics source files;

b. functional or behavioural simulation;

c. device selection, pin assignment (constraints) and project synthesis;

d. RTL and technology view; 4 http://epsc.upc.edu/projectes/sed/unitats/unitat_1_7/Unitat_1_7.htm

7

Page 8: SISTEMES ELECTRÒNICS DIGITALS - digsys.upc.esdigsys.upc.es/.../2AT4/exercicis/EX2/SED_Curs_08-09_Q…  · Web viewDocument the work using a predefined word processor ... board from

EPSC – SED: Sistemes Electrònics Digitals

e. gate-level (timed) simulation;

f. device programming; and

g. verification using a prototype board

Fig. 2 The main Altera Quartus-II window

8

Page 9: SISTEMES ELECTRÒNICS DIGITALS - digsys.upc.esdigsys.upc.es/.../2AT4/exercicis/EX2/SED_Curs_08-09_Q…  · Web viewDocument the work using a predefined word processor ... board from

EX2: Synthesising sequential systems in CPLD and FPGA using VHDL

Fig. 3 The UP25 board from Altera connected to a power supply and a ByteBlasterMV programming JTAG port to download the configuration file from Quartus-II environment

1.5.2 Run an example project

C) Download from the SED web pages a Quartus-II introductory example project, and run it following instructions available in previous editions of EX2. Write down your comments.

1.5.1 And migrate your previous design

D) Produce your first VHDL-only project adapting your previous design in A). Prepare the project (essentially, using the assignment tool) for programming:

1. (CPLD) MAX7000 family EPM7128SLC84-7

2. (FPGA FLEX 10K family EPF10K70RC240-4

1.6 CPLD and FPGA technologyE) Search Internet to find datasheets or slides to study the architecture and the main technological

characteristics of the Altera CLPD and FPGA devices installed in the UP2 development board. Try to resume the fundamental information in a pair of sheets using figures and comments. Use this UP2 board as the hardware platform for verifying your designs. Many of them are available at the EPSC laboratories.

1.7 Implementing the UART transmitter and receiver operational unit 1.7.1 VHDL design styles for a sequential system

F) Explore the VHDL designs available at the web page for the crystal clock frequency dividers shown in Fig. 4. Write down the main differences in the three VHDL writing styles, and explain why the last style, the one using cascaded blocks instantiating components into a top design is the best option (view the RTL netlist for each design style).

5 Additional information and tutorials in Unit 1.8: http://epsc.upc.edu/projectes/sed/unitats/unitat_1_8/Unitat_1_8.htm

9

Page 10: SISTEMES ELECTRÒNICS DIGITALS - digsys.upc.esdigsys.upc.es/.../2AT4/exercicis/EX2/SED_Curs_08-09_Q…  · Web viewDocument the work using a predefined word processor ... board from

EPSC – SED: Sistemes Electrònics Digitals

CD

CE

CLK

TC25

CD

CE

CLK

TC1007

CD

CE

CLK

TC5000

CD

CLKCE

CLK_1MHzCLK_1kHz

CLK_02Hz

freq_div_5000:Freq_div_5000_Comp1freq_div_1007:Freq_div_1007_Comp1freq_div_25:Freq_div_25_Comp1

Fig. 4 RTL netlist view for the UP2 clock oscillator divider (third design style)

1.7.2 UART transmitter block diagram

G) Using the best coding style (a circuit structure build using components and signals), implement and simulate the following blocks. All of them have to be components for the final UART design as shown in Fig. 5.

a. The clock divider for the UART

b. The 8-bit synchronous parallel register

c. The Mod-8 counter

d. The debouncing filter

e. The 8-bit register with parallel and serial inputs

H) The design of the UART FSM will be reserved for the next EX3.

10

Page 11: SISTEMES ELECTRÒNICS DIGITALS - digsys.upc.esdigsys.upc.es/.../2AT4/exercicis/EX2/SED_Curs_08-09_Q…  · Web viewDocument the work using a predefined word processor ... board from

EX2: Synthesising sequential systems in CPLD and FPGA using VHDL

11

Page 12: SISTEMES ELECTRÒNICS DIGITALS - digsys.upc.esdigsys.upc.es/.../2AT4/exercicis/EX2/SED_Curs_08-09_Q…  · Web viewDocument the work using a predefined word processor ... board from

EPSC – SED: Sistemes Electrònics Digitals

Fig. 5 High level UART transmitter diagram

1.8 Desenvolupament de la pràctica/problema. Treball del grup (títol 2)1.8.1 El vostre primer subtítol (títol 3)

La instal·lació del Quartus-II (títol 4)

Afegiu aquí el vostre text (estil normal) encapçalat amb títols (Títol 2 i 3 i 4), amb figures (estil llegenda o “epígrafe”) i referències creuades en el text com aquesta Fig. 6 (és una referència creuada a la llegenda) a les figures que inseriu. Feu referència també en el text a les fonts bibliogràfiques o de web que consulteu d’aquesta manera [1] (és una referència creuada a l’element numerat [1]). Expliqueu perquè les heu consultat i quina informació útil heu trobat.

Fig. 6 Exemple de peu de figura que segueix la numeració de l’enunciat (llegenda)

1.9 Bibliografia i referències consultadesAmplieu i modifiqueu aquesta secció de referències.

[1] http://epsc.upc.edu/projectes/sed/ . Pàgina web de SED on trobareu materials i treballs de cursos anteriors. Vegeu la secció unitats didàctiques i grups de classe

[2] Brown,S., Vranesic, Z., “Fundamentals of digital logic with VHDL design”, Mc Graw-Hill, 2005

[3] http://epsc.upc.edu/projectes/ed/problemes/problemes_PA/Problemes_PA.htm . Pàgina web d’ED on hi ha el problema que descriu el funcionament i el disseny del descodificador HEX-7SEG.

[4] http://epsc.upc.edu/projectes/sed/projectes_aplicacio/Projectes_Aplic.htm . Lloc on hi trobareu el full de plantilla per a distribuir tasques entre els membres del grup cooperatiu

12

Page 13: SISTEMES ELECTRÒNICS DIGITALS - digsys.upc.esdigsys.upc.es/.../2AT4/exercicis/EX2/SED_Curs_08-09_Q…  · Web viewDocument the work using a predefined word processor ... board from

EX2: Synthesising sequential systems in CPLD and FPGA using VHDL

1.10 Pla de treball que heu preparat per resoldre el disseny

Consulteu els documents de la web [4] per veure com us podeu preparar el pla de treball i el repartiment de tasques per realitzar una bona feina en equip. Useu diagrames de flux, mapes conceptuals, esquemes, taules, etc.

Aquest apartat és obligatori. Si no és present, no es corregeix l’exercici i s’ha de tornar a lliurar

13

Page 14: SISTEMES ELECTRÒNICS DIGITALS - digsys.upc.esdigsys.upc.es/.../2AT4/exercicis/EX2/SED_Curs_08-09_Q…  · Web viewDocument the work using a predefined word processor ... board from

EPSC – SED: Sistemes Electrònics Digitals

1.11 “Fulls de dubtes” de l’EX26

1.11.1 Sobre l’apartat A) del disseny d’un sistema seqüencial en ispLEVER + Proteus

Grup de treball:

Data:

Pla de treball:

1.11.2 Sobre els apartats B) i C) d’instal·lació dels programes i tutorial

Grup de treball:

Data:

Pla de treball:

Dubtes:

6 Afegiu, si és necessari, altres mitjos fulls com aquests per documentar el vostre progrés a través del projecte i poder realitzar consultes i discussions

Aquest apartat és obligatori. Si no és present, no es corregeix l’exercici i s’ha de tornar a lliurar

14

Page 15: SISTEMES ELECTRÒNICS DIGITALS - digsys.upc.esdigsys.upc.es/.../2AT4/exercicis/EX2/SED_Curs_08-09_Q…  · Web viewDocument the work using a predefined word processor ... board from

EX2: Synthesising sequential systems in CPLD and FPGA using VHDL

1.11.3 Sobre l’apartat D) de migració d’un disseny anterior VHDL

Grup de treball:

Data:

Pla de treball:

Dubtes:

15

Page 16: SISTEMES ELECTRÒNICS DIGITALS - digsys.upc.esdigsys.upc.es/.../2AT4/exercicis/EX2/SED_Curs_08-09_Q…  · Web viewDocument the work using a predefined word processor ... board from

EPSC – SED: Sistemes Electrònics Digitals

1.11.4 Sobre l’apartat E) de teoria dels CPLD i FPGA

Grup de treball:

Data:

Pla de treball:

Dubtes:

1.11.5 Sobre l’apartat F) d’estils de disseny en VHDL

Grup de treball:

Data:

Pla de treball:

Dubtes:

1.11.1 Sobre l’apartat G) altres components seqüencials del UART

Grup de treball:

Data:

Pla de treball:

16

Page 17: SISTEMES ELECTRÒNICS DIGITALS - digsys.upc.esdigsys.upc.es/.../2AT4/exercicis/EX2/SED_Curs_08-09_Q…  · Web viewDocument the work using a predefined word processor ... board from

EX2: Synthesising sequential systems in CPLD and FPGA using VHDL

Dubtes:

17