A apresentação está carregando. Por favor, espere

A apresentação está carregando. Por favor, espere

VHDL VHSIC Hardware Description Language Very High Speed Integrated Circuits VHDL-87 VHDL-93.

Apresentações semelhantes


Apresentação em tema: "VHDL VHSIC Hardware Description Language Very High Speed Integrated Circuits VHDL-87 VHDL-93."— Transcrição da apresentação:

1 VHDL VHSIC Hardware Description Language Very High Speed Integrated Circuits VHDL-87 VHDL-93

2 reg4 d0 d1 d2 d3 en clk s0 s1 s2 s3 entity reg4 is port (d0, d1, d2, d3, en, clk : in bit; s0, s1, s2, s3 : out bit ); end entity reg4; entidade portas de entrada portas de saída declaração da entidade

3 A descrição da implementação interna duma entidade chama-se corpo arquitectural. Uma entidade pode ter vários corpos arquitecturais que correspondem às implementação alternativas. Corpo arquitectural comportamental descreve o funcionamento de um modo abstracto; só inclui processos que especificam acções sequenciais a executar. estrutural descreve que subsistemas compõem a entidade e como estes são interligados. misto algumas partes da entidade são descritas com a ajuda de processos enquanto outras são descritas de modo estrutural.

4 Descrição comportamental architecture Behavioral of reg4 is begin p0: process (d0, d1, d2, d3, en, clk) is begin if en = '1' and clk = '1' then s0 <= d0; s1 <= d1; s2 <= d2; s3 <= d3; end if; end process p0; end Behavioral;

5 Descrição estrutural bit0 s0 s latch s clk d0 bit1 s1 s latch s clk d1 bit2 s2 s latch s clk d2 bit3 s3 s latch s clk d3 gate z and2_gate x y en clk

6 Descrição estrutural entity latch is port ( d, clk : in bit; s : out bit); end latch; architecture beh of latch is begin latch_beh: process (clk, d) is begin if clk = '1' then s <= d; end if; end process latch_beh; end beh; entity and2_gate is Port ( x, y : in bit; z : out bit); end and2_gate; architecture beh of and2_gate is begin z <= x and y; end beh;

7 entity reg4 is Port ( d0, d1, d2, d3, en, clk : in bit; s0, s1, s2, s3 : out bit); end reg4; architecture estrutural of reg4 is signal int_clk : bit; begin bit0: entity work.latch(beh) port map (d0, int_clk, s0); bit1: entity work.latch(beh) port map (d1, int_clk, s1); bit2: entity work.latch(beh) port map (d2, int_clk, s2); bit3: entity work.latch(beh) port map (d3, int_clk, s3); gate: entity work.and2_gate(beh) port map (en, clk, int_clk); end estrutural; instâncias de componentes

8

9 -- Uncomment the following lines to use the declarations that are -- provided for instantiating Xilinx primitive components. -- library UNISIM; -- use UNISIM.VComponents.all;

10 - servem para nomear itens num modelo VHDL; - podem ser de comprimento arbitrário; - só podem incluir letras (A-Z, a- z), digitos (0-9), e _; - devem começar com uma letra; - não podem conter _ no fim; - não podem incluir dois _ seguidos. reg4 bit0 next_state4reg bit0_ next__state identificadores básicos: - servem para possibilitar a interacção entre as ferramentas CAD que processam código VHDL e as ferramentas que usam regras diferentes para os identificadores; - podem conter qualquer sequência de caracteres; - devem ser incluídos entre duas barras \. \4reg4\ \__bit0\ \next__state\ \@#@\ identificadores estendidos: not case-sensitive case-sensitive

11 abs access after alias all and architecture array assert attribute begin block body buffer bus case component configuration constant disconnect downto else elsif end entity exit file for function generate generic group guarded if impure in inertial inout is label library linkage literal loop map mod nand new next nor not null of on open or others out package port postponed procedure process pure range record register reject rem report return rol select severity signal shared sla sll sra srl subtype then to transport type unaffected units until use variable wait when while with xnor xor

12 & ( ) * +, -. / : ; | => ** := /= >=

13 55 12 169 inteiros: 2#10101001#16#A9#8#251# 55.45 1.5E+12 12.0e-03 reais: Os caracteres em VHDL são escritos entre plicas : Fq,

14 Representam sequências de caracteres e são escritas entre aspas: Esta e uma linha0!1Z&%@* Linha 1 e & comprida. - representam sequências de bits; - começam com um caracter (B, b, O, o, X, x) que representa a base.; - escrevem-se entre aspas; - podem incluir _. B0010 b1111_1111 O123 o123 XABCDE x12ab x0a = b0000_1010 o12

15 Um objecto é um item nomeado que pertence a um determinado tipo.

16 - precisam de ser declaradas antes de poderem ser utilizadas. A declaração introduz o nome do objecto, define o seu tipo e pode especificar o valor inicial. constant a : string := "Linha ""1"" e" & "comprida." ; constant numero_de_bits : integer := 4; constant dados : std_logic_vector(11 downto 0) := b"0000_1111_1010"; variable var1 : bit; variable var2 : std_logic := '1'; assume o valor inicial por defeito que depende do tipo da variável

17 As declarações de variáveis e constantes aparecem normalmente na parte declarativa de processos: architecture Behavioral of reg4 is begin p0: process (d0, d1, d2, d3, en, clk) is variable sd0, sd1, sd2, sd3 : bit; begin if en = '1' and clk = '1' then sd0 := d0; sd1 := d1; sd2 := d2; sd3 := d3; end if; s0 <= sd0; s1 <= sd1; s2 <= sd2; s3 <= sd3; end process p0; end Behavioral; A atribuição de um valor à variável (:=) substitui imediatamente o valor anterior desta variável !!! A atribuição de um valor a um sinal (<=) funciona de maneira diferente !!!

18 entity var_sig is port (clk, reset: in std_logic; output : out std_logic); end entity var_sig; architecture behav of var_sig is begin test: process (clk) variable temp_var : std_logic; begin temp_var := '1'; if (temp_var = '1') then output <= temp_var; end if; temp_var := '0'; end process test; end behav;

19 entity var_sig is port (clk, reset: in std_logic; output : out std_logic); end entity var_sig; architecture behav of var_sig is signal temp_sig : std_logic; begin test: process (clk) variable temp_var : std_logic; begin temp_sig <= '1'; if (temp_sig = '1') then output <= temp_sig; else output <= '0'; end if; temp_sig <= '0'; end process test; end behav;


Carregar ppt "VHDL VHSIC Hardware Description Language Very High Speed Integrated Circuits VHDL-87 VHDL-93."

Apresentações semelhantes


Anúncios Google