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

Subversion Repositories copyblaze

[/] [copyblaze/] [trunk/] [copyblaze/] [rtl/] [vhdl/] [cpu/] [cp_BancRegister.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_BancRegister.vhd
5
--
6
-- Description:
7
--      projet copyblaze
8
--      Banc Registers 
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_BancRegister
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_BancRegister is
38
        generic
39
        (
40
                GEN_WIDTH_DATA          : positive := 8;
41
                GEN_DEPTH_BANC          : positive := 16
42
        );
43
        port (
44
        --------------------------------------------------------------------------------
45
        -- Signaux Systeme
46
        --------------------------------------------------------------------------------
47
                Clk_i                           : in std_ulogic;        --      signal d'horloge générale
48
                Rst_i_n                         : in std_ulogic;        --      signal de reset générale
49
 
50
        --------------------------------------------------------------------------------
51
        -- Signaux Fonctionels
52
        --------------------------------------------------------------------------------
53
                SxPtr_i                         : in std_ulogic_vector(log2(GEN_DEPTH_BANC)-1 downto 0);
54
                SyPtr_i                         : in std_ulogic_vector(log2(GEN_DEPTH_BANC)-1 downto 0);
55
 
56
                Write_i                         : in std_ulogic;
57
                SxData_i                        : in std_ulogic_vector(GEN_WIDTH_DATA-1 downto 0);       -- 
58
 
59
                SxData_o                        : out std_ulogic_vector(GEN_WIDTH_DATA-1 downto 0);      -- 
60
                SyData_o                        : out std_ulogic_vector(GEN_WIDTH_DATA-1 downto 0)
61
        );
62
end cp_BancRegister;
63
 
64
--------------------------------------------------------------------------------
65
-- Architecture: RTL
66
-- of entity : cp_BancRegister
67
--------------------------------------------------------------------------------
68
architecture rtl of cp_BancRegister is
69
 
70
        --------------------------------------------------------------------------------
71
        -- Définition des fonctions
72
        --------------------------------------------------------------------------------
73
 
74
 
75
 
76
        --------------------------------------------------------------------------------
77
        -- Définition des constantes
78
        --------------------------------------------------------------------------------
79
 
80
        --------------------------------------------------------------------------------
81
        -- Machine d'état principale de pilotage du driver de l'igbt
82
        --------------------------------------------------------------------------------
83
 
84
        --------------------------------------------------------------------------------
85
        -- Définition des signaux interne
86
        --------------------------------------------------------------------------------
87
        type RAM_TYPE is array (0 to GEN_DEPTH_BANC-1) of std_ulogic_vector(GEN_WIDTH_DATA-1 downto 0);
88
 
89
        signal iBancRegMem      : RAM_TYPE;
90
        --------------------------------------------------------------------------------
91
        -- Déclaration des composants
92
        --------------------------------------------------------------------------------
93
 
94
begin
95
 
96
        --------------------------------------------------------------------------------
97
        -- Process : BancReg_Proc
98
        -- Description: BancRegister Memory
99
        --------------------------------------------------------------------------------
100
        BancReg_Proc : process(Rst_i_n, Clk_i)
101
        begin
102
                if ( Rst_i_n = '0' ) then
103
                        for i in 0 to GEN_DEPTH_BANC-1 loop
104
                                iBancRegMem(i)  <= (others=>'0');
105
                        end loop;
106
 
107
                elsif ( rising_edge(Clk_i) ) then
108
                        if ( Write_i = '1' ) then
109
                                iBancRegMem( to_integer(unsigned(SxPtr_i)) )    <= SxData_i;
110
                        end if;
111
                end if;
112
        end process BancReg_Proc;
113
 
114
        SxData_o        <=      iBancRegMem( to_integer(unsigned(SxPtr_i)) );
115
        SyData_o        <=      iBancRegMem( to_integer(unsigned(SyPtr_i)) );
116
 
117
end rtl;
118
 

powered by: WebSVN 2.1.0

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