The mailbox features can be used for both input and output, and would need to
be specified for all s_axilite I/Os of a kernel. It is
enabled with a global option for the interfaces using the Vitis HLS
config_interface command:
config_interface -s_axilite_mailbox both
config_interface -s_axilite_auto_restart_counter 1
After setting up the config_interface
option, the mailbox implements a pair of registers called HW
copy and SW copy. The input mailbox and
output mailbox has an independent pair of registers as shown in the below figure.
Communication with the kernel includes:
- Input Mailbox
-
- The host application writes some or all elements to the
SW copyregister of the mailbox. - The host application notifies the mailbox that
SW copyis updated. - When the hardware kernel restarts, the
SW copyregister is copied to theHW copyregister. - The host application is notified that the
HW copyhas been updated, and can change theSW copyregister again as needed.Tip: Multiple reads by the hardware kernel can occur without an update from the host application.
- The host application writes some or all elements to the
- Output Mailbox
-
- The host application notifies the mailbox that it wants
to read an updated copy of the mailbox. The hardware writes some or all
the elements to the
HW copyregister of the mailbox at the end of the current kernel execution. - When the kernel is done,
HW copyis copied to theSW copyregister. - The host application is notified that
SW copyis updated and can read it at any time.Tip: Multiple writes by the hardware can occur without any software request to update.
- The host application notifies the mailbox that it wants
to read an updated copy of the mailbox. The hardware writes some or all
the elements to the