Forum Discussion

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

use mif file to initialize mem

Are there any tutorial about how to create a mif file via file->new->mif from the tool bar? For example, If I need to initialize RAM/ROM with

addr value

0 00

1 01

2 11

3 10

how should I choose the number of words and word size and fill in numbers? Thanks.

3 Replies

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

    a mif is just a text file, you can create it with any editor you like.

    As for the file format, if you go into the Quartus help menu, click search and type "mif", the first result is a description of the format, with an example.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    lpm_ram_dq is used to create a RAM. Is there a similar way to create a ROM?

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

    I don't know if there is a LPM ROM primitive, but if you just use the RAM primitive and connect the write signal to always 0, you get a ROM.