OpenCores
URL https://opencores.org/ocsvn/vhdl-pipeline-mips/vhdl-pipeline-mips/trunk

Subversion Repositories vhdl-pipeline-mips

[/] [vhdl-pipeline-mips/] [trunk/] [2_instruction_decoding/] [id_ex_registers.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 elujan
--
2
-- Registros de sinctonización entre las etapas ID y EX
3
--
4
-- Licencia: Copyright 2008 Emmanuel Luján
5
--
6
--      This program is free software; you can redistribute it and/or
7
--      modify it under the terms of the GNU General Public License as
8
--      published by the Free Software Foundation; either version 2 of
9
--      the License, or (at your option) any later version. This program
10
--      is distributed in the hope that it will be useful, but WITHOUT
11
--      ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12
--      or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
13
--      License for more details. You should have received a copy of the
14
--      GNU General Public License along with this program; if not, write
15
--      to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
16
--      Boston, MA 02110-1301 USA.
17
-- 
18
-- Autor:       Emmanuel Luján
19
-- Email:       info@emmanuellujan.com.ar
20
-- Versión:    1.0
21
--
22
 
23
library ieee;
24
use ieee.std_logic_1164.all;
25
use ieee.numeric_std.all;
26
 
27
library work;
28
use work.records_pkg.all;
29
use work.segm_mips_const_pkg.all;
30
 
31
 
32
entity ID_EX_REGISTERS is
33
        port(
34
                --Entradas
35
                CLK                             : in    STD_LOGIC;                              -- Reloj
36
                RESET                           : in    STD_LOGIC;                              -- Reset asincrónico
37
                --Salidas de la etapa de Búsqueda de la Instrucción (IF)
38
                NEW_PC_ADDR_IN                  : in    STD_LOGIC_VECTOR (INST_SIZE-1 downto 0);-- Nueva dirección del PC
39
                --Salidas generadas a partir de la instrucción
40
                OFFSET_IN                       : in    STD_LOGIC_VECTOR (INST_SIZE-1 downto 0);-- Offset de la instrucción  [15-0]
41
                RT_ADDR_IN                      : in    STD_LOGIC_VECTOR (ADDR_SIZE-1 downto 0);-- Dirección del registro RT [20-16]
42
                RD_ADDR_IN                      : in    STD_LOGIC_VECTOR (ADDR_SIZE-1 downto 0);-- Dirección del registro RD [15-11]
43
                --Salidas del Banco de Registros
44
                RS_IN                           : in    STD_LOGIC_VECTOR (INST_SIZE-1 downto 0);-- Datos leidos de la dir. Rs
45
                RT_IN                           : in    STD_LOGIC_VECTOR (INST_SIZE-1 downto 0);-- Datos leidos de la dir. Rt
46
                --Salidas de la Unidad de Control
47
                WB_IN                           : in    WB_CTRL_REG;                            -- Señales de control para la etapa WB
48
                M_IN                            : in    MEM_CTRL_REG;                           -- Señales de control para la etapa MEM
49
                EX_IN                           : in    EX_CTRL_REG;                            -- Señales de control para la etapa EX
50
 
51
                --Salidas
52
 
53
                --Salidas de la etapa de Búsqueda de la Instrucción (IF)
54
                NEW_PC_ADDR_OUT                 : out   STD_LOGIC_VECTOR (INST_SIZE-1 downto 0);-- Nueva dirección del PC
55
                --Salidas generadas a partir de la instrucción
56
                OFFSET_OUT                      : out   STD_LOGIC_VECTOR (INST_SIZE-1 downto 0);-- Offset de la instrucción  [15-0]
57
                RT_ADDR_OUT                     : out   STD_LOGIC_VECTOR (ADDR_SIZE-1 downto 0);-- Dirección del registro RT [20-16]
58
                RD_ADDR_OUT                     : out   STD_LOGIC_VECTOR (ADDR_SIZE-1 downto 0);-- Dirección del registro RD [15-11]
59
                --Salidas del Banco de Registros
60
                RS_OUT                          : out   STD_LOGIC_VECTOR (INST_SIZE-1 downto 0);-- Datos leidos de la dir. Rs
61
                RT_OUT                          : out   STD_LOGIC_VECTOR (INST_SIZE-1 downto 0);-- Datos leidos de la dir. Rt
62
                --Salidas de la Unidad de Control
63
                WB_OUT                          : out   WB_CTRL_REG;                            -- Estas señales se postergarán hasta la etapa WB
64
                M_OUT                           : out   MEM_CTRL_REG;                           -- Estas señales se postergarán hasta la etapa MEM
65
                EX_OUT                          : out   EX_CTRL_REG                             -- Estas señales se postergarán hasta la etapa EX
66
        );
67
end ID_EX_REGISTERS;
68
 
69
architecture ID_EX_REGISTERS_ARC of ID_EX_REGISTERS is
70
begin
71
        SYNC_ID_EX:
72
          process(CLK,RESET,NEW_PC_ADDR_IN,OFFSET_IN,RT_ADDR_IN,RD_ADDR_IN,RS_IN,RT_IN,WB_IN,M_IN,EX_IN)
73
          begin
74
                if RESET = '1' then
75
                                NEW_PC_ADDR_OUT         <= (others => '0');
76
                                OFFSET_OUT              <= (others => '0');
77
                                RT_ADDR_OUT             <= (others => '0');
78
                                RD_ADDR_OUT             <= (others => '0');
79
                                RS_OUT                  <= (others => '0');
80
                                RT_OUT                  <= (others => '0');
81
                                WB_OUT                  <= ('0','0');
82
                                M_OUT                   <= ('0','0','0');
83
                                EX_OUT                  <= ('0',('0','0','0'),'0');
84
                elsif rising_edge(CLK) then
85
                                NEW_PC_ADDR_OUT         <= NEW_PC_ADDR_IN;
86
                                OFFSET_OUT              <= OFFSET_IN;
87
                                RT_ADDR_OUT             <= RT_ADDR_IN;
88
                                RD_ADDR_OUT             <= RD_ADDR_IN;
89
                                RS_OUT                  <= RS_IN;
90
                                RT_OUT                  <= RT_IN;
91
                                WB_OUT                  <= WB_IN;
92
                                M_OUT                   <= M_IN;
93
                                EX_OUT                  <= EX_IN;
94
                end if;
95
          end process;
96
 
97
end ID_EX_REGISTERS_ARC;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.