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

Subversion Repositories t65

[/] [t65/] [trunk/] [rtl/] [vhdl/] [SSRAM.vhd] - Diff between revs 2 and 4

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 2 Rev 4
Line 43... Line 43...
-- Limitations :
-- Limitations :
--
--
-- File history :
-- File history :
--      0208 : Initial release
--      0208 : Initial release
--      0218 : Fixed data out at write
--      0218 : Fixed data out at write
 
--      0220 : Added support for XST
 
 
library IEEE;
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
use IEEE.numeric_std.all;
 
 
entity SSRAM is
entity SSRAM is
        generic(
        generic(
                AddrWidth       : integer := 16;
                AddrWidth       : integer := 11;
                DataWidth       : integer := 8
                DataWidth       : integer := 8
        );
        );
        port(
        port(
                Clk                     : in std_logic;
                Clk                     : in std_logic;
                CE_n            : in std_logic;
                CE_n            : in std_logic;
Line 68... Line 69...
architecture behaviour of SSRAM is
architecture behaviour of SSRAM is
 
 
        type Memory_Image is array (natural range <>) of std_logic_vector(DataWidth - 1 downto 0);
        type Memory_Image is array (natural range <>) of std_logic_vector(DataWidth - 1 downto 0);
        signal  RAM             : Memory_Image(0 to 2 ** AddrWidth - 1);
        signal  RAM             : Memory_Image(0 to 2 ** AddrWidth - 1);
        signal  A_r             : std_logic_vector(AddrWidth - 1 downto 0);
        signal  A_r             : std_logic_vector(AddrWidth - 1 downto 0);
 
        signal  B               : std_logic_vector(AddrWidth - 1 downto 0);
 
 
begin
begin
 
 
        process (Clk)
        process (Clk)
        begin
        begin
                if Clk'event and Clk = '1' then
                if Clk'event and Clk = '1' then
-- pragma translate_off
                        if (CE_n nor WE_n) = '1' then
                        if not is_x(A) then
                                RAM(to_integer(unsigned(B))) <= DIn;
-- pragma translate_on
 
                                DOut <= RAM(to_integer(unsigned(A(AddrWidth - 1 downto 0))));
 
-- pragma translate_off
 
                        end if;
 
-- pragma translate_on
 
                        if CE_n = '0' and WE_n = '0' then
 
                                RAM(to_integer(unsigned(A_r))) <= DIn;
 
                                if A_r = A then
 
                                        DOut <= DIn;
 
                                end if;
 
                        end if;
                        end if;
                        A_r <= A;
                        A_r <= A;
 
                        B <= A;
                end if;
                end if;
        end process;
        end process;
 
 
 
        DOut <= RAM(to_integer(unsigned(A_r)))
 
-- pragma translate_off
 
                        when not is_x(A_r) else (others => '-')
 
-- pragma translate_on
 
        ;
end;
end;
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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