Quartus memory init file

Hi,

I've instantiated some quartus memory in VHDL using the init_file generic to specify an intel hex file. This works great for 8-bit wide memory.

However, I can't work out how to initialise 16- or 32-bit wide memory using this method!?!

Has anyone done it before? Any tips would be greatly appreciated!

TIA Regards,

--
Mark McDougall, Engineer
Virtual Logic Pty Ltd, 
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266
Reply to
Mark McDougall
Loading thread data ...

Here is an example of a .MIF (not Intel hex) file which initialises

36-bit wide memory:

Width = 36; Address_radix = Hex; Data_radix = Hex;

% Character shapes % Content BEGIN

0000 : 000000000; 0001 : 000000000; 0002 : 000000000; : : (bulk of this file omitted) : 01F6 : 0600C00C0; 01F7 : 380000000; 01F8 : 0000001E2; 01F9 : 37623C000; 01FA : 000000000; 01FB : 000000000; 01FC : 000000000; 01FD : 000000000; 01FE : 000000000; 01FF : 000000000; END;
Reply to
MikeShepherd564

Thanks Mike, but I want to use intel hex, not MIF, mainly because the intel hex can be used for both synthesis and simulation in ModelSim.

I think I've found the answer anyway. For now I create an 8-bit wide intel hex file, then open the hex file in Quartus and use the memory size wizard to change it to 32 bits, then re-save the file. I'm yet to confirm it produces the results I expect, but at least it builds now...

Since I use my own utility to create intel hex files in the first place, I'll simply modify it to produce the same output as Quartus...

Regards,

--
Mark McDougall, Engineer
Virtual Logic Pty Ltd, 
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266
Reply to
Mark McDougall

Mark-

I've used 8-, 16-, 24-, and 32-bit wide Intel hex files with Quartus. The general format is (spaces for readability--not in file): - -- ---- -- ~~ -- -- -- : nn addr 00 ** cs \ data records : 00 0000 01 ff \ end record - -- ---- -- ~~ -- -- -- where nn = number of data bytes in memory word addr = 16-bit memory address

00, 01 = record type ** = nn data bytes cs = 100h - (byte.sum mod 256)

The tools will complain if you don't initialize more OR less than the full memory.

-John

Reply to
John Rible

The format I've been using for 8-bit data is 16 bytes/record. I tried all sorts of permutations of that for 32-bit wide memory some time back but never got it to work. In the end I settled for 4x 8-bit memory blocks. Now it's time to fix it properly.

Using Quartus to re-size my 8-bit intel hex file did the trick. It basically spat out 1 word/line in the format you specify above.

FYI it does let you initialise *less* than the full block, as long as the word size is correct...

BTW I wish Xilinx memories were as easy to specify and initialise as Quartus... I'm porting some projects and it's a real PITA!

Thanks for your assistance! Regards,

--
Mark McDougall, Engineer
Virtual Logic Pty Ltd, 
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266
Reply to
Mark McDougall

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.