-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBufferMemory.vhdl
71 lines (51 loc) · 2.46 KB
/
BufferMemory.vhdl
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY MemBufferEnt IS
generic(
n : integer := 32
);
PORT (
-- Inputs
Clk,Reset,Enable : IN std_logic;
ControlSignals : IN std_logic_vector(27 DOWNTO 0);
SP,MemOut,ALUResult : IN std_logic_vector(n-1 DOWNTO 0);
RDesData : IN std_logic_vector(31 DOWNTO 0);
RSrc2Data : IN std_logic_vector(31 DOWNTO 0);
RDes : IN std_logic_vector(2 DOWNTO 0);
RSrc1 : IN std_logic_vector(2 DOWNTO 0);
RSrc2 : IN std_logic_vector(2 DOWNTO 0);
OP_CODE : IN std_logic_vector(4 DOWNTO 0);
-- Outputs
RDesDataOut : OUT std_logic_vector(31 DOWNTO 0);
RSrc2DataOut : OUT std_logic_vector(31 DOWNTO 0);
RDesOut : OUT std_logic_vector(2 DOWNTO 0);
RSrcOut1 : OUT std_logic_vector(2 DOWNTO 0);
RSrcOut2 : OUT std_logic_vector(2 DOWNTO 0);
ControlSignalsOut: OUT std_logic_vector(27 DOWNTO 0);
SPOut,MemOutOut,ALUResultOut : OUT std_logic_vector(n-1 DOWNTO 0);
OP_CODE_OUT : OUT std_logic_vector(4 DOWNTO 0)
);
END ENTITY;
ARCHITECTURE MemBufferArch OF MemBufferEnt IS
COMPONENT RegEnt IS
GENERIC (n : integer := 32);
PORT(
Clk : IN std_logic ;
Reset : IN std_logic ;
Enable : IN std_logic ;
Input : IN std_logic_vector(n-1 DOWNTO 0);
Output : OUT std_logic_vector(n-1 DOWNTO 0)
);
END COMPONENT;
BEGIN
SPBuffer : RegEnt GENERIC MAP(32) PORT MAP(Clk,Reset,Enable,SP,SPOut);
ControlSignalsBuffer : RegEnt GENERIC MAP(28) PORT MAP(Clk,Reset,Enable,ControlSignals,ControlSignalsOut);
MemOutBuffer : RegEnt GENERIC MAP(32) PORT MAP(Clk,Reset,Enable,MemOut,MemOutOut);
ALUResultBuffer : RegEnt GENERIC MAP(32) PORT MAP(Clk,Reset,Enable,ALUResult,ALUResultOut);
RDesDataBuffer : RegEnt GENERIC MAP(32) PORT MAP(Clk,Reset,Enable,RDesData,RDesDataOut);
RSrc2DataBuffer : RegEnt GENERIC MAP(32) PORT MAP(Clk,Reset,Enable,RSrc2Data,RSrc2DataOut);
RDesModule : RegEnt GENERIC MAP(3) PORT MAP(Clk,Reset,Enable,RDes,RDesOut);
RSrc1Module : RegEnt GENERIC MAP(3) PORT MAP(Clk,Reset,Enable,RSrc1,RSrcOut1);
RSrc2Module : RegEnt GENERIC MAP(3) PORT MAP(Clk,Reset,Enable,RSrc2,RSrcOut2);
OpCOdeModule : RegEnt GENERIC MAP(5) PORT MAP(Clk,Reset,Enable,OP_CODE,OP_CODE_OUT);
END ARCHITECTURE;