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
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.
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
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.