-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCPU_AND_MEMORY.vhd
50 lines (44 loc) · 1.38 KB
/
CPU_AND_MEMORY.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
--connects CPU to memory unit
library ieee;
use ieee.std_logic_1164.all;
entity CPU_AND_MEMORY is
port
(
mem_clk,rst : in std_logic
);
end CPU_AND_MEMORY;
architecture arch of CPU_AND_MEMORY is
signal Data_Address : std_logic_vector(31 downto 0);
signal Data_to_memory_out : std_logic_vector(31 downto 0);
signal MemWr_to_memory : std_logic;
signal byte_ena_to_memory : std_logic_vector(3 downto 0);
signal Data_to_CPU_in : std_logic_vector(31 downto 0);
signal Instruction_Address : std_logic_vector(31 downto 0);
signal Instruction_in : std_logic_vector(31 downto 0);
begin
MIPS_CPU: entity work.PIPELINED_MIPS
port map
(
mem_clk => mem_clk,
rst => rst,
Data_Address => Data_Address,
Data_to_memory_out => Data_to_memory_out,
MemWr_to_memory => MemWr_to_memory,
byte_ena_to_memory => byte_ena_to_memory,
Data_to_CPU_in => Data_to_CPU_in,
Instruction_Address => Instruction_Address,
Instruction_in => Instruction_in
);
MEMORY: entity work.memory_unit
port map
(
mem_clk => mem_clk,
address_prog => Instruction_Address,
address_data => Data_Address,
data_in => Data_to_memory_out,
data_out => Data_to_CPU_in,
instruction => Instruction_in,
byteena => byte_ena_to_memory,
MemWr => MemWr_to_memory
);
end architecture arch;