Documentos de Académico
Documentos de Profesional
Documentos de Cultura
If04 Ee636
If04 Ee636
Informe Final
ABSTRACT
I. INTRODUCCION
Para poder realizar esta experiencia fue muy importante tener presente los trabajos
desarrollados en las experiencias previas, especialmente el de la tercera experiencia, la cual
nos dio un soporte base para el diseño de los diferentes bloques de nuestro CPU monociclo.
Bloque ifetch:
Bloque control:
Bloque execute:
En este bloque se han definido las señales del ALU_Result, la cual me definirá de acuerdo a la
instrucción, la operación entre registros a realizar.
Asimismo se ha definido una señal señal_aux la cual ha sido definida basándonos en el
multiplexor cuya señal de control es el ALUsrc. Tambien se ha desarrollado la expresión de la
señal Add_Result basándonos también en la Fig.1.
Bloque decode:
En este bloque, se han definido las señales read_data_1 y read_data_2 las cuales serán
obtenidas del arreglo de registros register_array. Asimismo, un multiplexor, para la señal write
register_address, las cual puede provenir de dos diferentes caminos: write_register_rt
(Instruction (9 DOWNTO 8)) y write_register_rd (Instruction (7 DOWNTO 6)).
Luego un proceso, donde se inicializa el register_array con la señal de reset, y de forma
síncrona se va actualizando. Así, se consideró que sobre el registro 0 no se puede escribir, y
que en la instrucción jump and link, el valor de R(3) debe ser actualizado con el valor de PC ya
aumentado en 1.
V. RESULTADOS EXPERIMENTALES
1. ANÁLISIS DE TIEMPOS
T min =T cq + T pd +T su
Luego
1
f max = =56.59 MHz
T min
Los peores casos de tsu, tco , tpd y th se dan:
VII. RECONOCIMIENTOS
VIII. REFERENCIAS
[1] Computer Orgamization and Design: The Hardware and Software Interface. CAPITULOS: “El
lenguaje de instrucciones en un computador”, “Estructura interna del procesador” - - David A.
Patterson, Jhon l. Hennessy
ANEXOS
Bloque Control
-- control module (implements TinyMIPS RISC processor control unit)
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.NUMERIC_STD.ALL;
ENTITY control IS
PORT( Opcode : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
RegDst : OUT STD_LOGIC;
ALUSrc : OUT STD_LOGIC;
MemtoReg : OUT STD_LOGIC;
RegWrite : OUT STD_LOGIC;
MemRead : OUT STD_LOGIC;
MemWrite : OUT STD_LOGIC;
Branch : OUT STD_LOGIC;
Jump : OUT STD_LOGIC --auxiliar
);
END control;
Bloque Execute
-- EXEcute stage (implements the data ALU and
-- Branch Address Adder for the TinyMIPS RISC processor)
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.NUMERIC_STD.ALL;
ENTITY EXEcute IS
PORT( Read_data_1 : IN STD_LOGIC_VECTOR(15 DOWNTO 0);
Read_data_2 : IN STD_LOGIC_VECTOR(15 DOWNTO 0);
Sign_extend : IN STD_LOGIC_VECTOR(15 DOWNTO 0);
Opcode : IN STD_LOGIC_VECTOR( 3 DOWNTO 0);
ALUSrc : IN STD_LOGIC;
Zero : OUT STD_LOGIC;
ALU_Result : OUT STD_LOGIC_VECTOR(15 DOWNTO 0);
Add_Result : OUT STD_LOGIC_VECTOR(15 DOWNTO 0);
PC_plus_1 : IN STD_LOGIC_VECTOR(15 DOWNTO 0)
);
END EXEcute;
BEGIN
señal_aux <= Sign_extend when (ALUSrc='1') else
Read_data_2;
process(Read_data_1,señal_aux,Opcode)
begin
case Opcode is
when "0000"|"1001"|"1101"|"1110" => --suma
ALU_Result <= std_logic_vector(unsigned(Read_data_1)+unsigned(señal_aux));
Zero <= '0';
END behavior;
Bloque IDecode
-- IDecode stage (implements the register file for the TinyMIPS RISC processor)
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.NUMERIC_STD.ALL;
ENTITY IDecode IS
PORT( read_data_1 : OUT STD_LOGIC_VECTOR(15 DOWNTO 0);
read_data_2 : OUT STD_LOGIC_VECTOR(15 DOWNTO 0);
Instruction : IN STD_LOGIC_VECTOR(15 DOWNTO 0);
write_data : IN STD_LOGIC_VECTOR(15 DOWNTO 0);
RegWrite : IN STD_LOGIC;
RegDst : IN STD_LOGIC;
Sign_extend : OUT STD_LOGIC_VECTOR(15 DOWNTO 0);
clock : IN STD_LOGIC;
reset : IN STD_LOGIC;
PC_plus_1 : IN STD_LOGIC_VECTOR(15 DOWNTO 0));
END IDecode;
BEGIN
read_register_rs <= Instruction(11 DOWNTO 10);
read_register_rt <= Instruction( 9 DOWNTO 8);
write_register_rt <= Instruction( 9 DOWNTO 8);
write_register_rd <= Instruction( 7 DOWNTO 6);
immediate_value <= Instruction( 7 DOWNTO 0);
Bloque IFetch
-- IFetch stage (provides the PC and instruction memory for the TinyMIPS RISC processor)
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.NUMERIC_STD.ALL;
LIBRARY altera_mf;
USE altera_mf.altera_mf_components.all;
ENTITY IFetch IS
PORT( Instruction_out : OUT STD_LOGIC_VECTOR(15 DOWNTO 0);
PC_plus_1_out : OUT STD_LOGIC_VECTOR(15 DOWNTO 0);
Add_result : IN STD_LOGIC_VECTOR(15 DOWNTO 0);
Branch : IN STD_LOGIC;
Zero : IN STD_LOGIC;
PC_out : OUT STD_LOGIC_VECTOR(15 DOWNTO 0);
clock : IN STD_LOGIC;
clki : IN STD_LOGIC;
reset : IN STD_LOGIC;
Jump : IN STD_LOGIC;
Read_data_1 : IN STD_LOGIC_VECTOR(15 DOWNTO 0));
END IFetch;
PC <= next_PC;
end if;
end process;
PC_plus_1_out <= PC_plus_1;
Instruction_out <= Instruction;
PC_out <= PC;
END behavior;
Bloque WriteBack
-- WriteBack stage of TinyMIPS RISC processor
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.NUMERIC_STD.ALL;
ENTITY WriteBack IS
PORT( MemtoReg : IN STD_LOGIC;
read_data : IN STD_LOGIC_VECTOR(15 DOWNTO 0);
ALU_result : IN STD_LOGIC_VECTOR(15 DOWNTO 0);
write_data : OUT STD_LOGIC_VECTOR(15 DOWNTO 0));
END WriteBack;
BEGIN
END behavior;