1 ---------------------------------------------------------------------------------
5 -- Description: the Instruction Fetch (IF) unit for
6 -- the TUD MB-Lite implementation
8 -- Author: Huib Lincklaen Arriens
9 -- Delft University of Technology
10 -- Faculty EEMCS, Department ME&CE, Circuits and Systems
11 -- Date: September, 2010
15 --------------------------------------------------------------------------------
18 USE IEEE.std_logic_1164.all;
21 --------------------------------------------------------------------------------
23 --------------------------------------------------------------------------------
25 prog_cntr_i : IN STD_LOGIC_VECTOR (31 DOWNTO 0);
26 inc_pc_i : IN STD_LOGIC;
27 EX2IF_i : IN EX2IF_Type;
28 IF2ID_o : OUT IF2ID_Type
33 --------------------------------------------------------------------------------
34 ARCHITECTURE rtl OF fetch IS
35 --------------------------------------------------------------------------------
40 PROCESS ( prog_cntr_i, inc_pc_i, EX2IF_i )
41 VARIABLE next_pc_v : STD_LOGIC_VECTOR (31 DOWNTO 0);
42 VARIABLE incVal_v : STD_LOGIC_VECTOR (31 DOWNTO 0);
43 VARIABLE dummy_v : STD_LOGIC;
45 incVal_v := X"0000000" & '0' & inc_pc_i & "00";
46 ep_add32 ( prog_cntr_i, incVal_v, '0', next_pc_v, dummy_v);
47 IF (EX2IF_i.take_branch = '0') THEN
48 IF2ID_o.program_counter <= next_pc_v;
50 IF2ID_o.program_counter <= EX2IF_i.branch_target;