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

Subversion Repositories hicovec

[/] [hicovec/] [trunk/] [cpu/] [groups/] [registergroup.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:      registergroup
5
--
6
-- PURPOSE:     register file and destination multiplexer
7
--              
8
-- AUTHOR:      harald manske, haraldmanske@gmx.de
9
--
10
-- VERSION:     1.0
11
------------------------------------------------------------------
12
 
13
library ieee;
14
use ieee.std_logic_1164.all;
15
use ieee.std_logic_unsigned.all;
16
 
17
entity registergroup is
18
    port(   -- clock
19
            clk:            in std_logic;
20
 
21
            -- data inputs
22
            result_in:      in std_logic_vector(31 downto 0);   -- data from alu
23
            vector_in:      in std_logic_vector(31 downto 0);   -- data from vector unit
24
            ic_in:          in std_logic_vector(31 downto 0);   -- instruction 
25
            enable_in:      in std_logic;                       -- c6
26
 
27
            -- data outputs
28
            x_out:          out std_logic_vector(31 downto 0);
29
            y_out:          out std_logic_vector(31 downto 0);
30
            a_out:          out std_logic_vector(31 downto 0);
31
 
32
            -- control signals
33
            sel_source:     in std_logic_vector(1 downto 0);    -- cc2
34
            sel_dest:       in std_logic_vector(1 downto 0)     -- dd
35
         );
36
end registergroup;
37
 
38
architecture rtl of registergroup is
39
    component dataregister
40
        port(   clk:        in std_logic;
41
                load:       in std_logic;
42
                data_in:    in std_logic_vector(31 downto 0);
43
                data_out:   out std_logic_vector(31 downto 0)
44
            );
45
    end component;
46
 
47
    component multiplexer4
48
        generic (
49
            w : positive
50
        );
51
        port (
52
            selector:    in std_logic_vector(1 downto 0);
53
            data_in_00:  in std_logic_vector(w-1 downto 0);
54
            data_in_01:  in std_logic_vector(w-1 downto 0);
55
            data_in_10:  in std_logic_vector(w-1 downto 0);
56
            data_in_11:  in std_logic_vector(w-1 downto 0);
57
            data_out:    out std_logic_vector(w-1 downto 0)
58
        );
59
    end component;
60
 
61
    component demultiplexer1x4
62
        port(   selector:       in std_logic_vector(1 downto 0);
63
                data_in:        in std_logic;
64
                data_out_00:    out std_logic;
65
                data_out_01:    out std_logic;
66
                data_out_10:    out std_logic;
67
                data_out_11:    out std_logic
68
            );
69
    end component;
70
 
71
    for reg_x: dataregister use entity work.dataregister(rtl);
72
    for reg_y: dataregister use entity work.dataregister(rtl);
73
    for reg_a: dataregister use entity work.dataregister(rtl);
74
 
75
    for mux_input: multiplexer4 use entity work.multiplexer4(rtl);
76
    for demux: demultiplexer1x4 use entity work.demultiplexer1x4(rtl);
77
 
78
    signal data_in:     std_logic_vector(31 downto 0);
79
    signal load_x:      std_logic;
80
    signal load_y:      std_logic;
81
    signal load_a:      std_logic;
82
 
83
    begin
84
        mux_input: multiplexer4
85
            generic map (
86
                w => 32
87
            )
88
            port map (
89
                selector => sel_source,
90
                data_in_00 => result_in,
91
                data_in_01 => ic_in,
92
                data_in_10 => vector_in,
93
                data_in_11 => "--------------------------------",
94
                data_out => data_in
95
            );
96
 
97
        demux: demultiplexer1x4 port map (
98
            selector => sel_dest,
99
            data_in => enable_in,
100
            data_out_00 => open,
101
            data_out_01 => load_a,
102
            data_out_10 => load_x,
103
            data_out_11 => load_y
104
        );
105
 
106
        reg_x: dataregister port map(
107
            clk => clk,
108
            load => load_x,
109
            data_in => data_in,
110
            data_out => x_out
111
        );
112
 
113
        reg_y: dataregister port map(
114
            clk => clk,
115
            load => load_y,
116
            data_in => data_in,
117
            data_out => y_out
118
        );
119
 
120
        reg_a: dataregister port map(
121
            clk => clk,
122
            load => load_a,
123
            data_in => data_in,
124
            data_out => a_out
125
        );
126
 
127
end rtl;

powered by: WebSVN 2.1.0

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