AMC13
Firmwares for the different applications of the AMC13 uTCA board made at Boston University
 All Classes Variables
RAM32x6D.vhd
1 ----------------------------------------------------------------------------------
2 -- Company:
3 -- Engineer:
4 --
5 -- Create Date: 09:46:13 11/18/2013
6 -- Design Name:
7 -- Module Name: RAM32x6D - Behavioral
8 -- Project Name:
9 -- Target Devices:
10 -- Tool versions:
11 -- Description:
12 --
13 -- Dependencies:
14 --
15 -- Revision:
16 -- Revision 0.01 - File Created
17 -- Additional Comments:
18 --
19 ----------------------------------------------------------------------------------
20 library IEEE;
21 use IEEE.STD_LOGIC_1164.ALL;
22 
23 -- Uncomment the following library declaration if using
24 -- arithmetic functions with Signed or Unsigned values
25 --use IEEE.NUMERIC_STD.ALL;
26 
27 -- Uncomment the following library declaration if instantiating
28 -- any Xilinx primitives in this code.
29 library UNISIM;
30 use UNISIM.VComponents.all;
31 
32 entity RAM32x6D is
33  Port ( wclk : in STD_LOGIC;
34  rclk : in STD_LOGIC;
35  di : in STD_LOGIC_VECTOR (5 downto 0);
36  we : in STD_LOGIC;
37  wa : in STD_LOGIC_VECTOR (4 downto 0);
38  ra : in STD_LOGIC_VECTOR (4 downto 0);
39  ceReg : in STD_LOGIC;
40  do : out STD_LOGIC_VECTOR (5 downto 0));
41 end RAM32x6D;
42 
43 architecture Behavioral of RAM32x6D is
44 signal ram_do : std_logic_vector(5 downto 0) := (others => '0');
45 
46 begin
47 process(rclk)
48 begin
49  if(rclk'event and rclk = '1')then
50  if(ceReg = '1')then
51  do <= ram_do;
52  end if;
53  end if;
54 end process;
55 RAM32M_inst : RAM32M
56  generic map (
57  INIT_A => X"0000000000000000", -- Initial contents of A port
58  INIT_B => X"0000000000000000", -- Initial contents of B port
59  INIT_C => X"0000000000000000", -- Initial contents of C port
60  INIT_D => X"0000000000000000") -- Initial contents of D port
61  port map (
62  DOA => ram_do(1 downto 0), -- Read port A 2-bit output
63  DOB => ram_do (3 downto 2), -- Read port B 2-bit output
64  DOC => ram_do(5 downto 4), -- Read port C 2-bit output
65  DOD => open, -- Read/Write port D 2-bit output
66  ADDRA => ra, -- Read port A 5-bit address input
67  ADDRB => ra, -- Read port B 5-bit address input
68  ADDRC => ra, -- Read port C 5-bit address input
69  ADDRD => wa, -- Read/Write port D 5-bit address input
70  DIA => di(1 downto 0), -- RAM 2-bit data write input addressed by ADDRD,
71  -- read addressed by ADDRA
72  DIB => di(3 downto 2), -- RAM 2-bit data write input addressed by ADDRD,
73  -- read addressed by ADDRB
74  DIC => di(5 downto 4), -- RAM 2-bit data write input addressed by ADDRD,
75  -- read addressed by ADDRC
76  DID => "00", -- RAM 2-bit data write input addressed by ADDRD,
77  -- read addressed by ADDRD
78  WCLK => wclk, -- Write clock input
79  WE => we -- Write enable input
80  );
81 
82 
83 end Behavioral;
84