FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > FPGA

FPGA comp.arch.fpga newsgroup (usenet)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-28-2007, 09:55 PM
Mark McDougall
Guest
 
Posts: n/a
Default 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, <http://www.vl.com.au>
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266
Reply With Quote
  #2 (permalink)  
Old 11-28-2007, 11:13 PM
Guest
 
Posts: n/a
Default Re: Quartus memory init file

>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!?!




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 With Quote
  #3 (permalink)  
Old 11-29-2007, 12:07 AM
Mark McDougall
Guest
 
Posts: n/a
Default Re: Quartus memory init file

[email protected] wrote:

> Here is an example of a .MIF (not Intel hex) file which initialises
> 36-bit wide memory:


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, <http://www.vl.com.au>
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266
Reply With Quote
  #4 (permalink)  
Old 11-29-2007, 02:41 AM
John Rible
Guest
 
Posts: n/a
Default Re: Quartus memory init file

Mark McDougall wrote:
> [email protected] wrote:
>
>> Here is an example of a .MIF (not Intel hex) file which initialises
>> 36-bit wide memory:

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

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 <cr><lf> \ data records
: 00 0000 01 ff <cr><lf> \ 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 With Quote
  #5 (permalink)  
Old 11-29-2007, 03:41 AM
Mark McDougall
Guest
 
Posts: n/a
Default Re: Quartus memory init file

John Rible wrote:

> 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 <cr><lf> \ data records : 00 0000
> 01 ff <cr><lf> \ 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, <http://www.vl.com.au>
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Altera memory init file (.hex/.mif) generation using gcc objcopy - how to change base address?? Edmond Coté FPGA 1 03-28-2007 06:19 AM
memory init in Altera bitfiles, (like data2mem) is it possible? Antti FPGA 34 11-21-2006 09:37 PM
ISE 7.1 - block memory init value issue during simulation alpha FPGA 4 06-24-2005 05:11 PM
Using a register file/memory thomasc Verilog 1 03-21-2005 11:28 AM
READING FROM MEMORY FILE naveend Verilog 2 12-06-2004 05:42 AM


All times are GMT +1. The time now is 07:17 PM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved