1 / 15

MIPS Monociclo Implementação em VHDL

MIPS Monociclo Implementação em VHDL. Moraes 03/ maio /2011 Incrementada por Calazans em maio /2013. Instruções suportadas. ADDU, SUBU, AND, OR, XOR, NOR Formato R ORI, LW, SW Formato I. Hardware. Bloco de Controle. Puramente combinacional

murray
Download Presentation

MIPS Monociclo Implementação em VHDL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MIPS MonocicloImplementaçãoem VHDL Moraes03/maio/2011 IncrementadaporCalazansemmaio/2013

  2. Instruçõessuportadas • ADDU, SUBU, AND, OR, XOR, NOR • Formato R • ORI, LW, SW • Formato I

  3. Hardware

  4. Bloco de Controle • Puramentecombinacional • Recebecódigoobjetodainstruçãoemexecução • Decodifica a instrução • Gera a microinstrução, ouseja, o conjunto de microoperações (sinais de controle)para: • Controle dos multiplexadores (uins.i) • Controle de escrita no banco de registradores (uins.wreg) • Controle de leitura/escritada/namemória (uins.ce, uins.rw (uins.bw)) • OperaçãonaULA (uins.i)

  5. Código VHDL do controle library IEEE; use IEEE.Std_Logic_1164.all; use work.p_MI0.all; entity control_unit is port(ck, rst: in std_logic; -- estessinaissãoinúteisnestaversãoda -- Unidade de Controle, poisela é combinacional uins : out microinstruction; ir : in reg32 ); end control_unit; architecture control_unit of control_unit is signal i : inst_type; begin uins.i <= i; i <= ADDU when ir(31 downto 26)="000000" and ir(10 downto 0)="00000100001" else SUBU when ir(31 downto 26)="000000" and ir(10 downto 0)="00000100011" else AAND when ir(31 downto 26)="000000" and ir(10 downto 0)="00000100100" else OOR when ir(31 downto 26)="000000" and ir(10 downto 0)="00000100101" else XXOR when ir(31 downto 26)="000000" and ir(10 downto 0)="00000100110" else NNOR when ir(31 downto 26)="000000" and ir(10 downto 0)="00000100111" else ORI when ir(31 downto 26)="001101" else LW when ir(31 downto 26)="100011" else SW when ir(31 downto 26)="101011" else invalid_instruction ; -- IMPORTANTE: condição "default" é invalid instruction; assert i /= invalid_instruction report "******************* INVALID INSTRUCTION *************" severity error; uins.ce <= '1' when i=SW or i=LW else '0'; uins.rw <= '0' when i=SW else '1'; uins.wreg <= '0' when i=SW else '1'; end control_unit; Esta atribuição corresponde ao processo de decodificação da instrução em si Demais sinais de controle

  6. Bloco de dados • Cada código objeto de uma instrução define seus operandos • Instruções tipo R: • Processo de controle dos multiplexadores: • instR <= '1' whenuins.i=ADDU oruins.i=SUBU oruins.i=AAND oruins.i=OOR oruins.i=XXOR oruins.i=NNOR else'0'; -- sinal auxiliar que define quando instruçaõ é tipo R • adD<= instruction(15 downto 11) when instR='1' else instruction(20 downto 16); -- Mux: geraendereço de escrita no banco • op2 <= R2 when instR='1' else ext32; -- Mux: geraentrada inferior da ULA

  7. Bloco de dados • Instrução ORI: • 3 multiplexadores: • adD <= instruction(15 downto 11) when instR='1' elseinstruction(20 downto 16); • op2 <= R2 when instR='1' else ext32; -- Mux: gerasegundaentradadaULA • ext32 <=x"FFFF" & instruction(15 downto 0) when (instruction(15)='1’ and (uins.i=LW or uins.i=SW)) elsex"0000" & instruction(15 downto 0); -- extensão de zero!

  8. Bloco de dados • Instruções LW / SW • 3 multiplexadores: • adD <= instruction(15 downto 11) when instR='1' elseinstruction(20 downto 16) ; • op2 <= R2 when instR='1' else ext32; -- Mux: gerasegundaentradada ULA • ext32 <=x"FFFF" & instruction(15 downto 0) when (instruction(15)='1’ and (uins.i=LW or uins.i=SW)) else x"0000" & instruction(15 downto 0); ENDEREÇO É A SOMA DO REG BASE+DESLOCAMENTO

  9. Código VHDL

  10. Código VHDL • Memória de instruções é externa ao processador – ver testbench

  11. Código VHDL

  12. Código VHDL

  13. ULA

  14. BANCO DE REGISTRADORES

  15. TOP

More Related