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

Subversion Repositories vhdl-pipeline-mips

[/] [vhdl-pipeline-mips/] [trunk/] [4_memory_access/] [mem_wb_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 MEM y WB 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
 
32
entity MEM_WB_REGISTERS is
33
        port(
34
                --Entradas
35
                CLK             : in STD_LOGIC;
36
                RESET           : in STD_LOGIC;
37
                WB              : in WB_CTRL_REG;
38
                READ_DATA       : in STD_LOGIC_VECTOR (INST_SIZE-1 downto 0);
39
                ADDRESS         : in STD_LOGIC_VECTOR (INST_SIZE-1 downto 0);
40
                WRITE_REG       : in STD_LOGIC_VECTOR (ADDR_SIZE-1 downto 0);
41
                --Salidas
42
                WB_OUT          : out WB_CTRL_REG;
43
                READ_DATA_OUT   : out STD_LOGIC_VECTOR (INST_SIZE-1 downto 0);
44
                ADDRESS_OUT     : out STD_LOGIC_VECTOR (INST_SIZE-1 downto 0);
45
                WRITE_REG_OUT   : out STD_LOGIC_VECTOR (ADDR_SIZE-1 downto 0)
46
        );
47
end MEM_WB_REGISTERS;
48
 
49
architecture MEM_WB_REGISTERS_ARC of MEM_WB_REGISTERS is
50
begin
51
        SYNC_MEM_WB:
52
                process(CLK,RESET,WB,READ_DATA,ADDRESS,WRITE_REG)
53
                begin
54
                        if RESET = '1' then
55
                                WB_OUT          <= ('0','0');
56
                                READ_DATA_OUT   <= ZERO32b;
57
                                ADDRESS_OUT     <= ZERO32b;
58
                                WRITE_REG_OUT   <= "00000";
59
                        elsif rising_edge(CLK) then
60
                                WB_OUT          <= WB;
61
                                READ_DATA_OUT   <= READ_DATA;
62
                                ADDRESS_OUT     <= ADDRESS;
63
                                WRITE_REG_OUT   <= WRITE_REG;
64
                        end if;
65
                end process;
66
 
67
end MEM_WB_REGISTERS_ARC;

powered by: WebSVN 2.1.0

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