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

Subversion Repositories hicovec

[/] [hicovec/] [trunk/] [cpu/] [groups/] [vector_slice.vhd] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 hmanske
------------------------------------------------------------------
2 4 hmanske
-- PROJECT:     HiCoVec (highly configurable vector processor)
3 2 hmanske
--
4
-- ENTITY:      vector_slice
5
--
6
-- PURPOSE:     slice of the vector executionunit
7
--
8
-- AUTHOR:      harald manske, haraldmanske@gmx.de
9
--
10
-- VERSION:     1.0
11
------------------------------------------------------------------
12
library ieee;
13
use ieee.std_logic_1164.all;
14
use ieee.std_logic_unsigned.all;
15
 
16
use work.cfg.all;
17
use work.datatypes.all;
18
 
19
entity vector_slice is
20
    generic (
21
        slicenr : natural := 0
22
    );
23
    port (
24
        -- clock
25
        clk:                in std_logic;
26
 
27
        -- data inputs
28
        memory_in:          in std_logic_vector(31 downto 0);
29
        scalar_in:          in std_logic_vector(31 downto 0);
30
        shuffle_in:         in std_logic_vector(31 downto 0);
31
        carry_in:           in std_logic;
32
        rshift_in:          in std_logic;
33
 
34
        -- data outputs
35
        v_out:              out std_logic_vector(31 downto 0);
36
        w_out:              out std_logic_vector(31 downto 0);
37
        carry_out:          out std_logic;
38
 
39
        -- control signals
40
        rrrr:               in std_logic_vector(7 downto 0);
41
        vvvv:               in std_logic_vector(7 downto 0);
42
        wwww:               in std_logic_vector(3 downto 0);
43
        k_in:               in std_logic_vector(31 downto 0);
44
        load_r:             in std_logic;
45
        cc9:                in std_logic_vector(1 downto 0);
46
        c12:                in std_logic;
47
 
48
        -- valu control signals
49
        valuop:             in std_logic_vector(3 downto 0);
50
        source_sel:         in std_logic_vector(1 downto 0);
51
        carry_sel:          in std_logic_vector(1 downto 0);
52
        mult_source_sel:    in std_logic_vector(1 downto 0); -- *
53
        mult_dest_sel:      in std_logic_vector(1 downto 0); -- *
54
        reg_input_sel:      in std_logic;                    -- *
55
        load_lsr:           in std_logic;
56
        load_other:         in std_logic
57
    );
58
end vector_slice;
59
 
60
architecture rtl of vector_slice is
61
    component multiplexer4
62
        generic (
63
            w : positive
64
        );
65
        port (
66
            selector:    in std_logic_vector(1 downto 0);
67
            data_in_00:  in std_logic_vector(w-1 downto 0);
68
            data_in_01:  in std_logic_vector(w-1 downto 0);
69
            data_in_10:  in std_logic_vector(w-1 downto 0);
70
            data_in_11:  in std_logic_vector(w-1 downto 0);
71
            data_out:    out std_logic_vector(w-1 downto 0)
72
        );
73
    end component;
74
 
75
 
76
    component vector_alu_32
77
        port(
78
            clk:                in std_logic;
79
            v_in:               in std_logic_vector(31 downto 0);
80
            w_in:               in std_logic_vector(31 downto 0);
81
            carry_in:           in std_logic;
82
            rshift_in:          in std_logic;
83
            carry_out:          out std_logic;
84
            valu_out:           out std_logic_vector(31 downto 0);
85
            valuop:             in std_logic_vector(3 downto 0);
86
            source_sel:         in std_logic_vector(1 downto 0);
87
            carry_sel:          in std_logic_vector(1 downto 0);
88
            mult_source_sel:    in std_logic_vector(1 downto 0);
89
            mult_dest_sel:      in std_logic_vector(1 downto 0);
90
            reg_input_sel:      in std_logic;
91
            load_lsr:           in std_logic;
92
            load_other:         in std_logic
93
        );
94
    end component;
95
 
96
    component vector_register
97
        generic (
98
            n : integer range 1 to 256;
99
            slicenr : natural
100
        );
101
 
102
        port (
103
            clk:            in  std_logic;
104
            r_in:           in  std_logic_vector(31 downto 0);
105
            v_out:          out std_logic_vector(31 downto 0);
106
            w_out:          out std_logic_vector(31 downto 0);
107
            load_r:         in  std_logic;
108
            load_select:    in  std_logic;
109
            k_in:           in  std_logic_vector(31 downto 0);
110
            select_v:       in  std_logic_vector(7 downto 0);
111
            select_w:       in  std_logic_vector(3 downto 0);
112
            select_r:       in  std_logic_vector(7 downto 0)
113
        );
114
    end component;
115
 
116
    for vreg_input_mux: multiplexer4 use entity work.multiplexer4(rtl);
117
    for valu:           vector_alu_32 use entity work.vector_alu_32(rtl);
118
    for vreg:           vector_register use entity work.vector_register(rtl);
119
 
120
    signal v:                   std_logic_vector(31 downto 0);
121
    signal w:                   std_logic_vector(31 downto 0);
122
    signal r:                   std_logic_vector(31 downto 0);
123
    signal valu_result:         std_logic_vector(31 downto 0);
124
 
125
begin
126
    v_out <= v;
127
    w_out <= w;
128
 
129
    vreg_input_mux: multiplexer4
130
            generic map (w => 32)
131
            port map (
132
                selector => cc9,
133
                data_in_00 => valu_result,
134
                data_in_01 => scalar_in,
135
                data_in_10 => memory_in,
136
                data_in_11 => shuffle_in,
137
                data_out => r
138
            );
139
 
140
     vreg: vector_register
141
            generic map (
142
                n => n,
143
                slicenr => slicenr
144
            )
145
            port map (
146
                clk => clk,
147
                r_in => r,
148
                v_out => v,
149
                w_out => w,
150
                load_r => load_r,
151
                load_select => c12,
152
                k_in => k_in,
153
                select_v => vvvv,
154
                select_w => wwww,
155
                select_r => rrrr
156
            );
157
 
158
         valu: vector_alu_32
159
            port map (
160
                clk => clk,
161
                v_in => v,
162
                w_in => w,
163
                carry_in => carry_in,
164
                rshift_in => rshift_in,
165
                carry_out => carry_out,
166
                valu_out => valu_result,
167
                valuop => valuop,
168
                source_sel => source_sel,
169
                carry_sel => carry_sel,
170
                mult_source_sel => mult_source_sel,
171
                mult_dest_sel => mult_dest_sel,
172
                reg_input_sel => reg_input_sel,
173
                load_lsr => load_lsr,
174
                load_other => load_other
175
            );
176
 
177
end rtl;

powered by: WebSVN 2.1.0

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