REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

28
UNIVERSITÀ DEGLI STUDI DI TRIESTE Facoltà di Ingegneria Dipartimento di Elettrotecnica, Elettronica ed Informatica REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA Candidato: Matteo GEROMIN Relatore: Prof. Stefano MARSI Correlatore: Ing. Matteo VIT Anno Accademico 2007-2008

description

UNIVERSITÀ DEGLI STUDI DI TRIESTE Facoltà di Ingegneria Dipartimento di Elettrotecnica, Elettronica ed Informatica. REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA. Candidato: Matteo GEROMIN. Relatore: Prof. Stefano MARSI. Correlatore: Ing. Matteo VIT. - PowerPoint PPT Presentation

Transcript of REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

Page 1: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

UNIVERSITÀ DEGLI STUDI DI TRIESTE

Facoltà di IngegneriaDipartimento di Elettrotecnica, Elettronica ed Informatica

REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE

HARDWARE 2D SU FPGA

Candidato:

Matteo GEROMIN

Relatore:

Prof. Stefano MARSI

Correlatore:

Ing. Matteo VIT

Anno Accademico 2007-2008

Page 2: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

2

Sommario• Stato dell’arte:

– Frame Buffer– Acceleratori Grafici

– Sistemi Embedded

• Hardware e Software

• Progetto preesistente

• Progetto realizzato

• Confronto fra i due sistemi

• Sviluppi futuri

Page 3: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

3

Frame Buffer• Immagine composta da tanti pixel• Memorizzati in sequenza nel frame buffer• Profondità colore : 1bpp, 2bpp, 4bpp, 8bpp, 16bpp, 24bpp,

32bpp

Page 4: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

4

Acceleratori grafici• Meno carico al processore di sistema• Accelerazione 2D e 3D• Per il bidimensionale:

– BITblt e sprite– Riempimento aree– Linee e poligoni– Cerchi ed archi– Caratteri

• Uscita video VGA o DVI

Page 5: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

5

Sistemi Embedded• Sistemi a microprocessore dedicati

• Hardware: progettato ad hoc

• Software: dimensioni molto variabili

Page 6: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

6

Obiettivi• Settore: controlli industriali

• Realizzazione prototipo: testare vantaggi dell’accelerazione grafica 2D in sistemi Embedded

Page 7: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

7

Descrizione HardwareXILINX

• ML403 Virtex-4 FX Evaluation Platform• Virtex4-FX (XC4VFX12)• PowerPC 405• 64MB DDR-SDRAM• 1MB ZBT SRAM• VGA DAC• Expansion Headers• RS-232 Serial Port

Page 8: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

8

FPGA e HDL 1/2

• Field Programmable Gate Array

Circuiti logici programmabili

1. CLB Configurable Logic Block

2. Interconnections

3. I/O Blocks

4. Memory blocks

5. Other functions blocks

(DCM, DSP, Multiplier)

Page 9: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

9

FPGA e HDL 2/2

• Hardware Description Language– VHDL, Verilog, SystemC

• Similitudini con linguaggi di programmazione:– If..Then..Else, For, While, Case….

• Differenze con i linguaggi di programmazione:– Organizzazione a moduli– Interazione tramite “fili” e registri – Esecuzione parallela delle istruzioni– Vari livelli di astrazione: Behavioural, Structural, RTL

• Sintesi e simulazione

Page 10: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

10

PowerPC 405• Hard IP• 32 bit RISC (Reduced Instruction Set Computer)• Architettura Harvard• Processor Local Bus

Page 11: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

11

Software utilizzato

• Ambiente di sviluppo e sintesi– EDK (Embedded Development Kit)– ISE (Integrated Software Environment)

• Simulazione– ModelSim-XE & ISE-simulator

• Debug on-chip– ChipScope

Page 12: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

12

Progetto Preesistente• MicroBlaze:

– Soft-ip– PLB or OPB– Harvard– Customizable

• 2D Graphic Engine• Display Controller

– 2MB frame buffer– 640x480– 32 bpp

Block RAM

Page 13: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

13

2D Graphic Engine 1/5

Interfaccia Bus OPB:

• gestione comunicazioni da e verso il bus OPB

• gestione registri

• organizzazione dati e comandi

Page 14: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

14

2D Graphic Engine 2/5

Decoder

• immagazzina e distribuisce i comandi

• monitorizza e comanda i moduli di accelerazione

Page 15: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

15

2D Graphic Engine 3/5

Moduli funzioni accelerate

• illuminazione pixel

• disegno rettangoli

• disegno linee (Bresenham)

• visualizzazione caratteri (maschere)

• elaborano colore e posizione dei pixel

Page 16: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

16

2D Graphic Engine 4/5

Arbiter

• memorizza temporaneamente i pixel elaborati

• invia in successione i pixel al frame buffer

Page 17: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

17

2D Graphic Engine 5/5

Display Controller

• gestione comunicazioni con la ZBT SRAM (frame buffer)

• gestione accessi in memoria

• generazione sincronismi

• lettura pixel ed invio a display

Page 18: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

18

Nuovo Progetto

• OpenCores (www.OpenCores.org)• Bus Wishbone

Page 19: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

19

BUS WishboneArchitettura di comunicazione dati sincrona e parallela.8bit, 16bit, 32bit, 64 bit

Point to PointShared BusCrossbar Swich

Read, Write, RMW

Accesso in burst grazie a terminazione avanzata del ciclo

Protocollo di HandShake (stb, cyc, ack)

Page 20: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

20

Wishbone Conmax ArbiterGestione degli accessi:

– Bus 32bit– 8 Master, 16 Slave– Indirizzamento Slave

con ultimo nibble (4bit) del bus indirizzi

– Fino a 4 livelli di priorità impostabili su registri

– Round-Robin nel caso di priorità uguale

Page 21: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

21

VGA/LCD Controller

Generazione sincronismi e

lettura pixel da Frame Buffer• Interfaccia Slave per

modifica impostazioni• Interfaccia Master per

accesso a Frame Buffer• Profondità di colore:

• 32bpp• 24bpp• 16bpp• 8bpp scala di grigi• 8bpp lookup table

Page 22: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

22

ZBT SRAM Controller• Interfaccia Slave per accesso alla memoria ZBT

SRAM• Accesso singolo in lettura o scrittura (non

ottimizzato)• Accesso in BURST indirizzi consecutivi

Page 23: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

23

Modifiche per l’implementazione• Modulo acceleratore: creazione master e slave

supporto 16bpp (RGB 565)• Indirizzamento slave tramite il terzo Nibble più

significativo di indirizzo• Creazione delle maschere caratteri• Generazione delle frequenze: problema del clock skew

Page 24: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

24

Caratteristiche dei sistemiNuovo Preesistente

Processore PowerPC405 MicroBlaze

F processore 200Mhz 28.57Mhz

F sistema 100Mhz 28.57Mhz

Pixel Clock 25Mhz 28.57Mhz

Risoluzione 640x480 640x480

Accesso diretto FB SI NO

Funz. acc. Line, blit, pix, char Line, blit, pix

Page 25: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

25

Analisi delle prestazioni 1/2

Definitivo Preesistente

medio (us) minimo (us) medio (us) massimo (us)

640x480 30026 - 48359 -

320x480 15012 - 24221 -

320x240 7524 - 12148 -

160x120 1881 681,84 3058 4447

100x100 979,71 357,04 1597 2321

100x50 489,75 180,29 810,98 1175

50x50 244,72 91,04 417,07 603,41

10x10 9,95 4,24 19,67 25,05

Page 26: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

26

Analisi delle prestazioni 2/2

Page 27: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

27

Conclusioni

Page 28: REALIZZAZIONE DI UN SISTEMA EMBEDDED CON ACCELERAZIONE HARDWARE 2D SU FPGA

28

Conclusioni

Sviluppi futuri:– Ottimizzazione accessi al Frame Buffer– FPGA più performante– Supporto risoluzioni e profondità colore

multiple– Separazione acceleratore e processore (PCI)– Standardizzazione registri e funzioni – Driver e sistema operativo (Linux)