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

Subversion Repositories vhdl-pipeline-mips

[/] [vhdl-pipeline-mips/] [trunk/] [3_execution/] [ex_mem_registers.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 elujan
--
2
-- Registros de sincronización entre las etapas EX y MEM del procesador MIPS Segmentado
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
entity EX_MEM_REGISTERS is
32
    port(
33
                --Entradas
34
                CLK             :       in STD_LOGIC;                                   --Reloj
35
                RESET           :       in STD_LOGIC;                                   --Reset asincrónico
36
                WB_CR_IN        :       in WB_CTRL_REG;                                 --Estas señales se postergarán hasta la etapa WB
37
                MEM_CR_IN       :       in MEM_CTRL_REG;                                --Estas señales se postergarán hasta la etapa MEM
38
                NEW_PC_ADDR_IN  :       in STD_LOGIC_VECTOR (INST_SIZE-1 downto 0);      --Nueva dirección del PC
39
                ALU_FLAGS_IN    :       in ALU_FLAGS;                                   --Las flags de la ALU
40
                ALU_RES_IN      :       in STD_LOGIC_VECTOR (INST_SIZE-1 downto 0);      --El resultado generado por la ALU
41
                RT_IN           :       in STD_LOGIC_VECTOR (INST_SIZE-1 downto 0);      --Entrará como Write Data en la etapa MEM
42
                RT_RD_ADDR_IN   :       in STD_LOGIC_VECTOR (ADDR_SIZE-1 downto 0);      --Se postergará hasta la etapa WB)     
43
 
44
                --Salidas
45
                WB_CR_OUT       :       out WB_CTRL_REG;                                --Estas señales se postergarán hasta la etapa WB
46
                MEM_CR_OUT      :       out MEM_CTRL_REG;                               --Estas señales se postergarán hasta la etapa MEM
47
                NEW_PC_ADDR_OUT :       out STD_LOGIC_VECTOR (INST_SIZE-1 downto 0);     --Nueva dirección del PC
48
                ALU_FLAGS_OUT   :       out ALU_FLAGS;                                  --Las flags de la ALU
49
                ALU_RES_OUT     :       out STD_LOGIC_VECTOR(INST_SIZE-1 downto 0);      --El resultado generado por la ALU
50
                RT_OUT          :       out STD_LOGIC_VECTOR (INST_SIZE-1 downto 0);     --Entrará como Write Data en la etapa MEM
51
                RT_RD_ADDR_OUT  :       out STD_LOGIC_VECTOR (ADDR_SIZE-1 downto 0)      --Se postergará hasta la etapa WB)     
52
 
53
        );
54
end EX_MEM_REGISTERS;
55
 
56
architecture EX_MEM_REGISTERS_ARC of EX_MEM_REGISTERS is
57
begin
58
 
59
        SYNC_EX_MEM:
60
          process(CLK,RESET,WB_CR_IN,MEM_CR_IN,NEW_PC_ADDR_IN,ALU_FLAGS_IN,ALU_RES_IN,RT_IN,RT_RD_ADDR_IN)
61
          begin
62
                if RESET = '1' then
63
                        WB_CR_OUT       <= ('0','0');
64
                        MEM_CR_OUT      <= ('0','0','0');
65
                        NEW_PC_ADDR_OUT <= ZERO32b;
66
                        ALU_FLAGS_OUT   <= ('0','0','0','0');
67
                        ALU_RES_OUT     <= ZERO32b;
68
                        RT_OUT          <= ZERO32b;
69
                        RT_RD_ADDR_OUT  <= "00000";
70
                elsif rising_edge(CLK) then
71
                        WB_CR_OUT       <= WB_CR_IN;
72
                        MEM_CR_OUT      <= MEM_CR_IN;
73
                        NEW_PC_ADDR_OUT <= NEW_PC_ADDR_IN;
74
                        ALU_FLAGS_OUT   <= ALU_FLAGS_IN;
75
                        ALU_RES_OUT     <= ALU_RES_IN;
76
                        RT_OUT          <= RT_IN;
77
                        RT_RD_ADDR_OUT  <= RT_RD_ADDR_IN;
78
                end if;
79
          end process;
80
 
81
end EX_MEM_REGISTERS_ARC;

powered by: WebSVN 2.1.0

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