# Potential bug with how the SPI\_VVC and SPI\_BFM interact to handel mulit-worded transmissions

**URL:** <https://forum.uvvm.org/t/potential-bug-with-how-the-spi-vvc-and-spi-bfm-interact-to-handel-mulit-worded-transmissions/119>\
**Category:** Bitvis VIP SPI\
**Tags:** uvvm\
**Created:** [November 3, 2020, 5:19pm UTC](https://forum.uvvm.org/t/potential-bug-with-how-the-spi-vvc-and-spi-bfm-interact-to-handel-mulit-worded-transmissions/119 "2020-11-03T17:19:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Viljar](https://avatars.discourse-cdn.com/v4/letter/v/8dc957/32.png) [@Viljar](https://forum.uvvm.org/u/Viljar)\
**Post date:** [November 3, 2020, 5:19pm UTC](https://forum.uvvm.org/t/potential-bug-with-how-the-spi-vvc-and-spi-bfm-interact-to-handel-mulit-worded-transmissions/119/1 "2020-11-03T17:19:34Z")

</div>

Something I find strange I found when using the bitvis\_vip\_spi:

When handling multi-words (slv\_arrays) the spi\_bfm\_pkg uses a for loop that cycles 0 to [data]'length.

When handling multi-words with the vvc the input gets normalized against the shared\_vvc\_cmd.data (or data\_exp) that is defined in vvc\_cmd\_pkg as t\_slv\_array ([…] downto 0)([…] downto 0);

In other words, when using the vvc you need to order your array in a Most Significant Word downto Least Significant Word, and each word MSB downto LSB. The data that is sent is (chronological) LSW to MSW with each word MSB downto LSB.  
So if you send (“1100”,“1010”,“0010”) you chronological receive (“0010”,“1010”,“1100”).

Is this a bug, oversight or feature? I found it unintuitive, but that could be my lack the experience and/or me being weird.

---

<div class="post-metadata">

**Author:** ![Marius](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.uvvm.org/marius/32/43_2.png) [@Marius](https://forum.uvvm.org/u/Marius)\
**Post date:** [June 8, 2021, 12:54pm UTC](https://forum.uvvm.org/t/potential-bug-with-how-the-spi-vvc-and-spi-bfm-interact-to-handel-mulit-worded-transmissions/119/2 "2021-06-08T12:54:22Z")

</div>

Hi Viljar,  
Sorry for the late feedback - I will have a check to see what is happening with the SPI.

Br,  
Marius
