# Can you randomize the AXI-stream VALID and READY

**URL:** <https://forum.uvvm.org/t/can-you-randomize-the-axi-stream-valid-and-ready/255>\
**Category:** Bitvis VIP AXI-Stream\
**Created:** [December 16, 2021, 4:35pm UTC](https://forum.uvvm.org/t/can-you-randomize-the-axi-stream-valid-and-ready/255 "2021-12-16T16:35:30Z")\
**Posts on this page:** 6\
**Page:** 1

<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:** [December 16, 2021, 4:35pm UTC](https://forum.uvvm.org/t/can-you-randomize-the-axi-stream-valid-and-ready/255/1 "2021-12-16T16:35:30Z")

</div>

Hi,

Is it possible to randomize the VALID (in case of a master VVC) signal?  
And the same for the READY (in case of a slave VVC) signal?

Rgds,  
Eric

---

<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:** [December 24, 2021, 12:49pm UTC](https://forum.uvvm.org/t/can-you-randomize-the-axi-stream-valid-and-ready/255/2 "2021-12-24T12:49:13Z")

</div>

I found in the axistream bfm documenation on page 3 the values what seems for randomization

```auto
valid_low_at_word_num
valid_low_multiple_random_prob
valid_low_duration
valid_low_max_random_duration

```

and

```auto
ready_low_at_word_num
ready_low_multiple_random_prob
ready_low_duration
ready_low_max_random_duration
ready_default_value

```

But whatever I fill in for the  
`ready_low_multiple_random_prob` or `valid_low_multiple_random_prob`

it always stays high.

Only the static value `valid low_at_word_num` or `ready_low_at_word_num` seems to work.  
But then I can only specify one static number.

I was hoping I could randomize the valid and ready in a stream where 100 packets should be send back to back.  
How can I do that?

---

<div class="post-metadata">

**Author:** ![Erick](https://avatars.discourse-cdn.com/v4/letter/e/bbce88/32.png) [@Erick](https://forum.uvvm.org/u/Erick)\
**Post date:** [January 10, 2022, 11:38am UTC](https://forum.uvvm.org/t/can-you-randomize-the-axi-stream-valid-and-ready/255/3 "2022-01-10T11:38:26Z")

</div>

Hi,

In order to use the random deassertion you need to set the valid\_low\_at\_word\_num/ready\_low\_at\_word\_num to C\_MULTIPLE\_RANDOM. This is explained in more detail in page 7.

---

<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:** [May 19, 2022, 4:41pm UTC](https://forum.uvvm.org/t/can-you-randomize-the-axi-stream-valid-and-ready/255/4 "2022-05-19T16:41:17Z")

</div>

Hi Erick,

I’m still trying to get the randomisation working.  
What I have so far is that I configure my VVC as:

```auto
shared_axistream_vvc_config(C_ID_AXIS).bfm_config.ready_low_at_word_num := 4;
shared_axistream_vvc_config(C_ID_AXIS).bfm_config.ready_low_duration := 2;
shared_axistream_vvc_config(C_ID_AXIS).bfm_config.ready_low_multiple_random_prob := 0.5;
shared_axistream_vvc_config(C_ID_AXIS).bfm_config.ready_low_max_random_duration := 5;

```

This however gives a fixed low of a fixed duration.  
So what am I doing wrong with setting up my VVC?

---

<div class="post-metadata">

**Author:** ![Erick](https://avatars.discourse-cdn.com/v4/letter/e/bbce88/32.png) [@Erick](https://forum.uvvm.org/u/Erick)\
**Post date:** [May 23, 2022, 10:23am UTC](https://forum.uvvm.org/t/can-you-randomize-the-axi-stream-valid-and-ready/255/5 "2022-05-23T10:23:34Z")

</div>

Hi,

As I mentioned before, to enable the random deassertion you need to set the configuration to random, you can try this:

```auto
shared_axistream_vvc_config(C_ID_AXIS).bfm_config.ready_low_at_word_num := C_MULTIPLE_RANDOM;
shared_axistream_vvc_config(C_ID_AXIS).bfm_config.ready_low_multiple_random_prob := 0.5;
shared_axistream_vvc_config(C_ID_AXIS).bfm_config.ready_low_duration := C_RANDOM;
shared_axistream_vvc_config(C_ID_AXIS).bfm_config.ready_low_max_random_duration := 5;

```

---

<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:** [May 24, 2022, 12:36pm UTC](https://forum.uvvm.org/t/can-you-randomize-the-axi-stream-valid-and-ready/255/6 "2022-05-24T12:36:31Z")

</div>

Yes this works. Now it is really random. And now it my testbench identifies another issue in my design…
