Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

NIOSII addressing for 32 bit wide SDRAM

Hello, first time poster here.

As the title suggests, I have an FPGA accessing a 32 bit wide DDR2 device

(actually 2x 16 bit devices with appropriately shared signals).

Using SOPC builder to generate a simple system with mainly NIOSII/f and one

HPCII DDR2 controller.

The controller is running full rate which means the "local width" is 64 bits.

The DDR2 size is 256MB so the span is 0x10000000 (bytes) and the base

address is 0x20000000 in SOPC.

I am trying to confirm how to access all of the memory.

Should I use IOWR/IORD or IOWR_32DIRECT/IORD_32DIRECT?

If I use IOWR_32DIRECT/IORD_32DIRECT then should I read/write as:

IOWR_32DIRECT(BASE, 0, val);

IOWR_32DIRECT(BASE, 4, val);

IOWR_32DIRECT(BASE, 8, val);

...

IOWR_32DIRECT(BASE, 0xFFFFFFC, val);

else should the address increments be multiples of 8. Else what?

Thank-you.

27 Replies