sahandKashani / SoC-FPGA-Design-Guide

Tutorial for using the DE1-SoC/DE0-Nano-SoC boards for bare-metal and linux programming
The Unlicense
64 stars 17 forks source link

Communicate data between HPS and Nios using mailbox #7

Closed nuraalkhateeb closed 7 years ago

nuraalkhateeb commented 7 years ago

Hi Sahand,

I was wondering, have you used the altera avalon mailbox simple core in the past to communicate data between the HPS and Nios side?

Thanks

sahandKashani commented 7 years ago

Not between the HPS and the Nios, but only between 2 Nios processors. I'm not sure, but if I recall correctly the mailbox core does not pass data, but rather pointers. I'm not sure how it would behave if you use a HPS and a Nios processor, since the pointers would not correspond to the same address space.

nuraalkhateeb commented 7 years ago

I did see an altera powerpoint online called "Building Multi-Proccessor FPGA Systems" where they were using mmap to map the physical address of the mailbox to virtual memory.

capture

I probably have to take this approach then instead of using the altera avalon mailbox simple core.

sahandKashani commented 7 years ago

You can also just use a mutex to control access to some shared memory that both CPUs have access to.

nuraalkhateeb commented 7 years ago

Thanks Sahand. I'll look into using a mutex as well.