PDF.js viewer
PDF.js viewer
CYIV-51007-2.6
This chapter describes the memory interface pin support and the external memory
interface features of Cyclone® IV devices.
In addition to an abundant supply of on-chip memory, Cyclone IV devices can easily
interface with a broad range of external memory devices, including DDR2 SDRAM,
DDR SDRAM, and QDR II SRAM. External memory devices are an important system
component of a wide range of image processing, storage, communications, and
general embedded applications.
1 Altera recommends that you construct all DDR2 or DDR SDRAM external memory
interfaces using the Altera® ALTMEMPHY megafunction. You can implement the
controller function using the Altera DDR2 or DDR SDRAM memory controllers,
third-party controllers, or a custom controller for unique application needs.
Cyclone IV devices support QDR II interfaces electrically, but Altera does not supply
controller or physical layer (PHY) megafunctions for QDR II interfaces.
f For more information about supported maximum clock rate, device and pin planning,
IP implementation, and device termination, refer to the External Memory Interface
Handbook.
© 2016 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
7–2 Chapter 7: External Memory Interfaces in Cyclone IV Devices
Cyclone IV Devices Memory Interfaces Pin Support
Figure 7–1 shows the block diagram of a typical external memory interface data path
in Cyclone IV devices.
DQS/CQ/CQn
DQ
OE IOE
OE IOE
Register Register
IOE
IOE
Register
Register
VCC IOE
DataA IOE LE
Register Register Register
GND IOE
Register
DataB IOE LE LE
Register Register Register
System Clock
PLL
f For more information about implementing complete external memory interfaces, refer
to the External Memory Interface Handbook.
f For more information about pin utilization, refer to Volume 2: Device, Pin, and Board
Layout Guidelines of the External Memory Interface Handbook.
1 In QDR II SRAM, the Q read-data group must be placed at a different VREF bank
location from the D write-data group, command, or address pins.
In Cyclone IV devices, DQS is used only during write mode in DDR2 and
DDR SDRAM interfaces. Cyclone IV devices ignore DQS as the read-data strobe
because the PHY internally generates the read capture clock for read mode. However,
you must connect the DQS pin to the DQS signal in DDR2 and DDR SDRAM interfaces,
or to the CQ signal in QDR II SRAM interfaces.
f When you use the Altera Memory Controller MegaCore® function, the PHY is
instantiated for you. For more information about the memory interface data path,
refer to the External Memory Interface Handbook.
All I/O banks in Cyclone IV devices can support DQ and DQS signals with DQ-bus
modes of ×8, ×9, ×16, ×18, ×32, and ×36 except Cyclone IV GX devices that do not
support left I/O bank interface. DDR2 and DDR SDRAM interfaces use ×8 mode DQS
group regardless of the interface width. For a wider interface, you can use multiple ×8
DQ groups to achieve the desired width requirement.
In the ×9, ×18, and ×36 modes, a pair of complementary DQS pins (CQ and CQ#)
drives up to 9, 18, or 36 DQ pins, respectively, in the group, to support one, two, or four
parity bits and the corresponding data bits. The ×9, ×18, and ×36 modes support the
QDR II memory interface. CQ# is the inverted read-clock signal that is connected to
the complementary data strobe (DQS or CQ#) pin. You can use any unused DQ pins as
regular user I/O pins if they are not used as memory interface signals.
f For more information about unsupported DQS and DQ groups of the Cyclone IV
transceivers that run at 2.97 Gbps data rate, refer to the Cyclone IV Device Family Pin
Connection Guidelines.
Table 7–1 lists the number of DQS or DQ groups supported on each side of the
Cyclone IV GX device.
Table 7–1. Cyclone IV GX Device DQS and DQ Bus Mode Support for Each Side of the Device
Number Number Number Number Number Number
Device Package Side ×8 ×9 ×16 ×18 ×32 ×36
Groups Groups Groups Groups Groups Groups
Right 1 0 0 0 — —
EP4CGX15 169-pin FBGA Top (1) 1 0 0 0 — —
Bottom (2) 1 0 0 0 — —
Right 1 0 0 0 — —
169-pin FBGA Top (1) 1 0 0 0 — —
Bottom (2) 1 0 0 0 — —
Right 2 2 1 1 — —
EP4CGX22
324-pin FBGA Top 2 2 1 1 — —
EP4CGX30
Bottom 2 2 1 1 — —
Right 4 2 2 2 1 1
484-pin FBGA (3) Top 4 2 2 2 1 1
Bottom 4 2 2 2 1 1
Right 4 2 2 2 1 1
484-pin FBGA Top 4 2 2 2 1 1
EP4CGX50 Bottom 4 2 2 2 1 1
EP4CGX75 Right 4 2 2 2 1 1
672-pin FBGA Top 4 2 2 2 1 1
Bottom 4 2 2 2 1 1
Right 4 2 2 2 1 1
484-pin FBGA Top 4 2 2 2 1 1
Bottom 4 2 2 2 1 1
Right 4 2 2 2 1 1
EP4CGX110
672-pin FBGA Top 4 2 2 2 1 1
EP4CGX150
Bottom 4 2 2 2 1 1
Right 6 3 2 2 1 1
896-pin FBGA Top 6 3 3 3 1 1
Bottom 6 3 3 3 1 1
Notes to Table 7–1:
(1) Some of the DQ pins can be used as RUP and RDN pins. You cannot use these groups if you are using these pins as RUP and RDN pins for
OCT calibration.
(2) Some of the DQ pins can be used as RUP pins while the DM pins can be used as RDN pins. You cannot use these groups if you are using the
RUP and RDN pins for OCT calibration.
(3) Only available for EP4CGX30 device.
Table 7–2 lists the number of DQS or DQ groups supported on each side of the
Cyclone IV E device.
Table 7–2. Cyclone IV E Device DQS and DQ Bus Mode Support for Each Side of the Device (Part 1 of 3)
Number Number Number Number Number Number
Device Package Side ×8 ×9 ×16 ×18 ×32 ×36
Groups Groups Groups Groups Groups Groups
Left 0 0 0 0 — —
Right 0 0 0 0 — —
144-pin EQFP
Bottom (1), (3) 1 0 0 0 — —
Top (1), (4) 1 0 0 0 — —
Left (1) 1 1 0 0 — —
EP4CE6 Right (2) 1 1 0 0 — —
256-pin UBGA
EP4CE10 Bottom 2 2 1 1 — —
Top 2 2 1 1 — —
Left (1) 1 1 0 0 — —
Right (2) 1 1 0 0 — —
256-pin FBGA
Bottom 2 2 1 1 — —
Top 2 2 1 1 — —
Left 0 0 0 0 — —
Right 0 0 0 0 — —
144-pin EQFP
Bottom (1), (3) 1 0 0 0 — —
Top (1), (4) 1 0 0 0 — —
Left 0 0 0 0 — —
Right 0 0 0 0 — —
164-pin MBGA
Bottom (1), (3) 1 0 0 0 — —
Top (1), (4) 1 0 0 0 — —
Left 1 1 0 0 — —
Right 1 1 0 0 — —
256-pin MBGA
Bottom (1), (3) 2 2 1 1 — —
Top (1), (4) 2 2 1 1 — —
EP4CE15
Left (1) 1 1 0 0 — —
Right (2) 1 1 0 0 — —
256-pin UBGA
Bottom 2 2 1 1 — —
Top 2 2 1 1 — —
Left (1) 1 1 0 0 — —
Right (2) 1 1 0 0 — —
256-pin FBGA
Bottom 2 2 1 1 — —
Top 2 2 1 1 — —
Left 4 4 2 2 1 1
Right 4 4 2 2 1 1
484-pin FBGA
Bottom 4 4 2 2 1 1
Top 4 4 2 2 1 1
Table 7–2. Cyclone IV E Device DQS and DQ Bus Mode Support for Each Side of the Device (Part 2 of 3)
Number Number Number Number Number Number
Device Package Side ×8 ×9 ×16 ×18 ×32 ×36
Groups Groups Groups Groups Groups Groups
Left 0 0 0 0 — —
Right 0 0 0 0 — —
144-pin EQFP
Bottom (1), (3) 1 0 0 0 — —
Top (1), (4) 1 0 0 0 — —
Left (1) 1 1 0 0 — —
Right (2) 1 1 0 0 — —
EP4CE22 256-pin UBGA
Bottom 2 2 1 1 — —
Top 2 2 1 1 — —
Left (1) 1 1 0 0 — —
Right (2) 1 1 0 0 — —
256-pin FBGA
Bottom 2 2 1 1 — —
Top 2 2 1 1 — —
Left (1) 2 2 1 1 0 0
Right (2) 2 2 1 1 0 0
EP4CE30 324-pin FBGA
Bottom 2 2 1 1 0 0
Top 2 2 1 1 0 0
Left 4 4 2 2 1 1
Right 4 4 2 2 1 1
484-pin FBGA
Bottom 4 4 2 2 1 1
EP4CE30 Top 4 4 2 2 1 1
EP4CE115 Left 4 4 2 2 1 1
Right 4 4 2 2 1 1
780-pin FBGA
Bottom 6 6 2 2 1 1
Top 6 6 2 2 1 1
Left 2 2 1 1 0 0
Right 2 2 1 1 0 0
EP4CE40 324-pin FBGA
Bottom 2 2 1 1 0 0
Top 2 2 1 1 0 0
Table 7–2. Cyclone IV E Device DQS and DQ Bus Mode Support for Each Side of the Device (Part 3 of 3)
Number Number Number Number Number Number
Device Package Side ×8 ×9 ×16 ×18 ×32 ×36
Groups Groups Groups Groups Groups Groups
Left 4 4 2 2 1 1
Right 4 4 2 2 1 1
484-pin UBGA
Bottom 4 4 2 2 1 1
Top 4 4 2 2 1 1
Left 4 4 2 2 1 1
EP4CE40
Right 4 4 2 2 1 1
EP4CE55 484-pin FBGA
Bottom 4 4 2 2 1 1
EP4CE75
Top 4 4 2 2 1 1
Left 4 4 2 2 1 1
Right 4 4 2 2 1 1
780-pin FBGA
Bottom 6 6 2 2 1 1
Top 6 6 2 2 1 1
Notes to Table 7–2:
(1) Some of the DQ pins can be used as RUP and RDN pins. You cannot use these groups if you are using these pins as RUP and RDN pins for
OCT calibration.
(2) Some of the DQ pins can be used as RUP pins while the DM pins can be used as RDN pins. You cannot use these groups if you are using the
RUP and RDN pins for OCT calibration.
(3) There is no DM pin support for these groups.
(4) PLLCLKOUT3n and PLLCLKOUT3p pins are shared with the DQ or DM pins to gain ×8 DQ group. You cannot use these groups if you are using
PLLCLKOUT3n and PLLCLKOUT3p.
f For more information about device package outline, refer to the Device Packaging
Specifications webpage.
DQS pins are listed in the Cyclone IV pin tables as DQSXY, in which X indicates the DQS
grouping number and Y indicates whether the group is located on the top (T), bottom
(B), or right (R) side of the device. Similarly, the corresponding DQ pins are marked as
DQXY, in which the X denotes the DQ grouping number and Y denotes whether the
group is located on the top (T), bottom (B), or right (R) side of the device. For example,
DQS2T indicates a DQS pin belonging to group 2, located on the top side of the device.
Similarly, the DQ pins belonging to that group is shown as DQ2T.
1 Each DQ group is associated with its corresponding DQS pins, as defined in the Cyclone
IV pin tables. For example:
■ For DDR2 or DDR SDRAM, ×8 DQ group DQ3B[7..0] pins are associated with
the DQS3B pin (same 3B group index)
■ For QDR II SRAM, ×9 Q read-data group DQ3T[8..0] pins are associated with
DQS0T/CQ0T and DQS1T/CQ0T# pins (same 0T group index)
The Quartus® II software issues an error message if a DQ group is not placed properly
with its associated DQS.
Figure 7–2 shows the location and numbering of the DQS, DQ, or CQ# pins in the
Cyclone IV GX I/O banks.
Figure 7–2. DQS, CQ, or CQ# Pins in Cyclone IV GX I/O Banks (1)
DQS1T/CQ1T#
DQS3T/CQ3T#
DQS5T/CQ5T#
DQS4T/CQ5T
DQS2T/CQ3T
DQS0T/CQ1T
I/O Bank 9 I/O Bank 8B I/O Bank 8 I/O Bank 8A I/O Bank 7
Transceiver Block (QL1)
DQS4R/CQ5R
I/O Bank 6
DQS2R/CQ3R
DQS0R/CQ1R
Cyclone IV GX Device
Transceiver Block (QL0)
DQS1R/CQ1R#
I/O Bank 5
DQS3R/CQ3R#
DQS5R/CQ5R#
DQS3B/CQ3B#
DQS5B/CQ5B#
DQS4B/CQ5B
DQS2B/CQ3B
DQS0B/CQ1B
Figure 7–3 shows the location and numbering of the DQS, DQ, or CQ# pins in I/O banks
of the Cyclone IV GX device in the 324-pin FBGA package only.
Figure 7–3. DQS, CQ, or CQ# Pins for Cyclone IV GX Devices in the 324-Pin FBGA Package
DQS1T/CQ0T#
DQS3T/CQ1T#
DQS2T/CQ1T
DQS0T/CQ0T
I/O Bank 9 I/O Bank 8 I/O Bank 8A I/O Bank 7
DQS2R/CQ1R
I/O Bank 6
Transceiver Block (QL1)
DQS0R/CQ0R
Cyclone IV GX Device
324-pin FBGA Package
DQS1R/CQ0R#
I/O Bank 5
DQS3R/CQ1R#
DQS3B/CQ1B#
DQS2B/CQ1B
DQS0B/CQ0B
Figure 7–4 shows the location and numbering of the DQS, DQ, or CQ# pins in I/O
banks of the Cyclone IV GX device in the 169-pin FBGA package.
Figure 7–4. DQS, CQ, or CQ# Pins for Cyclone IV GX Devices in the 169-Pin FBGA Package
DQS1T/CQ0T#
DQS0T/CQ0T
DQS0R/CQ0R
Transceiver Block (QL1)
Cyclone IV GX Device
169-pin FBGA Package
I/O Bank 5
DQS1R/CQ0R#
DQS0B/CQ0B
Figure 7–5 shows the location and numbering of the DQS, DQ, or CQ# pins in the
Cyclone IV E device I/O banks.
Figure 7–5. DQS, CQ, or CQ# Pins in Cyclone IV E I/O Banks (1)
DQS1T/CQ1T#
DQS3T/CQ3T#
DQS5T/CQ5T#
DQS4T/CQ5T
DQS2T/CQ3T
DQS0T/CQ1T
I/O Bank 8 I/O Bank 7
DQS2L/CQ3L DQS2R/CQ3R
I/O Bank 6
I/O Bank 1
DQS0R/CQ1R
DQS0L/CQ1L
Cyclone IV E Device
DQS1R/CQ1R#
DQS1L/CQ1L#
I/O Bank 2
I/O Bank 5
DQS3L/CQ3L# DQS3R/CQ3R#
DQS4B/CQ5B
DQS2B/CQ3B
DQS0B/CQ1B
DQS1B/CQ1B#
DQS5B/CQ5B#
Figure 7–6 shows the location and numbering of the DQS, DQ, or CQ# pins in I/O
banks of the Cyclone IV E device in the 144-pin EQFP and 164-pin MBGA packages.
Figure 7–6. DQS, CQ, or CQ# Pins for Cyclone IV E Devices in the 144-Pin EQFP and 164-pin
MBGA Packages
DQS1T/CQ1T#
DQS0T/CQ1T
I/O Bank 8 I/O Bank 7
DQS0L/CQ1L DQS0R/CQ1R
I/O Bank 6
I/O Bank 1
Cyclone IV E Devices
in 144-pin EQFP and
164-pin MBGA
I/O Bank 5
I/O Bank 2
DQS1L/CQ1L# DQS1R/CQ1R#
DQS0B/CQ1B
In Cyclone IV devices, the ×9 mode uses the same DQ and DQS pins as the ×8 mode, and
one additional DQ pin that serves as a regular I/O pin in the ×8 mode. The ×18 mode
uses the same DQ and DQS pins as ×16 mode, with two additional DQ pins that serve as
regular I/O pins in the ×16 mode. Similarly, the ×36 mode uses the same DQ and DQS
pins as the ×32 mode, with four additional DQ pins that serve as regular I/O pins in
the ×32 mode. When not used as DQ or DQS pins, the memory interface pins are
available as regular I/O pins.
In Cyclone IV devices, the DM pins are preassigned in the device pinouts. The
Quartus II Fitter treats the DQ and DM pins in a DQS group equally for placement
purposes. The preassigned DQ and DM pins are the preferred pins to use.
Some DDR2 SDRAM and DDR SDRAM devices support error correction coding
(ECC), a method of detecting and automatically correcting errors in data
transmission. In 72-bit DDR2 or DDR SDRAM, there are eight ECC pins and 64 data
pins. Connect the DDR2 and DDR SDRAM ECC pins to a separate DQS or DQ group in
Cyclone IV devices. The memory controller needs additional logic to encode and
decode the ECC data.
1 Cyclone IV devices do not support QDR II SRAM in the burst length of two.
1 CK/CK# pins must be placed on differential I/O pins (DIFFIO in Pin Planner) and in
the same bank or on the same side as the data pins. You can use either side of the
device for wraparound interfaces. As seen in the Pin Planner Pad View, CK0 cannot be
located in the same row and column pad group as any of the interfacing DQ pins.
f For more information about memory clock pin placement, refer to Volume 2: Device,
Pin, and Board Layout Guidelines of the External Memory Interface Handbook.
dataout_h LE DQ
Register
Input Register A I
neg_reg_out
dataout_l LE LE
Register Register
Capture Clock
PLL
These DDR input registers are implemented in the core of devices. The DDR data is
first fed to two registers, input register AI and input register BI.
■ Input register AI captures the DDR data present during the rising edge of the clock
■ Input register BI captures the DDR data present during the falling edge of the clock
■ Register CI aligns the data before it is synchronized with the system clock
The data from the DDR input register is fed to two registers, sync_reg_h and
sync_reg_l, then the data is typically transferred to a FIFO block to synchronize the
two data streams to the rising edge of the system clock. Because the read-capture
clock is generated by the PLL, the read-data strobe signal (DQS or CQ) is not used
during read operation in Cyclone IV devices; hence, postamble is not a concern in this
case.
Output Enable
IOE
Register
Output Enable
Register AOE
data1
data0
IOE
Register
Output Enable
Register BOE
datain_l
IOE
Register
data0 DQ or DQS
Output Register AO
data1
datain_h
IOE
Register
-90° Shifted Clock
®
Output Register BO
The two DDR output registers are located in the I/O element (IOE) block. Two serial
data streams routed through datain_l and datain_h, are fed into two registers,
output register Ao and output register Bo, respectively, on the same clock edge.
The output from output register Ao is captured on the falling edge of the clock, while
the output from output register Bo is captured on the rising edge of the clock. The
registered outputs are multiplexed by the common clock to drive the DDR output pin
at twice the data rate.
The DDR output enable path has a similar structure to the DDR output path in the
IOE block. The second output enable register provides the write preamble for the DQS
strobe in DDR external memory interfaces. This active-low output enable register
extends the high-impedance state of the pin by half a clock cycle to provide the
external memory’s DQS write preamble time specification.
f For more information about Cyclone IV IOE registers, refer to the Cyclone IV Device
I/O Features chapter.
Figure 7–9 illustrates how the second output enable register extends the DQS
high-impedance state by half a clock cycle during a write operation.
Figure 7–9. Extending the OE Disable by Half a Clock Cycle for a Write Transaction (1)
System clock
(outclock for DQS)
Write Clock
(outclock for DQ,
-90o phase shifted
from System Clock)
datain_h D0 D2
(from logic array)
datain_I
D1 D3
(from logic array)
OE for DQ
(from logic array)
DQ D0 D1 D2 D3
f For more information about the Cyclone IV devices OCT calibration block, refer to the
Cyclone IV Device I/O Features chapter.
PLL
When interfacing with external memory, the PLL is used to generate the memory
system clock, the write clock, the capture clock and the logic-core clock. The system
clock generates the DQS write signals, commands, and addresses. The write-clock is
shifted by -90° from the system clock and generates the DQ signals during writes. You
can use the PLL reconfiguration feature to calibrate the read-capture phase shift to
balance the setup and hold margins.
1 The PLL is instantiated in the ALTMEMPHY megafunction. All outputs of the PLL are
used when the ALTMEMPHY megafunction is instantiated to interface with external
memories. PLL reconfiguration is used in the ALTMEMPHY megafunction to
calibrate and track the read-capture phase to maintain the optimum margin.
f For more information about Cyclone IV PLL, refer to the Clock Networks and PLLs in
Cyclone IV Devices chapter.