Generic Serial Flash Interface Intel® FPGA IP User Guide

ID 683419
Date 11/09/2021
Public
Download

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

1.8.5. Read Memory from the Flash

The following registers are used to perform the read memory:

  • Operating protocols setting register
  • Control register
  • Read instruction register

Perform the Read Memory (Extended Mode)

proc read { } {
global mp operating_protocols_setting control_register read_instr
master_write_32 $mp $operating_protocols_setting 0x00000000
master_write_32 $mp $control_register 0x00000001
master_write_32 $mp $read_instr 0x00000003
master_read_32 $mp 0x0100000 0x1
}

To perform the read memory for the extended mode, follow these steps:

  1. Define the global variables.
  2. Write to the operating protocols setting register to set the transfer mode of the read memory operation. In this example, the transfer mode for read is (1-1-1).
    1. Set the instruction transfer mode [1:0] to 0, read address transfer mode [13:12] to 0, and read data out transfer mode [17:16] to 0.
  3. Write to the control register to choose the byte addressing mode of the read memory operation.
    1. This example is using the 3-byte addressing mode. Set bit 8 to 0.
  4. Write to the read instruction register to customize the read memory operation.
    1. Set the read operation code [7:0] to 03 as 03h is the operation code for read.
    2. Set the dummy cycles [12:8] to 0 as the read operation does not contain any dummy cycles.
  5. After setting the registers, you can perform read memory content in the address.
    1. In this example, 1 word of data is read from address 0x01000000.

Perform the Dual-Output Fast Read (Dual-SPI Mode)

proc dual_output_fast_read { } {
global mp operating_protocols_setting control_register read_instr
master_write_32 $mp $operating_protocols_setting 0x00011001
master_write_32 $mp $control_register 0x00000101
master_write_32 $mp $read_instr 0x00000A3B
master_read_32 $mp 0x00000100 0x1
}

To perform the dual-output fast read mode, follow these steps:

  1. Define the global variables.
  2. Write to the operating protocols setting register to set the transfer mode of the read memory operation. In this example, the transfer mode for read is (2-2-2).
    1. Set the instruction transfer mode [1:0] to 1, read address transfer mode [13:12] to 1, and read data out transfer mode [17:16] to 1.
  3. Write to the control register to choose the byte addressing mode of the read memory operation.
    1. This example is using the 4-byte addressing mode. Set bit 8 to 1.
  4. Write to the read instruction register to customize the read memory operation.
    1. Set the read operation code [7:0] to 3B as 3Bh is the operation code for the dual-output fast read.
    2. Set the dummy cycles [12:8] to A as the dual-output fast read operation contains 10 dummy cycles.
  5. After setting the registers, you can perform dual-output fast read memory content in the address.
    1. In this example, the memory content is read from address 0x00000100.