-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEX_MEM.vhd
48 lines (42 loc) · 1.37 KB
/
EX_MEM.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
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
entity EX_MEM is
port (
Clock : in std_logic;
IDEXInstIn : in std_logic_vector(31 downto 0) ;
TargetRegIn : in std_logic_vector(4 downto 0) ;
ALUResultIn : in std_logic_vector(31 downto 0) ;
ReadData2In : in std_logic_vector(31 downto 0) ;
-- MEM signals
MemRead : in std_logic;
MemWrite : in std_logic;
-- WB signals
MemToReg : in std_logic;
RegWrite : in std_logic;
EXMEMInstOut : out std_logic_vector(31 downto 0) ;
TargetRegOut : out std_logic_vector(4 downto 0) ;
ALUResultOut : out std_logic_vector(31 downto 0) ;
ReadData2Out : out std_logic_vector(31 downto 0) ; -- to DM WriteData
MemReadOut : out std_logic;
MemWriteOut : out std_logic;
MemToRegOut : out std_logic;
RegWriteOut : out std_logic
) ;
end EX_MEM ;
architecture Behavior of EX_MEM is
begin
EX_MEM : process( Clock )
begin
if falling_edge(Clock) then
EXMEMInstOut <= IDEXInstIn;
TargetRegOut <= TargetRegIn;
ALUResultOut <= ALUResultIn;
MemReadOut <= MemRead;
MemWriteOut <= MemWrite;
MemToRegOut <= MemToReg;
RegWriteOut <= RegWrite;
ReadData2Out <= ReadData2In;
end if ;
end process ; -- EX_MEM
end architecture ;