Professional Documents
Culture Documents
CV-52002-2.0
Memory Types
The Cyclone V devices contain two types of memory blocks:
■ M10K blocks—10-kilobit (Kb) blocks of dedicated memory resources that you can
use to create designs with large memory configurations.
■ Memory logic array blocks (MLABs)—640-bit enhanced memory blocks that are
configured from dual-purpose logic array blocks (LABs). The MLABs are
optimized for implementation of shift registers for digital signal processing (DSP)
applications, wide shallow FIFO buffers, and filter delay lines. Each MLAB is
made up of ten adaptive logic modules (ALMs) that you can configure as ten
32 x 2 blocks, giving you one 32 x 20 simple dual-port SRAM block per MLAB.
f For information about the embedded memory capacity available in each Cyclone V
device, refer to the Cyclone V Device Overview.
© 2012 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, HARDCOPY, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos
are trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance of its ISO
semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any products and 9001:2008
services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, product, or service Registered
described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device specifications before relying
on any published information and before placing orders for products or services.
Feedback Subscribe
2–2 Chapter 2: Memory Blocks in Cyclone V Devices
Memory Features
Memory Features
Table 2–1 summarizes the features supported by the memory blocks.
Memory Modes
Table 2–2 lists and describes the memory modes that are supported in the Cyclone V
memory blocks.
c To avoid corrupting the memory contents, do not violate the setup or hold time on
any of the memory block input registers during read or write operations. This is
applicable if you use the memory blocks in single-port RAM, simple dual-port RAM,
true dual-port RAM, or ROM mode.
f For more information about each memory mode, refer to the Internal Memory (RAM
and ROM) User Guide.
f For more information about implementing the shift register mode, refer to the
RAM-Based Shift Register (ALTSHIFT_TAPS) Megafunction User Guide.
f For more information about implementing FIFO buffers, refer to the SCFIFO and
DCFIFO Megafunctions User Guide.
f For more information about dual-port mixed width support, refer to the Internal
Memory (RAM and ROM) User Guide.
Table 2–3. M10K Block Mixed-Width Configurations (Simple Dual-Port RAM Mode)
Write Port
512 x 16
512 x 20
256 x 32
256 x 40
1K x 10
Read Port
8K x 1
4K x 2
2K x 4
2K x 5
1K x 8
8K x 1 Yes Yes Yes — Yes — Yes — Yes —
4K x 2 Yes Yes Yes — Yes — Yes — Yes —
2K x 4 Yes Yes Yes — Yes — Yes — Yes —
2K x 5 — — — Yes — Yes — Yes — Yes
1K x 8 Yes Yes Yes — Yes — Yes — Yes —
1K x 10 — — — Yes — Yes — Yes — Yes
512 x 16 Yes Yes Yes — Yes — Yes — Yes —
512 x 20 — — — Yes — Yes — Yes — Yes
256 x 32 Yes Yes Yes — Yes — Yes — Yes —
256 x 40 — — — Yes — Yes — Yes — Yes
Table 2–4 lists the mixed-width configurations of the M10K blocks in true dual-port
mode.
Table 2–4. M10K Block Mixed-Width Configurations (True Dual-Port Mode) (Part 1 of 2)
Port A
512 x 16
512 x 20
1K x 10
Port B
8K x 1
4K x 2
2K x 4
2K x 5
1K x 8
Table 2–4. M10K Block Mixed-Width Configurations (True Dual-Port Mode) (Part 2 of 2)
Port A
512 x 16
512 x 20
1K x 10
Port B
8K x 1
4K x 2
2K x 4
2K x 5
1K x 8
512 x 16 Yes Yes Yes — Yes — Yes —
512 x 20 — — — Yes — Yes — Yes
Clocking Modes
This section describes the clocking modes for the Cyclone V memory blocks.
c To avoid corrupting the memory contents, do not violate the setup or hold time on the
memory block address registers during read or write operations.
Table 2–5. Memory Blocks Clocking Modes for Each Memory Mode
Memory Mode
Clocking Mode Simple True
Single-Port ROM FIFO
Dual-Port Dual-Port
Single clock mode Yes Yes Yes Yes Yes
Read/write clock mode — Yes — — Yes
Input/output clock mode Yes Yes Yes Yes —
Independent clock mode — — Yes Yes —
f For more information about each clocking mode, refer to the Internal Memory (RAM
and ROM) User Guide.
Asynchronous Clears
In all clocking modes, asynchronous clears are available only for output latches and
output registers. For the independent clock mode, this is applicable on both ports.
Parity Bit
Table 2–6 describes the parity bit support for the memory blocks.
Byte Enable
The memory blocks support byte enable controls:
■ The byte enable controls mask the input data so that only specific bytes of data are
written. The unwritten bytes retain the values written previously.
■ The write enable (wren) signal, together with the byte enable (byteena) signal,
control the write operations on the RAM blocks. By default, the byteena signal is
high (enabled) and only the wren signal controls the writing.
■ The byte enable registers do not have a clear port.
■ If you are using parity bits, on the M10K blocks, the byte enable function controls
8 data bits and 2 parity bits; on the MLABs, the byte enable function controls all 10
bits in the widest mode.
■ The MSB and LSB of the byteena signal correspond to the MSB and LSB of the data
bus, respectively.
■ The byte enables are active high.
byteena Controls
Table 2–7 lists the byteena controls in the x20 data widths.
10 [19:10] —
01 — [9:0]
Table 2–8 lists the byteena controls in the x40 data widths.
inclock
wren
address an a0 a1 a2 a3 a4 a0
don’t care: q (asynch) doutn ABXXXXXX XXCDXXXX XXXXEFXX XXXXXX12 ABCDEF12 ABFFFFFF
current data: q (asynch) doutn ABFFFFFF FFCDFFFF FFFFEFFF FFFFFF12 ABCDEF12 ABFFFFFF
Design Considerations
To ensure the success of your designs using the memory blocks in Cyclone V devices,
take into consideration the following guidelines when you are designing with the
memory blocks.
Because of the dual-purpose architecture of the MLAB, only data input registers and
output registers are available in the block. The MLABs gain read address registers
from the ALMs. However, the write address and read data registers are internal to the
MLABs.
Conflict Resolution
In the true dual-port RAM mode, you can perform two write operations to the same
memory location. However, the memory blocks do not have internal conflict
resolution circuitry. To avoid unknown data being written to the address, implement
external conflict resolution logic to the memory block.
Read-During-Write Behavior
Customize the read-during-write behavior of the memory blocks to suit your design
requirements.
Figure 2–2 shows the difference between the two types of read-during-write
operations available—same port and mixed port.
FPGA Device
Port A Port B
data in data in
Mixed-port
data flow
Same-port
data flow
Port A Port B
data out data out
Table 2–9. Output Modes for M10K or MLAB in Same-Port Read-During-Write Mode
Output Mode Memory Type Description
“new data” The new data is available on the rising edge of the same clock
M10K
(flow-through) cycle on which the new data is written.
The RAM outputs “don’t care” values for a read-during-write
“don’t care” M10K, MLAB
operation.
clk_a
address 0A 0B
rden
wren
byteena 11
clk_a&b
wren_a
address_a A0 A1
byteena_a 11
rden_b
address_b A0 A1
clk_a&b
wren_a
address_a A0 A1
byteena_a 11
rden_b
address_b A0 A1
q_b (asynch) A0 (old data) AAAA BBBB A1 (old data) DDDD EEEE
Figure 2–6. Mixed-Port Read-During-Write: Don’t Care or Constrained Don’t Care Mode
clk_a&b
wren_a
address_a A0 A1
byteena_a 11 01 10 11
rden_b
address_b A0 A1
f For more information about the RAM megafunction that controls the
read-during-write behavior, refer to the Internal Memory (RAM and ROM) User Guide.
By default, the Quartus II software initializes the RAM cells in Cyclone V devices to
zero unless you specify a .mif.
All memory blocks support initialization with a .mif. You can create .mif files in the
Quartus II software and specify their use with the RAM megafunction when you
instantiate a memory in your design. Even if a memory is pre-initialized (for example,
using a .mif), it still powers up with its output cleared.
f For more information about .mif files, refer to the Internal Memory (RAM and ROM)
User Guide and the Quartus II Handbook.
Power Management
Reduce AC power consumption in your design by controlling the clocking of each
memory block:
■ Use the read-enable signal to ensure that read operations occur only when
required. If your design does not require read-during-write, you can reduce your
power consumption by deasserting the read-enable signal during write
operations, or during the period when no memory operations occur.
■ Use the Quartus II software to automatically place any unused memory blocks in
low-power mode to reduce static power.