dabelknap/VMEStream — pull request #2 by ekfriis (2013-08-20 12:01:12+00:00)
Title: Add tests of data exchange functionality

Hi Austin,

Here are some additional (failing) tests which I think should exercise the protocol. I wrote this quickly so please be advised that I may have gotten something wrong and don't take it as gospel. Here is the data exchange protocol description again for posterity.

> 2 registers
> MASTER_2_SLAVE_SIZE, SLAVE_2_MASTER_SIZE
> 2 RAMs
> MASTER_2_SLAVE_DATA, SLAVE_2_MASTER_DATA
>
> When master wants to send N bytes of data to slave, it does the following:
>
> 1) single check if MASTER_2_SLAVE_SIZE == 0. If != 0, there is still unread data, repeat #1.
> 2) copy N bytes via VME block write to MASTER_2_SLAVE_DATA
> 3) set MASTER_2_SLAVE_SIZE = N
>
> Slave loops, checking for MASTER_2_SLAVE_SIZE > 0. If so, it reads out MASTER_2_SLAVE_SIZE (N) bytes > from MASTER_2_SLAVE_DATA. When complete, it sets MASTER_2_SLAVE_SIZE back to 0.
>
> When the slave wants to send data to the master, it works analogously but with the other register/RAM.

Let me know if this doesn't make sense!

Evan