Forum Discussion

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

Inefficient M9K RAM usage with FPOINT

Hi Folks-

I'm using Cyclone III with NIOS2 and I need to include the Altera FPOINT custom instruction. My part has 66 M9K blocks. The RAM usage summary reports that FPOINT uses a total of 1084 bits in a total of 14 logic modules with an average of about 80 bits per module. That means 14 M9Ks are being allocated with extremely poor usage efficiency (80/8192 or about 1%). With such inefficient usage, quite a bit of my RAM goes unused and I'd love to have it available for NIOS embedded code.

Can anyone suggest any strategies to improve my RAM usage efficiency?

Thanks, Joh Speth

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    a memory block M9K can not be splitted

    if your function uses only "N" bits out of total "M" bits a M9K block has, then the difference is lost or unuseable.

    have a look here

    memory blocks in the cyclone iii device family (http://www.altera.com/literature/hb/cyc3/cyc3_ciii51004.pdf)

    On page 2 you will see the possible M9K configurations.

    example, lets have a single M9K block setup as 512 x 10 bits out of total possible 512 x 18 this M9K block has. this means 512 x 8 bits are not used and you can not generate something else with these bits and bytes.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Actually, since each M9K is dual ported, it can often be split into 2 - provided each user only wants a single port.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Actually, since each M9K is dual ported, it can often be split into 2 - provided each user only wants a single port.

    --- Quote End ---

    Assuming you dont mind sharing the same memory.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    My most excellent Altera FAE from Arrow solved the problem. Here are his instructions:

    "I put together a little design to replicate what you are seeing, and I was able to reduce the FPOINT M9K usage from 15 to 2 by changing the following setting:

    Auto RAM to Logic Cell Conversion = On

    To change this, go to

    Assignments - Settings - Analysis & Synthesis Settings,

    click the More Settings button, and scroll down to the Auto Ram to Logic Cell Conversion setting."

    I tried it and it works! You pay the price in extra LEs but the tradeoff was acceptable to me. Reviewing the RAM usage summary leads me to conclude that there is a threshold at which the build tools will decide if block RAM or LEs will be used.

    I wonder what that threshold is. I wonder if the threshold is configurable.

    Thanks for the comments, John Speth