- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Helhlo everyone,
I am trying to implement a ROM with a slightly different behavior than the LPM_ROM from Altera. It should also have a memory initialization file. I have huge problems getting it to work. None of the textio functions are being executed by Quartus. Is there any way in Quartus to read a memory initialization file in a user-created entity?- Balises:
- Intel® Quartus® Prime Software
Lien copié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
You can have a look at this document (http://www.altera.com/literature/hb/qts/qts_qii51007.pdf), on pages 14-33 and over. It looks like there is a way to read an initialization file in Verilog, but not in VHDL. You'll probably have to write the whole contents as an VHDL array, as described on example 14-30.
(as a sidenote, srecord (http://srecord.sourceforge.net/) is a tool that can convert from and to lots of different EEPROM formats, and it can generate a VHDL table for you from a .hex or .mif file)- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
In what way do you want different behaviour? If you do things that LPM rom cannot then you run the risk of not inferring ram blocks.
It is very annoying that you cannot use textio to initialise a memory (Xilinx will). Raise a support request with Altera and maybe one day they'll implement it. Any chance you could use a initialisation function to generate the values? You can also use the "ram_init_file" synthesis attribute to get the memory contents, while also using textio to initialise the ram for simulation: http://quartushelp.altera.com/11.1/mergedprojects/hdl/vhdl/vhdl_file_dir_ram_init.htm- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
--- Quote Start --- Helhlo everyone, I am trying to implement a ROM with a slightly different behavior than the LPM_ROM from Altera. It should also have a memory initialization file. I have huge problems getting it to work. None of the textio functions are being executed by Quartus. Is there any way in Quartus to read a memory initialization file in a user-created entity? --- Quote End --- It works, thank you so much. I couldn't figure it out for the life of me.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
The following code works in Quartus and simulates correctly. I will download it to a DE1 board tmorrow to see if it works on the hardware.
module rom_verilog_mif ( input [3:0] addr_a, input clk, output reg [7:0] q_a ); reg [7:0] rom[0:15]; initial begin $readmemh("memory.mif", rom); end always @ (posedge clk) begin q_a <= rom[addr_a]; end endmodule- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Your code looks like a normal LPM rom to me - what is different?
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
--- Quote Start --- Your code looks like a normal LPM rom to me - what is different? --- Quote End --- Oh, this was just a test, now I can implement what I need - a triple port rom BTW.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
A triple port rom will not map to the ram on the chip, so it will have to generate it from logic, probably take a long time to synthesis and take a hiddeous amount of logic.
WHy not just use a dual port and single port rom using the same mif file?- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
--- Quote Start --- A triple port rom will not map to the ram on the chip, so it will have to generate it from logic, probably take a long time to synthesis and take a hiddeous amount of logic. WHy not just use a dual port and single port rom using the same mif file? --- Quote End --- Oh, havent though of that. good idea. Thank you very much.

- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable