Forum Discussion

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

Writing text image to SRAM

Hi all, please I need your help with this issue,

I save my image as text ( 256 * 256) gray scale, and I want to load it to SRAM before start modifying it, but I have no glue how , I meant to use VHDL with NIOS to be able to manage my image using pure VHDL.

Thank you.

8 Replies

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

    There is an option to initialize memory blocks with custom data. It should be fine if you need to modify your initial image seldom.You can create such memory initialization file with Quartus and when creating memory block guide the wizard to it.

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

    --- Quote Start ---

    There is an option to initialize memory blocks with custom data. It should be fine if you need to modify your initial image seldom.You can create such memory initialization file with Quartus and when creating memory block guide the wizard to it.

    --- Quote End ---

    Thank you for your reply Linas, do you mean the mif file ? If so , I already create it but I couldn't transfer it's contents to my SRAM DQ. Do you have any idea?

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

    It works fine here. I use MegaWizard Plug-In Manager. When creating ROM IP I just select my mif file unter Parameter Settings / Mem Init / Browse and it does the rest.

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

    --- Quote Start ---

    It works fine here. I use MegaWizard Plug-In Manager. When creating ROM IP I just select my mif file unter Parameter Settings / Mem Init / Browse and it does the rest.

    --- Quote End ---

    I got this , thanks, but my issue is how to store these data in the SRAM?

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

    Well, in this case you also need SRAM controller connected to the same bus as ROM is and then some bus master to copy all the data from ROM to SRAM. Either you write your own module to do that or use Nios.

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

    --- Quote Start ---

    Well, in this case you also need SRAM controller connected to the same bus as ROM is and then some bus master to copy all the data from ROM to SRAM. Either you write your own module to do that or use Nios.

    --- Quote End ---

    Thank you Linas for your efforts , I initialized the mif file but till now I don't get how to load M4K with mif file data.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    ??? The memory megafunction ROM/RAM has already the contents of mif file after synthesis inside. At least it should. Or it isn't your case? Then you need open a ticket at Altera's support.