-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUNITE_GESTION_INSTRUCTIONS.vhd
52 lines (40 loc) · 1.31 KB
/
UNITE_GESTION_INSTRUCTIONS.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
52
library IEEE;
use IEEE.std_logic_1164.ALL;
use IEEE.numeric_std.ALL;
entity UNITE_GESTION_INSTRUCTIONS is
---------------------------------------
port ( clk : in std_logic;
reset : in std_logic;
nPCsel : in std_logic;
Offset : in std_logic_vector(23 downto 0);
Instruction : out std_logic_vector(31 downto 0));
end entity UNITE_GESTION_INSTRUCTIONS;
architecture arch_UNITE_GESTION_INSTRUCTIONS of UNITE_GESTION_INSTRUCTIONS is
signal ext_pc : std_logic_vector(31 downto 0);
signal ext_mux : std_logic_vector(31 downto 0);
signal ext_extender : std_logic_vector(31 downto 0);
signal pc_plus_un : std_logic_vector(31 downto 0);
signal pc_plus_offset : std_logic_vector(31 downto 0);
begin
pc_plus_un<=std_logic_vector(signed(ext_pc) + 1);
pc_plus_offset<=std_logic_vector(signed(ext_pc) + 1 + signed(ext_extender));
utt1 : entity work.PC
PORT MAP(E=>ext_mux,
clk=>clk,
reset=>reset,
S=>ext_pc);
utt2 : entity work.MUX2_1
GENERIC MAP(N=>32)
PORT MAP(A=>pc_plus_un,
B=>pc_plus_offset,
COM=>nPCsel,
S=>ext_mux);
utt3 : entity work.INSTRUCTION_MEMORY3
PORT MAP(PC=>ext_pc,
Instruction =>Instruction
);
utt4 : entity work.PC_EXTENDER
port map(E=>Offset,
S=>ext_extender
);
end architecture arch_UNITE_GESTION_INSTRUCTIONS;