# The SPI\_VVCs GC\_DATA\_ARRAY\_WIDTH seemingly not determining the data array width

**URL:** <https://forum.uvvm.org/t/the-spi-vvcs-gc-data-array-width-seemingly-not-determining-the-data-array-width/129>\
**Category:** Bitvis VIP SPI\
**Tags:** uvvm, spi\
**Created:** [November 12, 2020, 1:45pm UTC](https://forum.uvvm.org/t/the-spi-vvcs-gc-data-array-width-seemingly-not-determining-the-data-array-width/129 "2020-11-12T13:45:47Z")\
**Posts on this page:** 4\
**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 12, 2020, 1:45pm UTC](https://forum.uvvm.org/t/the-spi-vvcs-gc-data-array-width-seemingly-not-determining-the-data-array-width/129/1 "2020-11-12T13:45:47Z")

</div>

Hi,

I am working with the bitvis\_vip\_spi , and is trying to send more than 8 words (each 1 byte) with the spi\_master\_transmit\_and\_receive (or the transmit\_only variant).  
The GC\_DATA\_WIDTH and GC\_DATA\_ARRAY\_WIDTH have both default values (8 and 32 respectively), which should allow me to send up to 32 words/bytes (as far as I understand). Less than 8 words works as it should.

When trying to send more than 8 words using the spi\_master \_transmit\_and\_receive I get the error messages  
`# ** Fatal: (vsim-3421) Value 8 is out of range 0 to 7.` and  
`# Fatal error in ForLoop loop at ../UVVM/bitvis_vip_spi/script/../src/spi_vvc.vhd line 356`  
When using the transmit\_only it simply cuts out after the first 8 words.

After some code digging it seems to me that the limitation originates from line 51 in transaction\_pkg.vhd:  
`constant C_VVC_CMD_MAX_WORDS : natural := 8;`

So, my question (given I have understood the code right): is there a way to circumvent this limit without changing the constant in the transaction\_pkg? I would preferable be able to use my testbench with a clean UVVM download.  
And if not, what function does the GC\_DATA\_ARRAY\_WIDTH generic have outside the potential of narrowing the maximum number of words sent to less than 8 (and actually ?

I could of course be missing something obvious and would appreciate someone pointing me in the correct direction.

Best regard,  
Viljar

---

<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:** [November 16, 2020, 1:53pm UTC](https://forum.uvvm.org/t/the-spi-vvcs-gc-data-array-width-seemingly-not-determining-the-data-array-width/129/2 "2020-11-16T13:53:29Z")

</div>

Hi Viljar,  
We will have to check if there is a good solution to this problem. The VVC depends on the transaction package, which defines the transaction info using a constant that has to de defined and used prior to reading the VVC source code. I will make a ticket so that we will have look at how to solve this, but in the meanwhile you will have to change C\_VVC\_CMD\_MAX\_WORDS to match GC\_DATA\_ARRAY\_WIDTH for things to play along.

Br,  
Marius

---

<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 17, 2020, 11:35am UTC](https://forum.uvvm.org/t/the-spi-vvcs-gc-data-array-width-seemingly-not-determining-the-data-array-width/129/3 "2020-11-17T11:35:31Z")

</div>

Then I understood it correctly. Thank you for looking into it.

Looking at the code is seems there was a slight mix-up that caused the max values for word size to be 32 in transaction\_pkg and 8 in the spi\_vvc, while the max number of words is 8 in the transaction\_pkg and 32 in the spi\_vvc.

The quickest solution would be to realign them, but I would recommend increasing the max value set in the transaction\_pkg to at least the double (16 for word length and 64 for number of words) as would allow more flexible use without requiring the user to change the bitvis\_vip\_spi code.

An alternative approach would be to try using generic packages to chain the generic values set in the spi\_vvc upstream (So each package has generics that give values to the generics of the packages they are using). I can however think of several ways this could fail, so I am by no means certain it would even compile. It would also deviate slightly from the current UVVM structure, so there is that.

Anyway, I wish you good luck figuring out a good solution.

Br,  
Viljar

---

<div class="post-metadata">

**Author:** ![MarkusPfaff](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.uvvm.org/markuspfaff/32/64_2.png) [@MarkusPfaff](https://forum.uvvm.org/u/MarkusPfaff)\
**Post date:** [August 26, 2021, 2:00pm UTC](https://forum.uvvm.org/t/the-spi-vvcs-gc-data-array-width-seemingly-not-determining-the-data-array-width/129/4 "2021-08-26T14:00:40Z")

</div>

Hi,

same problem here. I’m using SPI with packages up to 212 bytes long in a project currently. I guess that the default value of 32 in the adaptions\_pkg.vhd is rather short in many cases. Perhaps you could change that constant C\_SPI\_VVC\_DATA\_ARRAY\_WIDTH to 256 for default?

Regards  
Markus
