Mi-V-Soft-RISC-V / miv-rv32-bare-metal-examples

5 stars 2 forks source link

This seems very very wrong #2

Open duaneellissd opened 1 year ago

duaneellissd commented 1 year ago

https://github.com/Mi-V-Soft-RISC-V/miv-rv32-bare-metal-examples/blob/main/driver-examples/miv-plic/miv-rv32-plic/src/platform/drivers/fpga_ip/miv_plic/miv_plic.h#L303

Specificlally this loop will write at offset +0 for a 32bit value. Then when INC=1, it will write at offset +1 for a 32bit value

But this is no aligned so you get an alignement fault. So how does this work? Confused..

Also - why is this code calculating an address But other places have/use a structure that overlays the MIV_PLIC?

duaneellissd commented 1 year ago

Also - why does the loop use (N + 32) / 32 - should this not use (N+31)/32 instead?