OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [processor/] [VHDL/] [scarts_core/] [regf.vhd] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 jlechner
-----------------------------------------------------------------------
2
-- This file is part of SCARTS.
3
-- 
4
-- SCARTS is free software: you can redistribute it and/or modify
5
-- it under the terms of the GNU General Public License as published by
6
-- the Free Software Foundation, either version 3 of the License, or
7
-- (at your option) any later version.
8
-- 
9
-- SCARTS is distributed in the hope that it will be useful,
10
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
-- GNU General Public License for more details.
13
-- 
14
-- You should have received a copy of the GNU General Public License
15
-- along with SCARTS.  If not, see <http://www.gnu.org/licenses/>.
16
-----------------------------------------------------------------------
17
 
18
 
19
library ieee;
20
use ieee.std_logic_1164.all;
21
use ieee.numeric_std.all;
22
 
23
use work.scarts_core_pkg.all;
24
use work.scarts_pkg.all;
25
 
26
entity scarts_regf is
27
  generic (
28
    CONF : scarts_conf_type);
29
  port (
30
    wclk    : in  std_ulogic;
31
    rclk    : in  std_ulogic;
32
    hold    : in  std_ulogic;
33
 
34
    wdata   : in  std_logic_vector(CONF.word_size-1 downto 0);
35
    waddr   : in  std_logic_vector(REGADDR_W-1 downto 0);
36
    wen     : in  std_ulogic;
37
    raddr1  : in  std_logic_vector(REGADDR_W-1 downto 0);
38
    raddr2  : in  std_logic_vector(REGADDR_W-1 downto 0);
39
 
40
    rdata1  : out std_logic_vector(CONF.word_size-1 downto 0);
41
    rdata2  : out std_logic_vector(CONF.word_size-1 downto 0));
42
end scarts_regf;
43
 
44
architecture behaviour of scarts_regf is
45
 
46
  signal regfram1i_wdata       : std_logic_vector(CONF.word_size-1 downto 0);
47
  signal regfram1i_waddr       : std_logic_vector(REGADDR_W-1 downto 0);
48
  signal regfram1i_wen         : std_ulogic;
49
  signal regfram1i_raddr       : std_logic_vector(REGADDR_W-1 downto 0);
50
  signal regfram1o_rdata       : std_logic_vector(CONF.word_size-1 downto 0);
51
 
52
  signal regfram2i_wdata       : std_logic_vector(CONF.word_size-1 downto 0);
53
  signal regfram2i_waddr       : std_logic_vector(REGADDR_W-1 downto 0);
54
  signal regfram2i_wen         : std_ulogic;
55
  signal regfram2i_raddr       : std_logic_vector(REGADDR_W-1 downto 0);
56
  signal regfram2o_rdata       : std_logic_vector(CONF.word_size-1 downto 0);
57
 
58
  signal enable : std_ulogic;
59
 
60
begin
61
 
62
  enable <= not hold;
63
 
64
  regfram1i_wdata <= wdata;
65
  regfram1i_waddr <= waddr;
66
  regfram1i_wen   <= wen;
67
  regfram1i_raddr <= raddr1;
68
 
69
  regfram2i_wdata <= wdata;
70
  regfram2i_waddr <= waddr;
71
  regfram2i_wen   <= wen;
72
  regfram2i_raddr <= raddr2;
73
 
74
  rdata1 <= regfram1o_rdata;
75
  rdata2 <= regfram2o_rdata;
76
 
77
  ram1 : scarts_regfram
78
  generic map (CONF => CONF)
79
  port map (wclk   => wclk,
80
            rclk   => rclk,
81
            enable => enable,
82
            wdata  => regfram1i_wdata,
83
            waddr  => regfram1i_waddr,
84
            wen    => regfram1i_wen,
85
            raddr  => regfram1i_raddr,
86
            rdata  => regfram1o_rdata);
87
 
88
  ram2 : scarts_regfram
89
  generic map (CONF => CONF)
90
  port map (wclk   => wclk,
91
            rclk   => rclk,
92
            enable => enable,
93
            wdata  => regfram2i_wdata,
94
            waddr  => regfram2i_waddr,
95
            wen    => regfram2i_wen,
96
            raddr  => regfram2i_raddr,
97
            rdata  => regfram2o_rdata);
98
 
99
end behaviour;

powered by: WebSVN 2.1.0

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