# SPI BFM error run time in sample code

**URL:** <https://forum.uvvm.org/t/spi-bfm-error-run-time-in-sample-code/408>\
**Category:** Bitvis VIP SPI\
**Tags:** uvvm, spi\
**Created:** [December 1, 2023, 12:56pm UTC](https://forum.uvvm.org/t/spi-bfm-error-run-time-in-sample-code/408 "2023-12-01T12:56:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oruizd](https://avatars.discourse-cdn.com/v4/letter/o/5daacb/32.png) [@oruizd](https://forum.uvvm.org/u/oruizd)\
**Post date:** [December 1, 2023, 12:56pm UTC](https://forum.uvvm.org/t/spi-bfm-error-run-time-in-sample-code/408/1 "2023-12-01T12:56:29Z")

</div>

Hi everyone,

I’m working with **SPI BFM** on **GHDL** and I had a run time error with the UVVM\_SUPLEMETARY sample code (spi\_vvc\_tb.vhd):

UVVM-master/bitvis\_vip\_scoreboard/src/generic\_sb\_pkg.vhd:546:14:error: type of variable “vr\_sb\_queue” referenced before its elaboration  
variable vr\_sb\_queue : sb\_queue\_pkg.t\_generic\_queue;

**Compilation in GHDL:**

ghdl -a --work=bitvis\_vip\_spi --std=08 -frelaxed -fsynopsys spi\_common\_pkg.vhd  
ghdl -a --work=bitvis\_vip\_spi --std=08 -frelaxed -fsynopsys spi\_master.vhd  
ghdl -a --work=bitvis\_vip\_spi --std=08 -frelaxed -fsynopsys spi\_slave.vhd  
ghdl -a --work=bitvis\_vip\_spi --std=08 -frelaxed -fsynopsys spi\_pif.vhd  
ghdl -a --work=bitvis\_vip\_spi --std=08 -frelaxed -fsynopsys spi\_vvc\_tb.vhd  
ghdl -e --work=bitvis\_vip\_spi --std=08 -frelaxed -fsynopsys spi\_vvc\_tb  
ghdl -r --work=bitvis\_vip\_spi --std=08 -frelaxed -fsynopsys spi\_vvc\_tb --vcd=GTK\_spi\_vvc\_tb.vcd

It seems that the error comes from line 126 of the vvc\_methods\_pkg.vhd file.

 ![vvc_methods_pkg](https://europe1.discourse-cdn.com/flex017/uploads/uvvm/original/1X/f4646f2f262a65d57416831b68e6f87418fc8f0b.png)

Best regard,  
Thanks.

Oscar.

---

<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:** [December 2, 2023, 9:50pm UTC](https://forum.uvvm.org/t/spi-bfm-error-run-time-in-sample-code/408/2 "2023-12-02T21:50:40Z")

</div>

Hi,  
We have made a fix that will be released soon.  
You can move the declaration of the scoreboard package from vvc\_methods\_pkg.vhd to transaction\_pkg.vhd and you should be able to run.

Br,  
UVVM team

---

<div class="post-metadata">

**Author:** ![Jacinto](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@Jacinto](https://forum.uvvm.org/u/Jacinto)\
**Post date:** [December 11, 2023, 2:40pm UTC](https://forum.uvvm.org/t/spi-bfm-error-run-time-in-sample-code/408/3 "2023-12-11T14:40:11Z")

</div>

I’ve got the same bug on Ethernet examples from bitvis\_vip\_ethernet, I suppose the same solution can be applied do you ??

---

<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:** [February 11, 2024, 7:10pm UTC](https://forum.uvvm.org/t/spi-bfm-error-run-time-in-sample-code/408/4 "2024-02-11T19:10:22Z")

</div>

Hi,  
Yes, I belive you will have to make the same changes.

Br,  
Marius
