# UVVM VVC Creation from BFMs

**URL:** <https://forum.uvvm.org/t/uvvm-vvc-creation-from-bfms/237>\
**Category:** VVC Framework\
**Created:** [November 1, 2021, 7:28pm UTC](https://forum.uvvm.org/t/uvvm-vvc-creation-from-bfms/237 "2021-11-01T19:28:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bdecelles](https://avatars.discourse-cdn.com/v4/letter/b/e9bcb4/32.png) [@bdecelles](https://forum.uvvm.org/u/bdecelles)\
**Post date:** [November 1, 2021, 7:28pm UTC](https://forum.uvvm.org/t/uvvm-vvc-creation-from-bfms/237/1 "2021-11-01T19:28:55Z")

</div>

First off Thank for creating the UVVM Lib. It was selected and used on the current project for creatin 20+ BFMs for multiple busses based on UVVM Util. On the next project we may use the VVC Framework. I am looking for some guidance or confirmation.

All of the VIP have a GEN and BFM package. The BFM is based on UVVM the GEN creates an array of data that is specific to the Bus stimulus or response. I believe that is the GEN can be added to the VVC and this would be the cleanest approach. Here is and an example of our Ethernet GEN and BFM. The ETH BFM can be configured for multiple standards (MII,RMII,GMII,RGMII).

The ETH GEN configures for multiple packets.  
type t\_eth\_pkg is ( S\_ETH\_PKT,  
S\_IPV4\_PKT,  
S\_IPV6\_PKT,  
S\_UDP\_PKT,  
S\_TS\_PKT,  
S\_DRN\_PKT,  
S\_SERI\_PKT,  
S\_VRT\_PKT  
);

type t\_eth\_gen\_config is  
record  
eth\_config : t\_eth\_config;  
eth\_header\_config : t\_eth\_header\_config;  
eth\_trailer\_config : t\_eth\_trailer\_config;  
ip\_config : t\_ip\_config;  
ipv4\_header\_config : t\_ipv4\_header\_config;

–GEN  
eth\_gen\_1.eth\_gen\_pkt ( eth\_pkt =\> eth\_pkt,  
data\_value =\> GEN\_DATA\_VALUE,  
gen\_eth\_pkt =\> GEN\_DATA,  
gen\_eth\_pkt\_len =\> gen\_eth\_pkt\_len,  
config\_com =\> eth\_com\_config,  
config\_gen =\> eth\_gen\_config  
);  
–BFM  
eth\_bfm\_1.eth\_master\_transmit(data\_value =\> GEN\_DATA(0 to gen\_eth\_pkt\_len-1),  
eth\_tx\_if =\> eth\_tx\_if\_1,  
config =\> eth\_bfm\_1\_config);

So I thinking that I will need to pass in some info on the GEN config to the vcc\_methods\_pkg  
procedure eth\_master\_transmit(  
signal VVCT : inout t\_vvc\_target\_record;  
constant vvc\_instance\_idx : in integer;  
constant channel : in t\_channel;  
constant eth\_pkt : in t\_eth\_pkt; --NEW  
constant data\_array : in t\_byte\_array;  
constant msg : in string;  
constant scope : in string := C\_VVC\_CMD\_SCOPE\_DEFAULT;  
constant parent\_msg\_id\_panel : in t\_msg\_id\_panel := C\_UNUSED\_MSG\_ID\_PANEL;  
constant config\_com : in t\_gen\_config := C\_GEN\_CONFIG\_DEFAULT; --NEW -need to pass to executer  
constant config\_eth\_gen : in t\_eth\_gen\_config := C\_ETH\_GEN\_CONFIG\_DEFAULT; --NEW -need to pass to executer  
) is

and then use the info and the GEN and BFM in the eth\_tx\_vcc.vhd  
case v\_cmd.operation is – Only operations in the dedicated record are relevant  
– VVC dedicated operations  
–===================================  
when MASTER\_TRANSMIT =\>  
– Set transaction info  
set\_global\_vvc\_transaction\_info(vvc\_transaction\_info\_trigger, vvc\_transaction\_info, v\_cmd, vvc\_config);

```
     -- Call the corresponding procedure in the GEN package --NEW
     eth_gen_pkt(eth_pkt => v_cmd.eth_pkt,
                 data_value => v_cmd.data_array(0 to v_cmd.data_array_length-1),
                 gen_eth_pkt => v_gen_eth_pkt, --NEW
                 gen_eth_pkt_len => v_gen_eth_pkt_len, --NEW
                 config_com => v_cmd.config_com,
                 config_gen => v_cmd.config_eth_gen
                 );

     -- Call the corresponding procedure in the BFM package.
     eth_master_transmit( data_array => v_gen_eth_pkt(0 to v_gen_eth_pkt_len-1),                 
                          gmii_tx_if => gmii_vvc_tx_if,
                          msg => format_msg(v_cmd),
                          scope => C_SCOPE,
                          msg_id_panel => v_msg_id_panel,     
                          config => vvc_config.bfm_config
                          );
```

---

<div class="post-metadata">

**Author:** ![Eric](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@Eric](https://forum.uvvm.org/u/Eric)\
**Post date:** [November 3, 2021, 3:02pm UTC](https://forum.uvvm.org/t/uvvm-vvc-creation-from-bfms/237/2 "2021-11-03T15:02:48Z")

</div>

Hi bdecelles,

Not sure actually what your question is, I assume some guidance.

Take a look at

- [Tutorial: Create your own VVC for UVVM - QUE](http://que.no/index.php/2017/07/03/uvvm-tutorial/)
- [Tutorial: Creating a custom VVC for UVVM](https://www.linkedin.com/pulse/tutorial-creating-custom-vvc-uvvm-rune-b%C3%A6verrud/?articleId=6275423012686749696)

Rune Baeverrud has made this example which might give you some guidance

HTH  
Rgds,  
Eric

---

<div class="post-metadata">

**Author:** ![bdecelles](https://avatars.discourse-cdn.com/v4/letter/b/e9bcb4/32.png) [@bdecelles](https://forum.uvvm.org/u/bdecelles)\
**Post date:** [November 3, 2021, 3:32pm UTC](https://forum.uvvm.org/t/uvvm-vvc-creation-from-bfms/237/3 "2021-11-03T15:32:35Z")

</div>

Hi so to be specific. I have a procedure that creates/generates the data array used by the BFM called GEN.

Q1- should I place this GEN in the VVC right before the BFM?

Q2 - the GEN required a two config to map the data confg\_com and config\_gen. Should I add these as inputs if the vvc\_method\_pkg procedure call?

Q3 - In the vcc\_method\_pkg procedure eth\_master\_transimit should I make config\_com and config\_gen part of the v\_cmd as v\_cmd.config\_com and v\_cmd.config\_gen and then use v\_cmd in the VVC?

I think this should work but is there some other approach I should be considering? Thanks.
