Laboratorio di Sistemi Digitali M A.A. 2010/11

Similar documents
Digital Systems Design. VGA Video Display Generation

VGA video signal generation

12. A B C A B C A B C 1 A B C A B C A B C JK-FF NETr

Lenguaje VHDL. Diseño de sistemas digitales secuenciales

Digital Design with VHDL

Main Points. File layout Directory layout

In this example the length of the vector is determined by D length and used for the index variable.

4 IN 5 OUT MATRIX SWITCHER YUV & Stereo Audio

Dott. Ruggero Giorgianni. Gruppo Pre-intermediate. Il Futuro

VHDL GUIDELINES FOR SYNTHESIS

Programmable Graphics Hardware

The New Luxury World: l identità digitale nel lusso fa la differenza

An Example VHDL Application for the TM-4

Primiano Tucci Università di Bologna

Lezione 10 Introduzione a OPNET

The New Luxury World: l identità digitale nel lusso fa la differenza

Progetto Ombra Milano propone un nuovo progetto dal design tutto italiano. Una SCALA di prestigio accessibile a tutti.

DTI / Titolo principale della presentazione IPHONE ENCRYPTION. Litiano Piccin. 11 ottobre 2014

Our analysis of the results of the experiment did not provide an explanation of its failure, because our data collection lacked the precision needed.

if-then else : 2-1 mux mux: process (A, B, Select) begin if (select= 1 ) then Z <= A; else Z <= B; end if; end process;

PREPOSITION OF PLACE

Step : Create Dependency Graph for Data Path Step b: 8-way Addition? So, the data operations are: 8 multiplications one 8-way addition Balanced binary

Latch versus Register

Agilent 35670A - Dynamic Signal Analyzer

Cisco di Torino

Come utilizzare il servizio di audioconferenza

Intelligent Motorola Portable Radio Energy System

SCADA / Smart Grid Security Who is really in control of our Control Systems?

6 Present perfect simple e continuous (25-27, 30-31)

Sprites in Block ROM

PROGRAMMA CORSO DI LOGIC PRO 9

How To Manage A Network On A Pnet 2.5 (Net 2) (Net2) (Procedure) (Network) (Wireless) (Powerline) (Wired) (Lan 2) And (Net1) (

Versione: 2.1. Interoperabilità del Sistema di Accettazione di SPT

Application Lifecycle Management. Build Automation. Fabrizio Morando Application Development Manger Microsoft Italia

How To Lock A File In A Microsoft Microsoft System

LED Power. Power Supplies for constant current HI-POWER LEDs 350/700mA Alimentatori per LED in corrente costante HI-POWER 350/700mA 82206/700

LAB #3 VHDL RECOGNITION AND GAL IC PROGRAMMING USING ALL-11 UNIVERSAL PROGRAMMER

Using Xilinx ISE for VHDL Based Design

ipratico POS Quick Start Guide v. 1.0

ECE 3401 Lecture 7. Concurrent Statements & Sequential Statements (Process)

Converting the stay permit. from study to work

PASSASPINA E VASCHETTE CANCELLERIA CABLE HOLDERS AND STATIONERY TRAYS

Misurazione performance. Processing time. Performance. Throughput. Francesco Marchioni Mastertheboss.com Javaday IV Roma 30 gennaio 2010

DIRECTORS AND OFFICERS PROPOSTA DI POLIZZA

SURVEILLANCE SYSTEM USING TVCC. SAFECAM System

Converting the Stay Permit

- ProFTPd: - ftp://ftp.proftpd.org/distrib/source/proftpd tar.gz

REMARKS: J.T-SHIRT JERSEY. Consumption sheet printing date 25/07/2011 PAGE 1 L715

Data Distribution & Replication

Your 2 nd best friend

Limiti verticali e classificazione Vertical limits and classification Amendola

Certificates, Certification Authorities and Public-Key Infrastructures

TDD da un capo all altro. Matteo Vaccari (cc) Alcuni diritti riservati

MASTERSOUND. Made in Italy. M a s t e r E m o t i o n. Amplifiers

Gli International Standard on Auditing e gli altri Standard Professionali Internazionali

CGS X X X X X

ITIL v3 - Overview. Claudio Tancini Marzo 2015 INTERNAL USE ONLY

Questionario Medico Medical Questionnaire

How To Test An Electronic Board With A Flying Probe Tester

Public Affairs & Communication Huawei Italia

INFORMATICA INDUSTRIALE

Architectures and Design Methodologies for Micro and Nanocomputing

Technologies and systems for business integration.

Hardware Implementation of the Stone Metamorphic Cipher

Ferramedia Network business center Berlin Dubai, Mumbai e Palermo. sister companies

ONLINE COLLABORATION USING DATABASES IMAGE EDITING SPECIALISED LEVEL CAD2D SPECIALISED LEVEL

Cloud Services: cosa sono e quali vantaggi portano alle aziende manifatturiere

16 ZONE WIRELESS SISTEMA DI SICUREZZA CASA ALLARME AUTO-DIALER

Corso: Mastering Microsoft Project 2010 Codice PCSNET: MSPJ-11 Cod. Vendor: Durata: 3

Banchi Bar bar counters

Digital Design with Synthesizable VHDL

Big Data, Big True. IDC Big Data Conference II, Bologna 19 novembre Fabio Rizzotto IT Research&Consulting Director, IDC Italy

A CAPTIVATING BUSINESS CASE TO WIN APPROVAL

Trademark. a GlobalTrust/Entrust Solution. Guida all utilizzo del Marchio

(1) D Flip-Flop with Asynchronous Reset. (2) 4:1 Multiplexor. CS/EE120A VHDL Lab Programming Reference

Agenda. Michele Taliercio, Il circuito Integrato, Novembre 2001

CNC FOR EDM MACHINE TOOL HARDWARE STRUCTURE. Ioan Lemeni

AutoForm plus R6 Prodotti Stand-alone: Configurazioni compatibili

Source code security testing

BIBLIO design Nevio Tellatin

tel fax

n N e E 0 m A R sr S l /01

Power meter. Caratterizzazione di amplificatori a RF. Amplificatori a RF. Incertezza Corso di Laboratorio di misure ad alta frequenza

ANTAREX. AutoTuning and Adaptivity approach for Energy efficient exascale HPC systems. Type of action: H2020: Research & Innovation Actions (RIA)

Trasmissione di segnali a banda larga per mezzo di impianti elettrici

Transcription:

begin if (RESET_N = '0') then for col in 0 to BOARD_COLUMNS-1 loop for row in 0 to BOARD_ROWS-1 loop... elsif (rising_edge(clock)) then... Laboratorio di Sistemi Digitali M 6 Esercitazione Tetris: View Primiano Tucci primiano.tucci@unibo.it www.primianotucci.com

Agenda Il view deve compiere una sola macro-operazione: a fronte della richiesta REDRAW, deve ridisegnare la scena. Le micro-operazioni da compiere sono, in sequenza: (1) CLEAR del framebuffer; (2) disegno del perimetro della board; (3) disegno dei singoli blocchi della board (ove presenti); (4) FLIP del framebuffer Ogni operazione sul framebuffer può essere eseguita previa verifica del segnale READY Assumete di avere abbastanza tempo per disegnare la board, ovvero, tra quando viene asserito il segnale REDRAW e quando finite di disegnare la board, il contenuto della board rimane invariato. Segnali Controller View Segnali Framebuffer VGA View REDRAW Segnali Datapath View QUERY_CELL[ ] CELL_CONTENT[ ] READY CLEAR DRAW_RECT FILL_RECT DRAW_LINE FLIP COLOR[ ] X0[ ] Y0[ ] X1[ ] Y1[ ]

Specifiche per il disegno della board (X=0; Y=0) AREA SCHERMO (Spazio delle coordinate XY) TOP_MARGIN Costanti VHDL: constant LEFT_MARGIN : integer constant TOP_MARGIN : integer; constant BLOCK_SIZE : integer; constant BLOCK_SPACING : integer; Spaziatura tra i blocchi (e dal bordo scacchiera) di BLOCK_SPACING LEFT_MARGIN Blocchi quadrati di dimensione BLOCK_SIZE e del colore appropriato. Bordo scacchiera

Obiettivo REDRAW Wait READY Clear della scena Wait READY Disegno contorno board Wait READY Disegno blocchi board Wait READY CLEAR COLOR[ ] DRAW_RECT COLOR[ ] X0,Y0,X1,Y1 QUERY_CELL[ ] CELL_CONTENT[ ] FILL_RECT COLOR[ ] X0,Y0,X1,Y1 Flip del framebuffer FLIP

State Chart IDLE (REDRAW = 1 ) WAIT_FOR_READY Transizione Incondizionata (al clock successivo) (READY = 1 ) DRAWING H CLEAR_SCENE CLEAR <= 1 COLOR <= BLACK DRAW_BOARD_OUTLINE COLOR <= RED; omissis FB_DRAW_RECT <= '1'; DRAW_BOARD_BLOCKS X1 <= query.col * BLOCK_SIZE omissis FB_FILL_RECT <= '1'; FLIP FLIP <= '1'; Yes query.col < COLS? /query.col += 1 No Yes query.row < ROWS? /query.row += 1 No

entity Tetris_View is port ( CLOCK RESET_N ALMA MATER STUDIORUM UNIVERSITY OF BOLOGNA VHDL Entità View : in std_logic; : in std_logic; library ieee; use ieee.numeric_std.all; use ieee.std_logic_1164.all; use work.tetris_package.all; use work.vga_package.all; REDRAW FB_READY FB_CLEAR FB_DRAW_RECT FB_DRAW_LINE FB_FILL_RECT FB_FLIP FB_COLOR FB_X0 FB_Y0 FB_X1 FB_Y1 QUERY_CELL CELL_CONTENT ); end entity; : in std_logic; : in std_logic; : out std_logic; : out std_logic; : out std_logic; : out std_logic; : out std_logic; : out color_type; : out xy_coord_type; : out xy_coord_type; : out xy_coord_type; : out xy_coord_type; : out block_pos_type; : in board_cell_type

VHDL Architettura (1/4) architecture RTL of Tetris_View is constant LEFT_MARGIN : integer := 8; -- Margine tra board e schermo constant TOP_MARGIN : integer := 8; -- IDEM (margine alto) constant BLOCK_SIZE : integer := 20; -- Dimensione singolo blocco constant BLOCK_SPACING : integer := 1; -- Dimensione singolo blocco type state_type is (IDLE, WAIT_FOR_READY, DRAWING); type substate_type is (CLEAR_SCENE, DRAW_BOARD_OUTLINE, DRAW_BOARD_BLOCKS, FLIP_FRAMEBUFFER); signal state signal substate : state_type; : substate_type; signal query_cell_r : block_pos_type; begin QUERY_CELL <= query_cell_r;

process(clock, RESET_N) begin if (RESET_N = '0') then state substate FB_CLEAR VHDL Architettura (2/4) FB_DRAW_RECT FB_DRAW_LINE <= IDLE; <= CLEAR_SCENE; <= '0'; <= '0'; <= '0'; FB_FILL_RECT <= '0'; FB_FLIP <= '0'; query_cell_r.col <= 0; query_cell_r.row <= 0; elsif (rising_edge(clock)) then FB_CLEAR <= '0'; FB_DRAW_RECT <= '0'; FB_DRAW_LINE <= '0'; FB_FILL_RECT <= '0'; FB_FLIP <= '0'; Uscite attive solo per un periodo di clock, quando smentite (più sotto)

case (state) is when IDLE => ALMA MATER STUDIORUM UNIVERSITY OF BOLOGNA if (REDRAW = '1') then state <= DRAWING; substate <= CLEAR_SCENE; end if; when WAIT_FOR_READY => if (FB_READY = '1') then state <= DRAWING; end if; when DRAWING => state <= WAIT_FOR_READY; VHDL Architettura (3/4) case (substate) is when CLEAR_SCENE => FB_COLOR <= COLOR_BLACK; FB_CLEAR <= '1'; substate <= DRAW_BOARD_OUTLINE; when DRAW_BOARD_OUTLINE => FB_COLOR FB_X0 FB_Y0 <= COLOR_RED; <= LEFT_MARGIN; <= TOP_MARGIN; FB_X1 <= LEFT_MARGIN + (BOARD_COLUMNS * BLOCK_SIZE); FB_Y1 <= TOP_MARGIN + (BOARD_ROWS * BLOCK_SIZE); FB_DRAW_RECT <= '1'; substate <= DRAW_BOARD_BLOCKS; Ogni operazione grafica fatta nello stato DRAWING per default transita (al clock successivo) in WAIT_FOR_READY when DRAW_BOARD_BLOCKS => Slide successiva when FLIP_FRAMEBUFFER => FB_FLIP <= '1'; state <= IDLE;

VHDL Architettura (4/4) when DRAW_BOARD_BLOCKS => if(cell_content.filled = '1') then FB_COLOR <= Lookup_color(CELL_CONTENT.shape); FB_X0 <= LEFT_MARGIN + (query_cell_r.col * BLOCK_SIZE) + BLOCK_MARGIN; FB_Y0 <= TOP_MARGIN + (query_cell_r.row * BLOCK_SIZE) + BLOCK_MARGIN; FB_X1 <= LEFT_MARGIN + (query_cell_r.col * BLOCK_SIZE) + BLOCK_SIZE - BLOCK_MARGIN; FB_Y1 <= TOP_MARGIN + (query_cell_r.row * BLOCK_SIZE) + BLOCK_SIZE - BLOCK_MARGIN; FB_FILL_RECT <= '1'; end if; if (query_cell_r.col /= BOARD_COLUMNS-1) then query_cell_r.col <= query_cell_r.col + 1; else query_cell_r.col <= 0; if (query_cell_r.row /= BOARD_ROWS-1) then query_cell_r.row <= query_cell_r.row + 1; else query_cell_r.row <= 0; substate <= FLIP_FRAMEBUFFER; end if; end if;