Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17268 Discussions

understanding Hex file creation

UserID4331231
New Contributor I
1,305 Views

In my FPGA project I have couple of memory which I plan on using as Configuration memory and general purpose memory. In Platform designer I made my project and I intend to assign them some initial values using "hex" files.  While creating a new hex file using quartus , it asks two questions 

  • word size ?
  • number of words.?

Can you help me how to choose these parameters for give memory size?

My memories are lets say 1KBytes and 1MBytes.

for 1KB memory, I want to initialize this memory with 64bit / 8 byte signed integer values, Starting from AAAA_BBBB_CCCC_0000 to AAAA_BBBB_CCCC_007F.  (128 long int x 8 =1024 bytes)

Once I move past selecting word size and number of words, I can right click and choose "custom fill cells" to auto fill my memory with desired pattern. However I believe due to mis configuration in word size and number of words its not taking AAAA_BBBB_CCCC_0000 as valid input. I chose some small values and moved on, now during synthesis I got warning code 23413 and 23414 indicating "Memory depth (**bleep**) in the design file differs from memory depth (yyy) in the Memory Initialization File. Path/intel_onchip_memory_1410/synth/d2h_mem.hex" -- setting initial value for remaining addresses to 0."

this means I am not creating hex file properly and cant assign them exact pattern I want to.

 

furthermore, what if my desired patterns are random and offset specific. for example, initial configuration status of a custom IP? my config space is large and manually editing values in quartus gui is not practical. Is there any python or C example which can show how to generate hex file with desired values for each offset?  I have csv file which has offset,value  listed for entire configuration space.

 

please 

 

 

0 Kudos
6 Replies
sstrell
Honored Contributor III
1,248 Views

It's not clear what you ended up choosing for word size and number of words.  Are you saying you set the word size to 64 and the number of words to 128?

Word size is in bits.

0 Kudos
UserID4331231
New Contributor I
1,213 Views

for 1K memory - I chose 64 as word size and 128 as word count.

for 1M memory - i chose 64 as word size and 131072 as word count.

i critical warning i got is this - Critical Warning(23414): Memory depth (262144) in the design file differs from memory depth (131073) in the Memory Initialization File "/user/path_to_project/ip/pcie_ed/pcie_ed_intel_onchip_memory_0/intel_onchip_memory_1410/synth/d2h_mem.hex" -- setting initial value for remaining addresses to 0

 

this warning means I am not making Hex file correctly. so my question is how do i do it correctly?

 

0 Kudos
sstrell
Honored Contributor III
1,208 Views

No it means there's a mismatch between the RAM(s) you've created and the .hex files.  How did you create the RAM?  As IP or through HDL inference?  What options did you choose?

0 Kudos
UserID4331231
New Contributor I
1,200 Views
  1. In platform designer - in IP catalog -  i chose "On chip memory II (RAM or ROM) IP". I entered  S1 port width, and entered size of memory in decimal (1024 for 1K instance and 1048756 for 1M instance). I chose hex file  i wanted to chose for initialization.
  2. Once entire project is made in platform designer I click on generate HDL , closed platform designer and synthesised project in quartus.

 

the Hex file was created with quartus gui

  1. I clicked on files - and in new file wizard chose "hexadecimal (intel-format) file".
  2. Gui asks for word size and number of words. I chose values as described above. I select cell - right click and chose "Custom Fill Cells". I chose options to get desired auto incrementing pattern.

 

0 Kudos
ShengN_Intel
Employee
520 Views

Hi,

 

Sorry for delay reply,

 

Since 64 bits equal to 8 bytes, the word size you need to put 8.

 

Thanks,

Regards,

Sheng

 

0 Kudos
ShengN_Intel
Employee
383 Views

Hi,


May I know if any further concern?


Does the problem being resolved?


Thanks,

Regards,

Sheng


0 Kudos
Reply