5

the following post is quite long, but since I have had trouble making the SP605 board properly interact with the DDR3 for over a month now, hopefully this will be useful to others in the same situation as I find myself in. I am pretty certain it's a simple configuration or conceptual error, but I would be more than happy to have this resolved soon.

=== SCENARIO ===

I have created a USB-UART interface to communicate with the FPGA and control the DDR3. Using the IP generator in ISE, I generated a MIG wrapper and then I designed the memory interface controller. However, I have referenced manuals ug388 and ug416, but I have not been able to have the DDR3 behave as expected.

=== PROBLEM STATEMENT ===

Playing around with the burst lengths for write and read commands, I am able to get data back from the DDR3, yet the addressing scheme does not seem to be correct as data is duplicated in addresses 0 and 1, 2 and 3, 4 and 5, and so forth. Also, whenever I write into address 0, for example, nothing changes. Then, when I write into address 1, both addresses 0 and 1 are updated with the data value I just sent. It seems I am "losing" half of the memory space due to this coupled effect.

=== DDR3 IP CONFIGURATION ===

The setup for the DDR3 using the IP generator – considering the SP605 board scenario – is listed below. In sum, I activated the DDR3 Bank 3 and configured Port0 to be 32-bit bidirectional.

Memory selection:

  • Enable AXI interface: unchecked

  • Use extended MCB performance range: unchecked

  • Memory type for bank 3: DDR3 SDRAM

  • Memory type for bank 1: none

Options for C3 – DDR3 SDRAM

  • Frequency: 400 MHz

  • Memory part: MTJ41J64M16XX-187E

Memory options for C3 – DDR3 SDRAM

  • Output driver impedance control: RZQ/6

  • RTT (nominal) – ODT: RZQ/4

  • Auto self refresh: enabled

Port configuration for C3 – DDR3 SDRAM

  • Two 32-bit bi-directional and four 32-bit unidirectional ports

  • Port0: checked

  • Port1: unchecked

  • Port2: unchecked

  • Port3: unchecked

  • Port4: unchecked

  • Port5: unchecked

  • Memory address mapping selection: row-bank-column

FPGA options for C3 – DDR3 SDRAM

  • Memory interface pin termination: Calibrated input termination

  • Select RZQ pin location: R7

  • Select ZIO pin location: W4

  • Debug signals for memory controller: disable

  • System clock: differential

=== DATA STRUCTURE ===

From Matlab, I send in a 64-bit command which should write or read the DDR3 based on the address and data provided in this command.

wire [00:00] cmd_instruction = usb_data[63:63];         // ‘0’ = write; ‘1’ = read
wire [27:00] cmd_address = usb_data[62:37];             // 26-bit address
wire [31:00] cmd_data = usb_data[31:00];                // 32-bit data

In ug388, the following can be extracted:

Page 20: The address is 26 bits wide.

C_MEM_ADDR_WIDTH = 13
C_MEM_BANKADDR_WIDTH = 3
C_MEM_NUM_COL_BITS = 10
C_P0_DATA_PORT_SIZE = 32  // 32-bit data ports
C_P0_MASK_SIZE = 4        // 4 bytes = 32 bits (1 mask bit = 1 entire data byte)

Pages 26-27: Command data structure.

  • pX_cmd_addr[29:0]: 30-bit address, however the last two bits should = “00” since every word (32 bits) is formed by 4 bytes.

  • pX_cmd_bl[5:0]: Burst length of 1 is obtained by setting this signal to 0.

  • pX_cmd_instr[2:0]: The only command instructions used are write=”000” and read=”001”.

Page 28: Write data structure.

  • pX_wr_mask[PX_MASKSIZE-1:0]: 4-bit mask is set to “0000” so that all 4 bytes are always written into the memory.

=== SIGNAL ASSIGNMENTS ===

Using all this information, I assigned my signals in the following manner:

assign p0_mcb_cmd_instr = {2'b00, cmd_instruction};
assign p0_mcb_cmd_addr = {2’d0, cmd_address, 2'd0};
assign p0_mcb_cmd_bl = 6'd0;
assign p0_mcb_wr_data = cmd_data;
assign p0_mcb_wr_mask = 4'd0;

localparam C3_MEM_BURST_LEN = 8; 

=== CONCLUSIONS ===

Based on the configuration, does anyone know what the expected behavior of my controller should be? If any additional information is necessary for clarification, please let me know.

Thanks a lot, Bruno.

buped82
  • 51
  • 3

0 Answers0