Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12747 Discussions

simulating altsyncram with .hex file

Altera_Forum
Honored Contributor II
1,228 Views

I just started to use the feature of the altsyncram megafunction to initialize its content out of a hex file. This is a fine thing, but during debugging with modelsim i found an error in altera_mf.vhd. While reading the .hex file, the address offset if calculated the wrong way, as the databus-width of the ram is ignored. So when ram is used with an other width than 8 bit - there is an error at the initialization and the hex file won't load successfully. 

 

To correct this - open altera_mf.vhd (which is located at ../quartus/eda/sim_lib/) - scroll to line# 22857 and replace 

 

m_istartadd := HEX_STR_TO_INT(m_startadd); 

with  

 

if (use_a) then    m_istartadd := HEX_STR_TO_INT(m_startadd) / (width_a/8); else    m_istartadd := HEX_STR_TO_INT(m_startadd) / (width_b/8); end if; 

 

 

I know this is more a quartus thing and this is a nios forum - but  

- i dont know where else to post it 

- someone from altera could read it and pass it to a responsible person to fix it in the next release of quartus 

 

- someday it could be usefull to YOU !! 

 

have fun 

stonie
0 Kudos
0 Replies
Reply