24.11.2012 Views

Discover New Applications For Low-Cost Solutions Discover ... - Xilinx

Discover New Applications For Low-Cost Solutions Discover ... - Xilinx

Discover New Applications For Low-Cost Solutions Discover ... - Xilinx

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The DQS net could potentially be delayed<br />

inside the FPGA, but there is no way to<br />

specify a minimum delay to the tools.<br />

FPGA Editor could be used to add delay by<br />

hand, but relying on a minimum delay is<br />

bad design practice. The DQS net could be<br />

delayed on the board. This is a bit more<br />

straightforward. Assuming the PC board is<br />

made of FR4 material, the net will see a<br />

delay of ~150 ps/inch. This helped our read<br />

timing, but unfortunately hurt our write<br />

timing by the same amount.<br />

The Solution<br />

Our design solved the problem by not<br />

using DQS at all – except as a data enable.<br />

Instead, we started with the internal clock<br />

sent to the DDR SDRAM (referred to as<br />

the write clock) and ran it through a<br />

Virtex-II DCM. The DCM phase-shifted<br />

the clock by an amount carefully determined<br />

through a detailed timing analysis of<br />

the system. This clock is referred to as the<br />

read clock.<br />

In addition, we treated the read and<br />

write clocks as asynchronous and used the<br />

DQS as a data enable, as shown in Figure 2.<br />

As a result, our design can tolerate a skew<br />

between the read and write clocks of anywhere<br />

from 0 ns to 10 ns (one clock period).<br />

Therefore, if the SDRAM timing is<br />

affected by a new SDRAM part or board<br />

change, the FPGA does not have to be<br />

re-done.<br />

Other Useful Virtex-II Features<br />

We also took advantage of several other<br />

Virtex-II features in our design:<br />

• The Virtex-II has DDR registers built<br />

into the input/output blocks (IOBs).<br />

This feature allowed us to isolate the<br />

200 MHz DDR signaling in the IOBs,<br />

and allowed the rest of our design to<br />

run at 100 MHz.<br />

• XCITE – <strong>Xilinx</strong> digitally controlled<br />

impedance (DCI) technology allowed<br />

us to terminate the DDR SDRAM<br />

signals without using any external<br />

resistors.<br />

• The DCMs allowed us to synthesize<br />

clocks, limit jitter, and reduce clock<br />

skews.<br />

Voltage<br />

1.45V<br />

1.25V<br />

1.05V<br />

Downstream Logic<br />

Data Valid<br />

Data<br />

Read Clock<br />

Domain<br />

DDR SDRAM<br />

rd_sync_fifo_empty<br />

Read Active<br />

Logic<br />

This is considered<br />

the clock edge.<br />

Process<br />

The architecture for the entire design was<br />

created before any RTL code was written.<br />

This practice allowed us to explore various<br />

alternatives quickly and select the best one.<br />

When we started our RTL coding, we ran<br />

into very few problems.<br />

A DDR SDRAM has many corner<br />

cases. It is extremely difficult to find problems<br />

in hardware. However, using Mentor<br />

Graphics’ ModelSim simulator, <strong>Xilinx</strong><br />

UNISIM libraries, and Micron’s DDR<br />

SDRAM memory model, we successfully<br />

simulated and debugged all corner cases.<br />

DDR SDRAM corner cases can be difficult<br />

to control because they are independent<br />

of the design’s intent. Here’s one example: A<br />

test writes a series of words into the<br />

SDRAM, but the SDRAM needs a refresh<br />

CK and CK# must<br />

ss in this region.<br />

in the middle of the burst. These corner<br />

cases are very hard to target. Generating random<br />

tests and running code coverage helped<br />

determine which corner cases were hit and<br />

which needed more work.<br />

Conclusion<br />

Designing a DDR SDRAM controller<br />

can be tricky. By utilizing the Virtex-II<br />

features along with a solid process and a<br />

little creativity, however, we were able to<br />

implement a 200 MHz DDR SDRAM<br />

controller in a –5 speed grade Virtex-II<br />

FPGA.<br />

To design this controller in an ASIC<br />

would have cost a great deal more, and it<br />

could not have been possible in previous<br />

FPGA architectures. Visit Plexus at<br />

www.plexus.com for more information.<br />

Fall 2003 Xcell Journal 31<br />

DQS<br />

Figure 1 – Clock crossing<br />

Read Active<br />

Sync<br />

Q SET<br />

Q CLR<br />

Read Active<br />

Time<br />

System ystem Clock<br />

Domain<br />

Q SET S<br />

Q CLR R<br />

Do a Read<br />

Figure 2 – Synchronization scheme<br />

Upstream Logic

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!