16.1.7 RAM1K20

The RAM1K20 block contains 20,480 (16,896 with ECC) memory bits and is a true dual-port memory. The RAM1K20 memory can also be configured in two-port mode. All read/write operations to the RAM1K20 memory are synchronous. To improve the read-data delay, an optional pipeline register at the output is available. In addition to the feed-through write mode option to enable immediate access to the write-data, RAM1K20 has a Read-before-write option in the dual-port mode. RAM1K20 also includes a Read-enable control for both dual-port and two-port modes. The RAM1K20 memory has two data ports, which can be independently configured in any of the following combination.

  • Non-ECC Dual-Port RAM with the following configurations:
    • Any of 1Kx20, 2Kx10, 4Kx5, 8Kx2 or 16Kx1 on each port
  • Non-ECC Two-Port RAM with the following configurations:
    • Any of 512x40, 1Kx20, 2Kx10, 4Kx5, 8Kx2 or 16Kx1 on each port
  • ECC Two-Port RAM with the following configuration:
    • 512x33 on both ports

16.1.7.1 Functionality

The main features of the RAM1K20 memory block are as follows:
  • A RAM1K20 block has 16,896 bits with ECC and 20,480 bits without ECC.
  • A RAM1K20 block provides two independent data ports A and B.
  • In non-ECC dual-port mode, each port can be independently configured to any of the following depth/width: 1Kx20, 2Kx10, 4Kx5, 8Kx2 or 16Kx1. There are 25 unique combinations of non-ECC dual-port aspect ratios:
  • RAM1K20 also has a two-port mode. In this case, Port A will become the read port and Port B becomes the write port.
  • In non-ECC two-port mode, each port can be independently configured to any of the following depth/width: 512x40, 1Kx20, 2Kx10, 4Kx5, 8Kx2 or 16Kx1. There are 36 unique combinations of non-ECC two-port aspect ratios:
  • RAM1K20 has an ECC two-port mode, for which both ports have word widths equal to 33 bits. There is one unique combination of ECC two-port aspect ratio:

    512x33/512x33

  • RAM1K20 performs synchronous operation for setting up the address as well as writing and reading the data.
  • RAM1K20 has a Read-enable control for both dual-port and two-port modes.
  • The address, data, block-port select, write-enable and read-enable inputs are registered.
  • An optional pipeline register with a separate enable, synchronous-reset and asynchronous-reset is available at the read-data port to improve the clock-to-out delay.
  • There is an independent clock for each port. The memory is triggered at the rising edge of the clock.
  • The true dual-port mode supports an optional Read-before-write mode or a feed-through write mode, where the write-data also appears on the corresponding read-data port.
  • Read from both ports at the same location is allowed.
  • Read and write on the same location at the same time results in unknown data to be read. There is no collision prevention or detection. However, correct data is expected to be written into the memory.
  • When ECC is enabled, each port of the RAM1K20 memory can raise flags to indicate single-bit-correct and double-bit-detect.

The following figure shows a simplified block diagram of the RAM1K20 memory block. The simplified block illustrates the two independent data ports, ECC, the read-data pipeline registers, read-before-write selection, and the feed-through multiplexors.

Figure 16-67. Simplified Block Diagram of RAM1K20
Table 16-130. Port List for RAM1K20
Pin NamePin DirectionTypeDescriptionPolarity
A_ADDR[13:0]InputDynamicPort A address
A_BLK_EN[2:0]InputDynamicPort A block selectsHigh
A_CLKInputDynamicPort A clockRising
A_DIN[19:0]InputDynamicPort A write-data
A_DOUT[19:0]OutputDynamicPort A read-data
A_WEN[1:0]InputDynamicPort A write-enables (per byte)High
A_RENInputDynamicPort A read-enableHigh
A_WIDTH[2:0]InputStaticPort A width/depth mode select
A_WMODE[1:0]InputStaticPort A Read-before-write and Feed-through write selectsHigh
A_BYPASSInputStaticPort A pipeline register selectLow
A_DOUT_ENInputDynamicPort A pipeline register enableHigh
A_DOUT_SRST_NInputDynamicPort A pipeline register synchronous-resetLow
A_DOUT_ARST_NInputDynamicPort A pipeline register asynchronous-resetLow
B_ADDR[13:0]InputDynamicPort B address
B_BLK_EN[2:0]InputDynamicPort B block selectsHigh
B_CLKInputDynamicPort B clockRising
B_DIN[19:0]InputDynamicPort B write-data
B_DOUT[19:0]DynamicPort B read-data
B_WEN[1:0]InputDynamicPort B write-enables (per byte)High
B_RENInputDynamicPort B read-enableHigh
B_WIDTH[2:0]InputStaticPort B width/depth mode select
B_WMODE[1:0]InputStaticPort B Read-before-write and Feed-through write selectsHigh
B_BYPASSInputStaticPort B pipeline register selectLow
B_DOUT_ENInputDynamicPort B pipeline register enableHigh
B_DOUT_SRST_NInputDynamicPort B pipeline register synchronous-resetLow
B_DOUT_ARST_NInputDynamicPort B pipeline register asynchronous-resetLow
ECC_ENInputStaticEnable ECCHigh
ECC_BYPASSInputStaticECC pipeline register selectLow
SB_CORRECTOutputDynamicSingle-bit correct flagHigh
DB_DETECTOutputDynamicDouble-bit detect flagHigh
BUSY_FBInputStaticLock access to FCBHigh
ACCESS_BUSYOutputDynamicBusy signal from FCBHigh
Tip: Static inputs are defined at design time and need to be tied to 0 or 1.

A_WIDTH and B_WIDTH

The following table lists the width/depth mode selections for each port. Two-port mode is in effect when the width of at least one port is greater than 20, and A_WIDTH indicates the read width while B_WIDTH indicates the write width.

Table 16-131. Width/Depth Mode Selection
Depth x WidthA_WIDTH/B_WIDTH
16Kx1000
8Kx2001
4Kx4, 4Kx5010
2Kx8, 2Kx10011
1Kx16, 1Kx20100
512x32 (Two-port),

512x40 (Two-port),

512x33 (Two-port ECC)

101

A_WEN and B_WEN

The following table lists the write/read control signals for each port. Two-port mode is in effect when the width of at least one port is greater than 20, and read operation is always enabled.

Table 16-132. Write/Read Operation Select
Depth x WidthA_WEN/B_WENResult
16Kx1, 8Kx2, 4Kx5,

2Kx10

x0Perform a read operation
x1Perform a write operation
1Kx1600Perform a read operation
01Write [8:5], [3:0]
10Write [18:15], [13:10]
11Write [18:15], [13:10], [8:5], [3:0]
1Kx2000Perform a read operation
01Write [9:0]
10Write [19:10]
11Write [19:0]
512x32 (Two-port write)B_WEN[0] = 1Write B_DIN[8:5], B_DIN[3:0]
B_WEN[1] = 1Write B_DIN[18:15], B_DIN[13:10]
A_WEN[0] = 1Write A_DIN[8:5], A_DIN[3:0]
A_WEN[1] = 1Write A_DIN[18:15], A_DIN[13:10]
512x40 (Two-port write)B_WEN[0] = 1Write B_DIN[9:0]
B_WEN[1] = 1Write B_DIN[19:10]
A_WEN[0] = 1Write A_DIN[9:0]
A_WEN[1] = 1Write A_DIN[19:10]
512x33 (Two-port ECC)B_WEN[1:0] = 11Write B_DIN[16:0]
A_WEN[1:0] = 11Write A_DIN[15:0]

A_ADDR and B_ADDR

The following table lists the address buses for the two ports. 14 bits are needed to address the 16K independent locations in x1 mode. In wider modes, fewer address bits are used. The required bits are MSB justified and unused LSB bits must be tied to 0. A_ADDR is synchronized by A_CLK while B_ADDR is synchronized to B_CLK. Two-port mode is in effect when the width of at least one port is greater than 20, and A_ADDR provides the read-address while B_ADDR provides the write-address.

Table 16-133. Address Bus Used and Unused Bits
Depth x WidthA_ADDR/B_ADDR
Used BitsUnused Bits

(must be tied to 0)

16Kx1[13:0]None
8Kx2[13:1][0]
4Kx4, 4Kx5[13:2][1:0]
2Kx8, 2Kx10[13:3][2:0]
1Kx16, 1Kx20[13:4][3:0]
512x32 (Two-port),

512x40 (Two-port),

512x33 (Two-port ECC)

[13:5][4:0]

A_DIN and B_DIN

The following table lists the data input buses for the two ports. The required bits are LSB justified and unused MSB bits must be tied to 0. Two-port mode is in effect when the width of at least one port is greater than 20, and A_DIN provides the MSB of the write-data while B_DIN provides the LSB of the write-data.

Table 16-134. Data Input Buses Used and Unused Bits
Depth x WidthA_DIN/B_DIN
Used BitsUnused Bits

(must be tied to 0)

16Kx1[0][19:1]
8Kx2[1:0][19:2]
4Kx4[3:0][19:4]
4Kx5[4:0][19:5]
2Kx8[8:5] is [7:4]

[3:0] is [3:0]

[19:9]

[4]

2Kx10[9:0][19:10]
1Kx16[18:15] is [15:12]

[13:10] is [11:8]

[8:5] is [7:4]

[3:0] is [3:0]

[19]

[14]

[9]

[4]

1Kx20[19:0]None
512x32 (Two-port write)A_DIN[18:15] is [31:28] A_DIN[13:10] is [27:24] A_DIN[8:5] is [23:20] A_DIN[3:0] is [19:16] B_DIN[18:15] is [15:12 B_DIN[13:10] is [11:8] B_DIN[8:5] is [7:4]

B_DIN[3:0] is [3:0]

A_DIN[19]

A_DIN[14]

A_DIN[9]

A_DIN[4]

B_DIN[19]

B_DIN[14]

B_DIN[9]

B_DIN[4]

512x40 (Two-port write)A_DIN[19:0] is [39:20] B_DIN[19:0] is [19:0 ]None
512x33 (Two-port ECC)A_DIN[15:0] is [32:17] B_DIN[16:0] is [16:0 ]A_DIN[19:16]

B_DIN[19:17]

A_DOUT and B_DOUT

The following table lists the data output buses for the two ports. The required bits are LSB justified. Two-port mode is in effect when the width of at least one port is greater than 20, and A_DOUT provides the MSB of the read-data while B_DOUT provides the LSB of the read-data.

Table 16-135. Data Output Buses Used and Unused Bits
Depth x WidthA_DOUT/B_DOUT
Used BitsUnused Bits

(must be tied to 0)

16Kx1[0][19:1]
8Kx2[1:0][19:2]
4Kx4[3:0][19:4]
4Kx5[4:0][19:5]
2Kx8[8:5] is [7:4]

[3:0] is [3:0]

[19:9]

[4]

2Kx10[9:0][19:10]
1Kx16[18:15] is [15:12]

[13:10] is [11:8]

[8:5] is [7:4]

[3:0] is [3:0]

[19]

[14]

[9]

[4]

1Kx20[19:0]None
512x32 (Two-port write)A_DIN[18:15] is [31:28] A_DIN[13:10] is [27:24] A_DIN[8:5] is [23:20] A_DIN[3:0] is [19:16] B_DIN[18:15] is [15:12 B_DIN[13:10] is [11:8] B_DIN[8:5] is [7:4]

B_DIN[3:0] is [3:0]

A_DIN[19]

A_DIN[14]

A_DIN[9]

A_DIN[4]

B_DIN[19]

B_DIN[14]

B_DIN[9]

B_DIN[4]

512x40 (Two-port write)A_DOUT[19:0] is [39:20] B_DOUT[19:0] is [19:0 ]None
512x33 (Two-port ECC)A_DOUT15:0] is [32:17] B_DOUT[16:0] is [16:0 ]A_DOUT[19:16]

B_DOUT[19:17]

A_BLK_EN and B_BLK_EN

The following table lists the block-port select control signals for the two ports. A_BLK is synchronized by A_CLK while B_BLK is synchronized to B_CLK. Two-port mode is in effect when the width of at least one port is greater than 20, and A_BLK_EN controls the read operation while B_BLK_EN controls the write operation.

Table 16-136. Block-Port Select
Block-port

Select Signal

ValueResult
A_BLK_EN[2:0]111Perform read or write operation on Port A, unless the width is greater than 20 and a read is performed from both ports A and B.
A_BLK_EN[2:0]Any one bit is 0No operation in memory from Port A. Port A read-data will be forced to 0. If the width is greater than 20, the read-data from both ports A and B will be forced to 0.
B_BLK_EN[2:0]111Perform read or write operation on Port B, unless the width is greater than 20 and a write is performed to both ports A and B.
B_BLK_EN[2:0]Any one bit is 0No operation in memory from Port B. Port B read-data will be forced to 0, unless the width is greater than 20 and write operation to both ports A and B is gated.

A_WMODE and B_WMODE

In true dual-port write mode, each port has a feed-through write or read-before-write option.

  • Logic 00 = Read-data port holds the previous value.
  • Logic 01 = Feed-through, that is write-data appears on the corresponding read-data port. This setting is invalid when the width of at least one port is greater than 20 and the two-port mode is in effect.
  • Logic 10 = Read-before-write, that is previous content of the memory appears on the corresponding read-data port before it is overwritten. This setting is invalid when the width of at least one port is greater than 20 and the two-port mode is in effect.

    A_CLK and B_CLK

All signals in ports A and B are synchronous to the corresponding port clock. All address, data, block-port select, write-enable and read-enable inputs must be set up before the rising edge of the clock. The read or write operation begins with the rising edge. Two-port mode is in effect when the width of at least one port is greater than 20, and A_CLK provides the read clock while B_CLK provides the write clock.

A_REN and B_REN

Enables read operation from the memory on the corresponding port. Two-port read mode is in effect when the width of port A is greater than 20, and A_REN controls the read operation.

Read-data Pipeline Register Control Signals

A_BYPASS and B_BYPASS A_DOUT_EN and B_DOUT_EN A_DOUT_SRST_N and B_DOUT_SRST_N A_DOUT_ARST_N and B_DOUT_ARST_N

Two-port mode is in effect when the width of at least one port is greater than 20, and the A_DOUT register signals control both the MSB and LSB of the read-data, and the B_DOUT register signals are “don’t-cares”.

The following table describes the functionality of the control signals on the A_DOUT and B_DOUT pipeline registers.

Table 16-137. Truth Table for A_DOUT and B_DOUT Registers
ARST_N_BYPASS_CLK_EN_SRST_NDQn+1
0XXXXX0
10Not risingXXXQn
10?0XXQn
10?10X0
10?11DD
11XXXDD

ECC_EN and ECC_BYPASS

ECC operation is only allowed in Two-port mode and the width of both ports is greater than 20.

  • ECC_EN = 0: Disable ECC.
  • ECC_EN = 1, ECC_BYPASS= 0: Enable ECC Pipelined.
  • ECC Pipelined mode inserts an additional clock cycle to Read-data.
  • In addition, Write-feed-thru and Read-before-write modes add another clock cycle to Read- data.
  • ECC_EN = 1, ECC_BYPASS= 1: Enable ECC Non-pipelined.

    SB_CORRECT and DB_DETECT

Error detection and correction flags become available when ECC operation is enabled in Two-port mode and the width of both ports is greater than 20. The following table describes the functionality of the error detection and correction flags.

Table 16-138. Error Detection and Correction Flags
DB_DETECTSB_CORRECTFlag
00No errors have been detected.
01A single bit error has been detected and corrected in the data output.
11Multiple bit errors have been detected, but have not been corrected.

BUSY_FB

Control signal, when 1 locks the entire RAM1K20 memory from being accessed by the FCB.

ACCESS_BUSY

This output indicates that the RAM1K20 memory is being accessed by the FCB.