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

Subversion Repositories copyblaze

[/] [copyblaze/] [trunk/] [copyblaze/] [rtl/] [vhdl/] [cpu/] [cp_Flags.vhd] - Blame information for rev 57

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ameziti
--------------------------------------------------------------------------------
2
-- Company: 
3
--
4
-- File: cp_Flags.vhd
5
--
6
-- Description:
7
--      projet copyblaze
8
--      Flags ZERO & CARRY management
9
--
10
-- File history:
11
-- v1.0: 10/10/11: Creation
12
--
13
-- Targeted device: ProAsic A3P250 VQFP100
14
-- Author: AbdAllah Meziti
15
--------------------------------------------------------------------------------
16
 
17
library ieee;
18
use ieee.std_logic_1164.all;
19
use ieee.numeric_std.all;
20
 
21
use     work.Usefull_Pkg.all;           -- Usefull Package
22
 
23
--------------------------------------------------------------------------------
24
-- Entity: cp_Flags
25
--
26
-- Description:
27
--      
28
--      REMARQUE:
29
--
30
--      
31
-- History:
32
-- 10/10/11 AM: Creation
33
-- ---------------------
34
-- xx/xx/xx AM: 
35
--                              
36
--------------------------------------------------------------------------------
37
entity cp_Flags is
38
        port (
39
        --------------------------------------------------------------------------------
40
        -- Signaux Systeme
41
        --------------------------------------------------------------------------------
42
                Clk_i                           : in std_ulogic;        --      signal d'horloge générale
43
                Rst_i_n                         : in std_ulogic;        --      signal de reset générale
44
 
45
        --------------------------------------------------------------------------------
46
        -- Signaux Fonctionels
47
        --------------------------------------------------------------------------------
48
                Z_i                                     : in std_ulogic;
49
                C_i                                     : in std_ulogic;
50
 
51
                Z_o                                     : out std_ulogic;
52
                C_o                                     : out std_ulogic;
53
 
54
                Push_i                          : in std_ulogic;
55
                Pop_i                           : in std_ulogic;
56
 
57
                Write_i                         : in std_ulogic
58
        );
59
end cp_Flags;
60
 
61
--------------------------------------------------------------------------------
62
-- Architecture: RTL
63
-- of entity : cp_Flags
64
--------------------------------------------------------------------------------
65
architecture rtl of cp_Flags is
66
 
67
        --------------------------------------------------------------------------------
68
        -- Définition des fonctions
69
        --------------------------------------------------------------------------------
70
 
71
 
72
 
73
        --------------------------------------------------------------------------------
74
        -- Définition des constantes
75
        --------------------------------------------------------------------------------
76
 
77
        --------------------------------------------------------------------------------
78
        -- Définition des signaux interne
79
        --------------------------------------------------------------------------------
80
        signal          iZ              : std_ulogic;   -- flag
81
        signal          iC              : std_ulogic;   -- flag
82
 
83
        signal          iZs             : std_ulogic;   -- Shadow flag
84
        signal          iCs             : std_ulogic;   -- Shadow flag
85
 
86
        --------------------------------------------------------------------------------
87
        -- Déclaration des composants
88
        --------------------------------------------------------------------------------
89
 
90
begin
91
 
92
        --------------------------------------------------------------------------------
93
        -- Process : Flags_Proc
94
        -- Description: Flags Management
95
        --------------------------------------------------------------------------------
96
        Flags_Proc : process(Rst_i_n, Clk_i)
97
        begin
98
                if ( Rst_i_n = '0' ) then
99
                        iZ      <=      '0';
100
                        iC      <=      '0';
101
 
102
                elsif ( rising_edge(Clk_i) ) then
103
                        if ( Write_i = '1' ) then
104
                                iZ      <=      Z_i;
105
                                iC      <=      C_i;
106
                        elsif ( Pop_i = '1' ) then
107
                                iZ      <=      iZs;
108
                                iC      <=      iCs;
109
                        end if;
110
                end if;
111
        end process Flags_Proc;
112
 
113
        --------------------------------------------------------------------------------
114
        -- Process : ShadowFlags_Proc
115
        -- Description: Shadow Flags Management
116
        --------------------------------------------------------------------------------
117
        ShadowFlags_Proc : process(Rst_i_n, Clk_i)
118
        begin
119
                if ( Rst_i_n = '0' ) then
120
                        iZs     <=      '0';
121
                        iCs     <=      '0';
122
 
123
                elsif ( rising_edge(Clk_i) ) then
124
                        if ( Push_i = '1' ) then
125
                                iZs     <=      iZ;
126
                                iCs     <=      iC;
127
                        end if;
128
                end if;
129
        end process ShadowFlags_Proc;
130
 
131
        Z_o             <=      iZ;
132
        C_o             <=      iC;
133
 
134
end rtl;
135
 

powered by: WebSVN 2.1.0

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