OpenCores
URL https://opencores.org/ocsvn/igor/igor/trunk

Subversion Repositories igor

[/] [igor/] [trunk/] [processor/] [pl/] [ex.vhd] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 atypic
library ieee;
2
use ieee.std_logic_1164.all;
3
use ieee.std_logic_unsigned.all;
4
use ieee.numeric_std.all;
5
 
6
use work.whisk_constants.all;
7
 
8
entity exec is
9
    port (
10
    -- data lines
11
    alu_res : out std_logic_vector(WORD_BITS - 1 downto 0);
12
    reg2 : out std_logic_vector(WORD_BITS - 1 downto 0); -- data to be written to main memory
13
 
14
    operand1 : in std_logic_vector(WORD_BITS - 1 downto 0);
15
    operand2 : in std_logic_vector(WORD_BITS - 1 downto 0);
16
    imm : in std_logic_vector(IMM_SIZE - 1 downto 0);
17
 
18
    -- control lines
19
    clk : in std_logic;
20
    alu_funct : in std_logic_vector(ALU_FUNCT_SIZE - 1 downto 0);
21
    reg_write : in std_logic;
22
    branch_taken : out std_logic;
23
    branch_target : out std_logic_vector(MC_ADDR_BITS - 1 downto 0);
24
    alu_flags : out std_logic_vector(STATUS_REG_BITS - 1 downto 0);
25
    exec_reg_write : out std_logic; --forward control signals
26
    exec_reg2_out : out std_logic_vector(WORD_BITS - 1 downto 0)
27
 
28
    );
29
end entity;
30
 
31
architecture mixed of exec is
32
--    signal EXMEM : EXMEM_t;
33
    signal alu_out : std_logic_vector(WORD_BITS - 1 downto 0);
34
begin
35
    branch_target <=  std_logic_vector(unsigned(operand1) + unsigned(operand2));
36
 
37
    alu : entity alu
38
    port map (
39
        in_a => operand1,
40
        in_b => operand2,
41
        funct => alu_funct,
42
        status => alu_flags,
43
        output => alu_out
44
    );
45
 
46
    exec_stage : process (clk)
47
    begin
48
        if rising_edge(clk) then
49
            reg2 <= operand2;
50
            alu_res <= alu_out;
51
            exec_reg_write <= reg_write; -- forward control signal
52
            exec_reg2_out <= operand2;
53
        end if;
54
    end process;
55
end architecture;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.