-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathebscu.vhd
51 lines (47 loc) · 1.2 KB
/
ebscu.vhd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity ebscu is
port
(
mode: in std_logic;
mpdata: inout std_logic_vector(15 downto 0);
mpaddress: in std_logic_vector(11 downto 0);
userdata: inout std_logic_vector(15 downto 0);
useraddress: in std_logic_vector(2 downto 0);
ramdata: inout std_logic_vector(15 downto 0);
ramaddress: out std_logic_vector(2 downto 0);
mpread: in std_logic;
mpwrite: in std_logic;
userread: in std_logic;
userwrite: in std_logic;
ramread: out std_logic;
ramwrite: out std_logic
);
end ebscu;
architecture main of ebscu is
begin
process(mpread, mpwrite, userread, userwrite)
begin
if mode='0' then
ramread <= mpread;
ramwrite <= mpwrite;
ramaddress <= mpaddress(2 downto 0);
if mpread='1' then
mpdata <= ramdata;
elsif mpwrite='1' then
ramdata <= mpdata;
end if;
elsif mode='1' then
ramread <= userread;
ramwrite <= userwrite;
ramaddress <= useraddress;
if userread='1' then
userdata <= ramdata;
elsif userwrite='1' then
ramdata <= userdata;
end if;
end if;
end process;
end main;