1
|
|
2
|
-- Copyright (C) 2002 Morgan Kaufmann Publishers, Inc
|
3
|
|
4
|
-- This file is part of VESTs (Vhdl tESTs).
|
5
|
|
6
|
-- VESTs is free software; you can redistribute it and/or modify it
|
7
|
-- under the terms of the GNU General Public License as published by the
|
8
|
-- Free Software Foundation; either version 2 of the License, or (at
|
9
|
-- your option) any later version.
|
10
|
|
11
|
-- VESTs is distributed in the hope that it will be useful, but WITHOUT
|
12
|
-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
13
|
-- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
14
|
-- for more details.
|
15
|
|
16
|
-- You should have received a copy of the GNU General Public License
|
17
|
-- along with VESTs; if not, write to the Free Software Foundation,
|
18
|
-- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19
|
|
20
|
library ieee; use ieee.std_logic_1164.all;
|
21
|
|
22
|
entity reg_ctrl is
|
23
|
port ( reg_addr_decoded, rd, wr, io_en, cpu_clk : in std_ulogic;
|
24
|
reg_rd, reg_wr : out std_ulogic );
|
25
|
end entity reg_ctrl;
|
26
|
|
27
|
--------------------------------------------------
|
28
|
|
29
|
architecture bool_eqn of reg_ctrl is
|
30
|
begin
|
31
|
|
32
|
rd_ctrl : reg_rd <= reg_addr_decoded and rd and io_en;
|
33
|
|
34
|
rw_ctrl : reg_wr <= reg_addr_decoded and wr and io_en
|
35
|
and not cpu_clk;
|
36
|
|
37
|
end architecture bool_eqn;
|