4
\$\begingroup\$

Background

I am using a Xilinx FPGA from the Kintek-7 family. The documentation for the memory resources can be found here.

Here are some important excerpts from the document (referencing pages 11 and 12):

The block RAM in Xilinx® 7 series FPGAs stores up to 36 Kbits of data and can be configured as either two independent 18 Kb RAMs, or one 36 Kb RAM. Each 36 Kb block RAM can be configured as a 64K x 1 (when cascaded with an adjacent 36 Kb block RAM), 32K x 1, 16K x 2, 8K x 4, 4K x 9, 2K x 18, 1K x 36, or 512 x 72 in simple dual-port mode. Each 18 Kb block RAM can be configured as a 16K x 1, 8K x 2, 4K x 4, 2K x 9, 1K x 18 or 512 x 36 in simple dual-port mode.

and

Each 36Kb block RAM can be set to simple dual-port (SDP) mode, doubling data width of the block RAM to 72 bits. The 18Kb block RAM can also be set to simple dual-port mode, doubling data width to 36 bits. Simple dual-port mode is defined as having one read-only port and one write-only port with independent clocks.

From this, I interpret that the data width of the BRAM is in multiples of 18. So it is 36 with dual port, or it could be 72 if you double that.

Question

In my implementation I only need a data width of 64 bits. What happens to this extra 8 bits? Does it mean that I will not be utilizing the entire BRAM block?

Here is a graphic to help understand the way that I'm thinking:

enter image description here

\$\endgroup\$
  • 1
    \$\begingroup\$ Sometimes it's possible for multiple narrow RAM blocks to share the same BRAM, but that depends on the optimizations chosen in fitting the synthesized design in the device. \$\endgroup\$ – user2943160 Jul 7 '16 at 14:10
6
\$\begingroup\$

Correct, the remaining bits are unused.

This is something you just have to accept in FPGAs, you are never going to use all of the resources. It's the price you pay for configurability.

On the plus side, if at a later date you decide to add something like parity information or just make the data bus a little wider, you can do that essentially for free as there is space to add 8 more bits of width using the same memory.

\$\endgroup\$
5
\$\begingroup\$

In addition to Tom's answer:

BlockRAMs have one additional (mostly called parity) bit per byte giving you:

  • 9(8+1),
  • 18(16+2),
  • 36(32+4),
  • 72(64+8) bits.

These bits can be used for simple parity algorithms to "secure" your data. Or you can implement ECC. You can also store meta information like Valid, StartOfFrame/EndOfFrame in these additional bits. BlockRAMs are also often a source for constants (ROM) in DSP algorithms. Most constants are not a power of two in size, so additional bits can be handy at some places.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.