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

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [rtl/] [techmap/] [mem/] [ram32x2_tech.vhd] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 sergeykhbr
-----------------------------------------------------------------------------
2
--! @file
3
--! @copyright Copyright 2015 GNSS Sensor Ltd. All right reserved.
4
--! @author    Sergey Khabarov - sergeykhbr@gmail.com
5
--! @brief     Technology specific RAM selector
6
------------------------------------------------------------------------------
7
 
8
library ieee;
9
use ieee.std_logic_1164.all;
10
library commonlib;
11
use commonlib.types_common.all;
12
library techmap;
13
use techmap.gencomp.all;
14
use techmap.types_mem.all;
15
 
16
entity Ram32x2_tech is
17
generic (
18
    generic_tech   : integer := 0;
19
    generic_kWords : integer := 1
20
);
21
port (
22
    i_clk       : in std_logic;
23
    i_address   : in std_logic_vector(10+log2(generic_kWords)-1 downto 0);
24
    i_wr_ena    : in std_logic_vector(1 downto 0);
25
    i_data      : in std_logic_vector(63 downto 0);
26
    o_data      : out std_logic_vector(63 downto 0)
27
);
28
end;
29
 
30
architecture rtl of Ram32x2_tech is
31
 
32
  component Ram32_inferred
33
  generic (
34
    generic_abits    : integer := 10
35
  );
36
  port (
37
    i_clk         : in std_logic;
38
    i_address     : in std_logic_vector(generic_abits-1 downto 0);
39
    i_wr_ena      : in std_logic;
40
    i_data       : in std_logic_vector(31 downto 0);
41
    o_data       : out std_logic_vector(31 downto 0)
42
  );
43
  end component;
44
 
45
begin
46
 
47
  genmem0 : if generic_tech = inferred or is_fpga(generic_tech) /= 0 generate
48
      ramx0 : Ram32_inferred generic map
49
      (
50
        generic_abits => 10+log2(generic_kWords)
51
      ) port map
52
      (
53
        i_clk,
54
        i_address,
55
        i_wr_ena(0),
56
        i_data(31 downto 0),
57
        o_data(31 downto 0)
58
      );
59
 
60
      ramx1 : Ram32_inferred generic map
61
      (
62
        generic_abits => 10+log2(generic_kWords)
63
      ) port map
64
      (
65
        i_clk,
66
        i_address,
67
        i_wr_ena(1),
68
        i_data(63 downto 32),
69
        o_data(63 downto 32)
70
      );
71
  end generate;
72
 
73
end;
74
 
75
 

powered by: WebSVN 2.1.0

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