Forum Discussion

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

Inferring a ROM

Has anyone used a HEX (Intel format) file to infer a ROM? I'd like to build a look-up table for waveform generation using a 32768 x 16 ROM and would prefer not to type in all of the values manually.

Is there a better way to do this?

Thanks,

Brian

12 Replies

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

    Thanks for your reply. Its a quarter wavelength sinusiod. Currently I'm using MATLAB to output a file with the appropriate VHDL formatting.

    I did use Quartus' genmem command, but I'd rather write my own model and have Quartus infer the ROM.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    What's the nature of the values being stored by the ROM? Are they random or do they fall naturally from some simple formula? You can always write a script to save you the typing. I avoid using MIF/HEX files unless I need to update my memory contents without recompiling the design. Instead, I describe the RAM and initial contents purely in HDL. Quartus II will infer initial contents from the HDL source, e.g.

    
    signal rom : my_rom_t := initialize_rom();
    

    Look at the Verilog and VHDL templates in the Quartus II GUI for more examples.