0% found this document useful (0 votes)
266 views3 pages

Tutorial Quartus II - VHDL Pin Assignment

This document discusses pin assignment for VHDL modules in Quartus II. It presents syntax for assigning single-bit signals and multi-bit signals to FPGA pins. An example is shown mapping the inputs and outputs of a static priority encoder to switches and LEDs on the Terasic DE0 board. Pin assignments are made using the chip_pin attribute in VHDL with the target pin names.

Uploaded by

Sidnei Georg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
266 views3 pages

Tutorial Quartus II - VHDL Pin Assignment

This document discusses pin assignment for VHDL modules in Quartus II. It presents syntax for assigning single-bit signals and multi-bit signals to FPGA pins. An example is shown mapping the inputs and outputs of a static priority encoder to switches and LEDs on the Terasic DE0 board. Pin assignments are made using the chip_pin attribute in VHDL with the target pin names.

Uploaded by

Sidnei Georg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Tutorial Quartus II - VHDL Pin Assignment

Apresentação
Este tutorial tem como objetivo apresentar aos usuários uma alternativa de realizar o
mapeamento dos pinos de entrada e saída dos módulos em VHDL com os pinos do FPGA.

Sintaxe
Para sinais de um único bit, ou seja, do tipo std_logic, deve-se utilizar a seguinte sintaxe:
attribute chip_pin of <signal_name> : signal is "<pin_name>";

Conforme pode ser observado, não é necessário utilizar o prefixo “PIN_” antes do nome de
cada pino, diferente de quando é utilizado a ferramenta Pin Planner do Quartus, conforme
pode ser visto na Figura 1.

Figura 1 - Janela de Pin Planner do Quartus II

Guilherme A. Pohl e Cesar A. Zeferino 1




Já para sinais do tipo std_logic_vector, deve-se utilizar virgulas para separar cada pino,
conforme pode ser observado abaixo:
attribute chip_pin of <signal_name> : signal is "<pin_name>, <pin_name>,
<pin_name>, <pin_name>";

Exemplo
O exemplo abaixo implementa um codificador de prioridades estáticas (stactic priority encoder
– spe), com quatro entradas (R0, R1, R2 e R3) e quartos saídas (G0, G1, G2 e G3), onde as
entradas são mapeadas nos switches e as saídas nos leds do FPGA. Além disso, para demonstrar
o funcionamento do mapeamento dos pinos através da sintaxe , o código foi sintetizado na
placa de desenvolvimento terasIC DE0 (Ciclone II EP3C16F484C6), onde foram utilizados os
switches (SW0, SW1, SW2 e SW3) e os leds (LEDG0, LEDG1, LEDG2, LEDG3), conforme
pode ser visto na Figura 2.

H1 J3 J2 J1

G4 H6 H5 J6

Figura 2 - Circuito sintetizado na placa DE0

Guilherme A. Pohl e Cesar A. Zeferino 2




-------------------------------------------------------------------------------------------------
-- Project: spe
-- Author: Guilherme Augusto Pohl
-- Date: 10/04/2017
-- File: spe.vhd
-------------------------------------------------------------------------------------------------
-- Description:
-------------------------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;

entity spe is
port (
i_R0 : in std_logic; -- Input R0
i_R1 : in std_logic; -- Input R1
i_R2 : in std_logic; -- Input R2
i_R3 : in std_logic; -- Input R3
o_G0 : out std_logic; -- Output G0
o_G1 : out std_logic; -- Output G1
o_G2 : out std_logic; -- Output G2
o_G3 : out std_logic); -- Output G3
end spe;

architecture arch_1 of spe is

-- Pin Assignment for Terasic DE0


attribute chip_pin : string;
attribute chip_pin of i_R0 : signal is "J6";
attribute chip_pin of i_R1 : signal is "H5";
attribute chip_pin of i_R2 : signal is "H6";
attribute chip_pin of i_R3 : signal is "G4";
attribute chip_pin of o_G0 : signal is "J1";
attribute chip_pin of o_G1 : signal is "J2";
attribute chip_pin of o_G2 : signal is "J3";
attribute chip_pin of o_G3 : signal is "H1";

begin
-- Combinational Logic
o_G0 <= i_R0;
o_G1 <= (not i_R0) and i_R1;
o_G2 <= (not i_R0) and (not i_R1) and i_R2;
o_G3 <= (not i_R0) and (not i_R1) and (not i_R2) and i_R3;

end arch_1;

Referência
http://quartushelp.altera.com/15.0/mergedProjects/hdl/vhdl/vhdl_file_dir_chip.htm

Guilherme A. Pohl e Cesar A. Zeferino 3

You might also like