Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

How to increase Nios II/s CPU Data Cache

Dear Friends,

my nios CPU had instruction cache is 4k byte (default)and data cache is 2k byte(default).

I had read data through Ethernet using UDP and my packet size is 1024,

as i put my recvfrom command with in a do...while loop so what it does , it just read the few data from first packet (probably its data cache is full) and then come to second read, but then halt at recvfrom.

i have reduce the size of data packet from 1024 to 100 then it start read multiple packet and never halt at recvfrom but the amount of read data in both case is same and it never read data from recvfrom once it read data equal to earlier one (in case of packet size 1024).

i thing this happen due to lesser amount of data cache in nios CPU unfortunately i am using Quartus 9.1 web version so the data cache tab is disabled and i am not in condition to increase it,

can we clear the data cache after each read...?

can we increase the size of data cache any how..?

Or this problem is not related to Data cache...?

please suggest me how to sort out this problem...?

kaushal

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    you can flush the data cache whenever you want / need too.

    have a look at the HAL file alt_cache.h

    you can increase the cache when you open your quartus project, open the sopc builder and modify the nios cpu core then re-generate the sopc and recompile the fpga. you could also change the nios-s to nios-f if you want at the same time.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    increasing cache size won't solve problem....still amount of received data is limited....

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    BY using "Zero Copying" API ....sortedout my problem now i am ablew to read complete file over Ethernet.