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++
12745 Discussions

Missing writes on Custom board

Altera_Forum
Honored Contributor II
1,571 Views

I have an interesting problem. I have designed a NIOS system that I have implemented onto a custom boad. I have written a simple frimware program to check parts of the system. When I execute the firmware using the debug download of the IDE I get all the expected writes. However when I execute the firmware using the "run" download a lot of the writes are missed. I thought this may be related to some sort of configuration of the IDE. However when I downloaded my code to the EPCS and ran from there on a reset I got the same results !? 

I found this bug both when writing to my Dual Port Ram (via a custom component) and also my Logic Interface (via a custom component)!  

 

Does anyone has any suggestion ?
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
800 Views

 

--- Quote Start ---  

originally posted by shmueld@May 16 2006, 05:10 PM 

i have an interesting problem. i have designed a nios system that i have implemented onto a custom boad. i have written a simple frimware program to check parts of the system. when i execute the firmware using the debug download of the ide i get all the expected writes. however when i execute the firmware using the "run" download a lot of the writes are missed. i thought this may be related to some sort of configuration of the ide. however when i downloaded my code to the epcs and ran from there on a reset i got the same results !? 

i found this bug both when writing to my dual port ram (via a custom component) and also my logic interface (via a custom component)!  

 

does anyone has any suggestion ? 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=15408) 

--- quote end ---  

 

--- Quote End ---  

 

 

Try to use a NIOS without caches - if it then works you should check your hardware access commands (always use IO commands to access hardware and not C pointers).
0 Kudos
Altera_Forum
Honored Contributor II
800 Views

Try to use a NIOS without caches - if it then works you should check your hardware access commands (always use IO commands to access hardware and not C pointers). 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=15424)</div> 

 

--- Quote End ---  

 

 

Dear stonie, 

Thanks for your reply. I am not a software guy, so could you please explain to me what you mean by : "always use IO commands to access hardware and not C pointers" and why this should make a difference when running the code on my custom hardware directly compared to debug mode (which doesn&#39;t work properly)?
0 Kudos
Altera_Forum
Honored Contributor II
800 Views

Are you using -O2 or -O3 in the run configuration? there may be some optimizations done by the compiler that removes some "unuseful" writes to memory.... did you declared your data as "volatile"? 

 

Paolo
0 Kudos
Altera_Forum
Honored Contributor II
800 Views

Another Interesting result:- 

 

When I was carrying out single writes to my cusotmized NIOS logic Interface component, after every write I found that reads of every single address in the range of the interface was being done. With further investigation I found that these reads were even being done during the initialization of the pointers - (yes we are using pointers - I have requested from the software enginner to look into changing this and use "IO commands to access hardware " - although we are not yet sure what these are !) !  

 

Does Anyone have any further suggestions ?  

 

Note I have also requested from the Software Engineer to try to bypass the cache - it is all done through the softeware right ?
0 Kudos
Altera_Forum
Honored Contributor II
800 Views

 

--- Quote Start ---  

originally posted by shmueld@May 16 2006, 08:10 AM 

i have an interesting problem. i have designed a nios system that i have implemented onto a custom boad. i have written a simple frimware program to check parts of the system. when i execute the firmware using the debug download of the ide i get all the expected writes. however when i execute the firmware using the "run" download a lot of the writes are missed. i thought this may be related to some sort of configuration of the ide. however when i downloaded my code to the epcs and ran from there on a reset i got the same results !? 

i found this bug both when writing to my dual port ram (via a custom component) and also my logic interface (via a custom component)!  

 

does anyone has any suggestion ? 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=15408) 

--- quote end ---  

 

--- Quote End ---  

 

 

Read through the Nios II Software User&#39;s Guide. All of your answers/options are clearly stated there. 

 

- slacker
0 Kudos
Altera_Forum
Honored Contributor II
800 Views

"IO commands" = IORD and IOWR

0 Kudos
Reply