Flush instruction cache


Hello all,

I am trying to flush the I$ (instruction cache) in HiFive1 (FE310-G000) board with the function metal_icache_l1_flush(metal_cpu_get_current_hartid());. This function seems to get stuck and my program cannot continue its execution normally.

According to my understanding this instruction just flushes the I$ and my program should continue its execution normally.

I am doing something wrong, or my board just does not support this functionality?

Also according to FE310-G000 manual (chapter 3) there is only an I$ in this board and no D$. Is this correct?



Hello again,

A small update. I have observed through the gdb, that after I call the metal_icache_l1_flush(metal_cpu_get_current_hartid()) function, I end up in the early_trap_vector that used to be in freedom-metal/src/entry.S but now is in trap.S. I am trying to understand why this is happening and any bit of help will be valuable for me.