Altera_Forum
Honored Contributor
16 years agoRead/Write Access in Nios II
Hi There,
I'm running a Nios II-based system that is made of the following : - A 32_bit Nios II CPU (Standard version) - An On-chip Mem - An EPCS controller - A JTAG_uart - A timer - A custom SOPC component# 1 - A custom SOPC component# 2 Here is the address mapping : 0x00231800 - 0x00231fff0x00220000 - 0x00229fff0x00231000 - 0x002317ff0x00232020 - 0x002320270x00232000 - 0x0023201f0x00200000 - 0x0020ffff0x00100000 - 0x001fffff My C-code in Nios II IDE is very simple.
int
main ()
{
st_AHW_ahw* ahw_ptr = NULL;
printf("Hello from Nios II!\n");
//Appel à la fonction Ecriiture
code_error = AHW_Write_access (ahw_ptr,0x00100008, 0x0, 0xDECABABE);
code_error = AHW_Read_access (ahw_ptr,0x00100008, 0x0);
code_error = AHW_Write_access (ahw_ptr,0x00200006, 0x0, 0xBEEFBABE);
return
0;
} It is basically 3 accesses that target my two customs components with C-functions of my own. My question is related to the ModelSim simulation of this piece of code. I observe theses accesses on my waveform file at very random time when simulating, the first one happens at 2.9ms, the second one at 3.5 ms and the last one at 6.0ms. And in between I see a lot of memory accesses on the Nios II... how can I predict the moment when my R/W accesses will be processed? Thank you very much!