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

Subversion Repositories mcip_open

[/] [mcip_open/] [trunk/] [MCIPopen_XilinxISEproject/] [Stack_Ram.vhd] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 mezzah
--------------------------------------------------------------------------------
2
-- Company:        Ferhat Abbas University - Algeria
3
-- Engineer:       Ibrahim MEZZAH
4
-- Progect Supervisor: Dr H. Chemali
5
-- Create Date:    02:42:20 06/06/05
6
-- Design Name:    32 levels Stack
7
-- Module Name:    Stack_ram - Behavioral
8
-- Project Name:   Microcontroller IP (MCIP)
9
-- Target Device:  xc3s500e-4fg320
10
-- Tool versions:  Xilinx ISE 9.1.03i
11
-- Description:  This is a 32x21-bits Stack Ram.
12
-- Revision:             07/06/2008
13
-- Revision 1 - Add description
14
--------------------------------------------------------------------------------
15
library IEEE;
16
use IEEE.STD_LOGIC_1164.ALL;
17
use IEEE.STD_LOGIC_UNSIGNED.ALL;
18
use IEEE.NUMERIC_STD.all;
19
 
20
entity Stack_ram is
21
    Generic ( STKPTR_length : integer := 5 );
22
         Port ( Q            : in std_logic;
23
                          write_enable : in std_logic;
24
                          STKPTR       : in std_logic_vector(STKPTR_length-1 downto 0);
25
           Data_write   : in std_logic_vector(20 downto 1);
26
           Data_read    : out std_logic_vector(20 downto 1));
27
end Stack_ram;
28
 
29
architecture Behavioral of Stack_ram is
30
 
31
        constant Stack_stage : integer := 2**(STKPTR_length);
32
 
33
        type stack_ram is array (0 to Stack_stage-1) of std_logic_vector (20 downto 1);
34
        signal STACKram : stack_ram;
35
 
36
begin
37
 
38
 write_p : process(Q, write_enable)
39
  begin
40
        if Q'event and Q ='1' then
41
          if write_enable = '1' then
42
                 STACKram( CONV_INTEGER(STKPTR) ) <= Data_write;
43
          end if;
44
        end if;
45
  end process;
46
 
47
          Data_read <= STACKram( CONV_INTEGER(STKPTR) );
48
 
49
end Behavioral;

powered by: WebSVN 2.1.0

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