AMC13
Firmwares for the different applications of the AMC13 uTCA board made at Boston University
 All Classes Variables
RAM32x8.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 RAM32x8 is
33  Port ( wclk : in STD_LOGIC;
34  di : in STD_LOGIC_VECTOR (7 downto 0);
35  we : in STD_LOGIC;
36  wa : in STD_LOGIC_VECTOR (4 downto 0);
37  ra : in STD_LOGIC_VECTOR (4 downto 0);
38  do : out STD_LOGIC_VECTOR (7 downto 0));
39 end RAM32x8;
40 
41 architecture Behavioral of RAM32x8 is
42 
43 begin
44 RAM32M_inst : RAM32M
45  generic map (
46  INIT_A => X"0000000000000000", -- Initial contents of A port
47  INIT_B => X"0000000000000000", -- Initial contents of B port
48  INIT_C => X"0000000000000000", -- Initial contents of C port
49  INIT_D => X"0000000000000000") -- Initial contents of D port
50  port map (
51  DOA => do(1 downto 0), -- Read port A 2-bit output
52  DOB => do(3 downto 2), -- Read port B 2-bit output
53  DOC => do(5 downto 4), -- Read port C 2-bit output
54  DOD => open, -- Read/Write port D 2-bit output
55  ADDRA => ra, -- Read port A 5-bit address input
56  ADDRB => ra, -- Read port B 5-bit address input
57  ADDRC => ra, -- Read port C 5-bit address input
58  ADDRD => wa, -- Read/Write port D 5-bit address input
59  DIA => di(1 downto 0), -- RAM 2-bit data write input addressed by ADDRD,
60  -- read addressed by ADDRA
61  DIB => di(3 downto 2), -- RAM 2-bit data write input addressed by ADDRD,
62  -- read addressed by ADDRB
63  DIC => di(5 downto 4), -- RAM 2-bit data write input addressed by ADDRD,
64  -- read addressed by ADDRC
65  DID => "00", -- RAM 2-bit data write input addressed by ADDRD,
66  -- read addressed by ADDRD
67  WCLK => wclk, -- Write clock input
68  WE => we -- Write enable input
69  );
70 g_ram: for i in 6 to 7 generate
71  RAM32X1D_inst : RAM32X1D
72  generic map (
73  INIT => X"00000000") -- Initial contents of RAM
74  port map (
75  DPO => do(i), -- Read-only 1-bit data output
76  SPO => open, -- R/W 1-bit data output
77  A0 => wa(0), -- R/W address[0] input bit
78  A1 => wa(1), -- R/W address[1] input bit
79  A2 => wa(2), -- R/W address[2] input bit
80  A3 => wa(3), -- R/W address[3] input bit
81  A4 => wa(4), -- R/W address[4] input bit
82  D => di(i), -- Write 1-bit data input
83  DPRA0 => ra(0), -- Read-only address[0] input bit
84  DPRA1 => ra(1), -- Read-only address[1] input bit
85  DPRA2 => ra(2), -- Read-only address[2] input bit
86  DPRA3 => ra(3), -- Read-only address[3] input bit
87  DPRA4 => ra(4), -- Read-only address[4] input bit
88  WCLK => wclk, -- Write clock input
89  WE => we -- Write enable input
90  );
91 end generate;
92 
93 end Behavioral;
94