1 |
3 |
Andrewski |
--------------------------------------------------------------------------------
|
2 |
|
|
-- Entity: MemoryBlock
|
3 |
|
|
-- Date:2011-11-14
|
4 |
|
|
-- Author: Administrator
|
5 |
|
|
--
|
6 |
|
|
-- Description ${cursor}
|
7 |
|
|
--------------------------------------------------------------------------------
|
8 |
|
|
library ieee;
|
9 |
|
|
use ieee.std_logic_1164.all;
|
10 |
|
|
use ieee.std_logic_unsigned.all;
|
11 |
|
|
|
12 |
|
|
library UNISIM;
|
13 |
|
|
use UNISIM.vcomponents.all;
|
14 |
|
|
|
15 |
|
|
use work.utilPkg.all;
|
16 |
|
|
use work.helperComponents.all;
|
17 |
|
|
|
18 |
|
|
|
19 |
|
|
entity MemoryBlock is
|
20 |
|
|
port (
|
21 |
|
|
reset : in std_logic;
|
22 |
|
|
clk : in std_logic;
|
23 |
|
|
-------------------------------------------------
|
24 |
|
|
p1_addr : in std_logic_vector(10 downto 0);
|
25 |
|
|
p1_data_in : in std_logic_vector(7 downto 0);
|
26 |
|
|
p1_strobe : in std_logic;
|
27 |
|
|
p1_data_out : out std_logic_vector(7 downto 0);
|
28 |
|
|
-------------------------------------------------
|
29 |
|
|
p2_addr : in std_logic_vector(10 downto 0);
|
30 |
|
|
p2_data_in : in std_logic_vector(7 downto 0);
|
31 |
|
|
p2_strobe : in std_logic;
|
32 |
|
|
p2_data_out : out std_logic_vector(7 downto 0)
|
33 |
|
|
);
|
34 |
|
|
end MemoryBlock;
|
35 |
|
|
|
36 |
|
|
architecture arch of MemoryBlock is
|
37 |
|
|
|
38 |
|
|
constant ADDR_WIDTH : integer := 11;
|
39 |
|
|
constant DATA_WIDTH : integer := 8;
|
40 |
|
|
|
41 |
|
|
|
42 |
|
|
signal m_p1_parity_in, m_p1_parity_out : std_logic_vector(0 downto 0);
|
43 |
|
|
signal m_p1_data_in, m_p1_data_out :
|
44 |
|
|
std_logic_vector((DATA_WIDTH-1) downto 0);
|
45 |
|
|
signal m_p1_addr : std_logic_vector((ADDR_WIDTH-1) downto 0);
|
46 |
|
|
signal m_p1_clk, m_p1_en, m_p1_ssr, m_p1_we : std_logic;
|
47 |
|
|
|
48 |
|
|
signal m_p2_parity_in, m_p2_parity_out : std_logic_vector(0 downto 0);
|
49 |
|
|
signal m_p2_data_in, m_p2_data_out :
|
50 |
|
|
std_logic_vector((DATA_WIDTH-1) downto 0);
|
51 |
|
|
signal m_p2_addr : std_logic_vector((ADDR_WIDTH-1) downto 0);
|
52 |
|
|
signal m_p2_clk, m_p2_en, m_p2_ssr, m_p2_we : std_logic;
|
53 |
|
|
|
54 |
|
|
begin
|
55 |
|
|
|
56 |
|
|
m_p1_en <= '1';
|
57 |
|
|
m_p2_en <= '1';
|
58 |
|
|
|
59 |
|
|
m_p1_ssr <= reset;
|
60 |
|
|
m_p2_ssr <= reset;
|
61 |
|
|
|
62 |
|
|
m_p1_addr <= p1_addr;
|
63 |
|
|
m_p2_addr <= p2_addr;
|
64 |
|
|
|
65 |
|
|
p1_data_out <= m_p1_data_out;
|
66 |
|
|
p2_data_out <= m_p2_data_out;
|
67 |
|
|
|
68 |
|
|
m_p1_data_in <= p1_data_in;
|
69 |
|
|
m_p2_data_in <= p2_data_in;
|
70 |
|
|
|
71 |
|
|
m_p1_clk <= clk;
|
72 |
|
|
m_p2_clk <= clk;
|
73 |
|
|
|
74 |
|
|
m_p1_we <= p1_strobe;
|
75 |
|
|
m_p2_we <= p2_strobe;
|
76 |
|
|
|
77 |
|
|
-- RAMB16_S9_S9: Virtex-II/II-Pro, Spartan-3/3E 2k x 8 + 1 Parity bit Dual-Port RAM
|
78 |
|
|
-- Xilinx HDL Language Template, version 9.1i
|
79 |
|
|
|
80 |
|
|
RAMB16_S9_S9_inst : RAMB16_S9_S9
|
81 |
|
|
generic map (
|
82 |
|
|
INIT_A => X"000", -- Value of output RAM registers on Port A at startup
|
83 |
|
|
INIT_B => X"000", -- Value of output RAM registers on Port B at startup
|
84 |
|
|
SRVAL_A => X"000", -- Port A ouput value upon SSR assertion
|
85 |
|
|
SRVAL_B => X"000", -- Port B ouput value upon SSR assertion
|
86 |
|
|
WRITE_MODE_A => "WRITE_FIRST", -- WRITE_FIRST, READ_FIRST or NO_CHANGE
|
87 |
|
|
WRITE_MODE_B => "WRITE_FIRST", -- WRITE_FIRST, READ_FIRST or NO_CHANGE
|
88 |
|
|
SIM_COLLISION_CHECK => "ALL", -- "NONE", "WARNING", "GENERATE_X_ONLY", "ALL"
|
89 |
|
|
-- The following INIT_xx declarations specify the initial contents of the RAM
|
90 |
|
|
-- Address 0 to 511
|
91 |
|
|
INIT_00 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
92 |
|
|
INIT_01 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
93 |
|
|
INIT_02 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
94 |
|
|
INIT_03 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
95 |
|
|
INIT_04 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
96 |
|
|
INIT_05 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
97 |
|
|
INIT_06 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
98 |
|
|
INIT_07 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
99 |
|
|
INIT_08 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
100 |
|
|
INIT_09 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
101 |
|
|
INIT_0A => X"0000000000000000000000000000000000000000000000000000000000000000",
|
102 |
|
|
INIT_0B => X"0000000000000000000000000000000000000000000000000000000000000000",
|
103 |
|
|
INIT_0C => X"0000000000000000000000000000000000000000000000000000000000000000",
|
104 |
|
|
INIT_0D => X"0000000000000000000000000000000000000000000000000000000000000000",
|
105 |
|
|
INIT_0E => X"0000000000000000000000000000000000000000000000000000000000000000",
|
106 |
|
|
INIT_0F => X"0000000000000000000000000000000000000000000000000000000000000000",
|
107 |
|
|
-- Address 512 to 1023
|
108 |
|
|
INIT_10 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
109 |
|
|
INIT_11 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
110 |
|
|
INIT_12 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
111 |
|
|
INIT_13 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
112 |
|
|
INIT_14 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
113 |
|
|
INIT_15 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
114 |
|
|
INIT_16 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
115 |
|
|
INIT_17 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
116 |
|
|
INIT_18 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
117 |
|
|
INIT_19 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
118 |
|
|
INIT_1A => X"0000000000000000000000000000000000000000000000000000000000000000",
|
119 |
|
|
INIT_1B => X"0000000000000000000000000000000000000000000000000000000000000000",
|
120 |
|
|
INIT_1C => X"0000000000000000000000000000000000000000000000000000000000000000",
|
121 |
|
|
INIT_1D => X"0000000000000000000000000000000000000000000000000000000000000000",
|
122 |
|
|
INIT_1E => X"0000000000000000000000000000000000000000000000000000000000000000",
|
123 |
|
|
INIT_1F => X"0000000000000000000000000000000000000000000000000000000000000000",
|
124 |
|
|
-- Address 1024 to 1535
|
125 |
|
|
INIT_20 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
126 |
|
|
INIT_21 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
127 |
|
|
INIT_22 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
128 |
|
|
INIT_23 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
129 |
|
|
INIT_24 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
130 |
|
|
INIT_25 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
131 |
|
|
INIT_26 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
132 |
|
|
INIT_27 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
133 |
|
|
INIT_28 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
134 |
|
|
INIT_29 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
135 |
|
|
INIT_2A => X"0000000000000000000000000000000000000000000000000000000000000000",
|
136 |
|
|
INIT_2B => X"0000000000000000000000000000000000000000000000000000000000000000",
|
137 |
|
|
INIT_2C => X"0000000000000000000000000000000000000000000000000000000000000000",
|
138 |
|
|
INIT_2D => X"0000000000000000000000000000000000000000000000000000000000000000",
|
139 |
|
|
INIT_2E => X"0000000000000000000000000000000000000000000000000000000000000000",
|
140 |
|
|
INIT_2F => X"0000000000000000000000000000000000000000000000000000000000000000",
|
141 |
|
|
-- Address 1536 to 2047
|
142 |
|
|
INIT_30 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
143 |
|
|
INIT_31 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
144 |
|
|
INIT_32 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
145 |
|
|
INIT_33 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
146 |
|
|
INIT_34 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
147 |
|
|
INIT_35 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
148 |
|
|
INIT_36 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
149 |
|
|
INIT_37 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
150 |
|
|
INIT_38 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
151 |
|
|
INIT_39 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
152 |
|
|
INIT_3A => X"0000000000000000000000000000000000000000000000000000000000000000",
|
153 |
|
|
INIT_3B => X"0000000000000000000000000000000000000000000000000000000000000000",
|
154 |
|
|
INIT_3C => X"0000000000000000000000000000000000000000000000000000000000000000",
|
155 |
|
|
INIT_3D => X"0000000000000000000000000000000000000000000000000000000000000000",
|
156 |
|
|
INIT_3E => X"0000000000000000000000000000000000000000000000000000000000000000",
|
157 |
|
|
INIT_3F => X"0000000000000000000000000000000000000000000000000000000000000000",
|
158 |
|
|
-- The next set of INITP_xx are for the parity bits
|
159 |
|
|
-- Address 0 to 511
|
160 |
|
|
INITP_00 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
161 |
|
|
INITP_01 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
162 |
|
|
-- Address 512 to 1023
|
163 |
|
|
INITP_02 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
164 |
|
|
INITP_03 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
165 |
|
|
-- Address 1024 to 1535
|
166 |
|
|
INITP_04 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
167 |
|
|
INITP_05 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
168 |
|
|
-- Address 1536 to 2047
|
169 |
|
|
INITP_06 => X"0000000000000000000000000000000000000000000000000000000000000000",
|
170 |
|
|
INITP_07 => X"0000000000000000000000000000000000000000000000000000000000000000")
|
171 |
|
|
port map (
|
172 |
|
|
DOA => m_p1_data_out, -- Port A 8-bit Data Output
|
173 |
|
|
DOB => m_p2_data_out, -- Port B 8-bit Data Output
|
174 |
|
|
DOPA => m_p1_parity_out, -- Port A 1-bit Parity Output
|
175 |
|
|
DOPB => m_p2_parity_out, -- Port B 1-bit Parity Output
|
176 |
|
|
ADDRA => m_p1_addr, -- Port A 11-bit Address Input
|
177 |
|
|
ADDRB => m_p2_addr, -- Port B 11-bit Address Input
|
178 |
|
|
CLKA => m_p1_clk, -- Port A Clock
|
179 |
|
|
CLKB => m_p2_clk, -- Port B Clock
|
180 |
|
|
DIA => m_p1_data_in, -- Port A 8-bit Data Input
|
181 |
|
|
DIB => m_p2_data_in, -- Port B 8-bit Data Input
|
182 |
|
|
DIPA => m_p1_parity_in, -- Port A 1-bit parity Input
|
183 |
|
|
DIPB => m_p2_parity_in, -- Port-B 1-bit parity Input
|
184 |
|
|
ENA => m_p1_en, -- Port A RAM Enable Input
|
185 |
|
|
ENB => m_p2_en, -- PortB RAM Enable Input
|
186 |
|
|
SSRA => m_p1_ssr, -- Port A Synchronous Set/Reset Input
|
187 |
|
|
SSRB => m_p2_ssr, -- Port B Synchronous Set/Reset Input
|
188 |
|
|
WEA => m_p1_we, -- Port A Write Enable Input
|
189 |
|
|
WEB => m_p2_we -- Port B Write Enable Input
|
190 |
|
|
);
|
191 |
|
|
|
192 |
|
|
end arch;
|
193 |
|
|
|