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

Subversion Repositories hicovec

[/] [hicovec/] [trunk/] [cpu/] [groups/] [flaggroup.vhd] - Blame information for rev 5

Go to most recent revision | 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:      flaggroup
5
--
6
-- PURPOSE:     status register, flags
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
entity flaggroup is
17
    port(   -- clock
18
            clk:     in std_logic;
19
 
20
            -- data inputs
21
            c_in:   in std_logic;
22
            z_in:   in std_logic;
23
 
24
            -- data outputs
25
            c_out:  out std_logic;
26
            z_out:  out std_logic;
27
 
28
            -- control signals
29
            load_c: in std_logic;
30
            load_z: in std_logic;
31
            sel_c:  in std_logic_vector(1 downto 0);
32
            sel_z:  in std_logic_vector(1 downto 0)
33
         );
34
end flaggroup;
35
 
36
architecture rtl of flaggroup is
37
    component flag
38
        port(   clk:        in std_logic;
39
                load:       in std_logic;
40
                data_in:    in std_logic;
41
                data_out:   out std_logic
42
            );
43
    end component;
44
 
45
    component multiplexer4
46
        generic (
47
            w : positive
48
        );
49
        port (
50
            selector:    in std_logic_vector(1 downto 0);
51
            data_in_00:  in std_logic_vector(w-1 downto 0);
52
            data_in_01:  in std_logic_vector(w-1 downto 0);
53
            data_in_10:  in std_logic_vector(w-1 downto 0);
54
            data_in_11:  in std_logic_vector(w-1 downto 0);
55
            data_out:    out std_logic_vector(w-1 downto 0)
56
        );
57
    end component;
58
 
59
    for carry_flag: flag use entity work.flag(rtl);
60
    for zero_flag:  flag use entity work.flag(rtl);
61
 
62
    for carry_mux:  multiplexer4 use entity work.multiplexer4(rtl);
63
    for zero_mux:   multiplexer4 use entity work.multiplexer4(rtl);
64
 
65
    signal mux_to_c:    std_logic;
66
    signal mux_to_z:    std_logic;
67
 
68
    begin
69
        carry_flag: flag port map (
70
            clk => clk,
71
            load => load_c,
72
            data_in => mux_to_c,
73
            data_out => c_out
74
        );
75
 
76
 
77
        zero_flag: flag port map (
78
            clk => clk,
79
            load => load_z,
80
            data_in => mux_to_z,
81
            data_out => z_out
82
        );
83
 
84
        carry_mux: multiplexer4
85
            generic map
86
            (
87
                w => 1
88
            )
89
            port map (
90
                selector => sel_c,
91
                data_in_00(0) => c_in,
92
                data_in_01(0) => '-',
93
                data_in_10(0) => '0',
94
                data_in_11(0) => '1',
95
                data_out(0) => mux_to_c
96
            );
97
 
98
 
99
        zero_mux: multiplexer4
100
            generic map
101
            (
102
                w => 1
103
            )
104
            port map (
105
                selector => sel_z,
106
                data_in_00(0) => z_in,
107
                data_in_01(0) => '-',
108
                data_in_10(0) => '0',
109
                data_in_11(0) => '1',
110
                data_out(0) => mux_to_z
111
            );
112
 
113
end rtl;

powered by: WebSVN 2.1.0

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