# AXI stream example code doesn't work

**URL:** <https://forum.uvvm.org/t/axi-stream-example-code-doesnt-work/254>\
**Category:** Bitvis VIP AXI-Stream\
**Tags:** vip\
**Created:** [December 15, 2021, 2:32pm UTC](https://forum.uvvm.org/t/axi-stream-example-code-doesnt-work/254 "2021-12-15T14:32:04Z")\
**Posts on this page:** 4\
**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 15, 2021, 2:32pm UTC](https://forum.uvvm.org/t/axi-stream-example-code-doesnt-work/254/1 "2021-12-15T14:32:05Z")

</div>

Hi,

I’m trying to get the exmaple code working.  
I have a design which just wires the VVC master signals to the VVC slave

PROBLEM 1  
I have defined the signals from the two VVC that drive my design as:

```auto
signal axistream_if_driver : t_axistream_if(tdata(C_DATA_WIDTH -1 downto 0),
tkeep((C_DATA_WIDTH/8)-1 downto 0),
tuser(C_USER_WIDTH -1 downto 0),
tstrb((C_DATA_WIDTH/8)-1 downto 0),
tid(C_ID_WIDTH-1 downto 0),
tdest(C_DEST_WIDTH-1 downto 0)
);

signal axistream_if_monitor: t_axistream_if(tdata(C_DATA_WIDTH -1 downto 0),
tkeep((C_DATA_WIDTH/8)-1 downto 0),
tuser(C_USER_WIDTH -1 downto 0),
tstrb((C_DATA_WIDTH/8)-1 downto 0),
tid(C_ID_WIDTH-1 downto 0),
tdest(C_DEST_WIDTH-1 downto 0)
);

```

```auto
p_main: process
v_data_array : t_slv_array (0 to 9) (31 downto 0);
v_exp_data_array : t_slv_array (0 to 9) (31 downto 0);
...
begin

-- copy of vvc quick ref page 4
axistream_transmit(AXISTREAM_VVCT, 0, v_data_array(0 to 1),
“Send a 2 byte packet to DUT, tuser=0 each word / clock cycle”, C_SCOPE);

-- copy of vvc quick ref page 4 and 5
axistream_expect(AXISTREAM_VVCT, 1, v_exp_data_array(0 to 1),
“Expect a 2 byte packet, ignoring the tuser bits”, C_SCOPE);
await_completion (AXISTREAM_VVCT, 0, 10 * C_AXI_CLOCK);
end process;

```

This gives an error in QuestaSim  
No feasible entries for axistream\_expect

PROBLEM 2  
If I don’t use axistream\_expect but

```auto
-- copy of vvc quick ref page 5
axistream_receive(AXISTREAM_VVCT, 1, “Receive data to VVC”, C_SCOPE);

```

I don’t get an error in QuestaSim  
But in they waveform I see the VVC slave doesn’t respond.  
For example the t\_ready from the slave VVC side is never driven.

What else should I do that is not in the example code of the document

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 16, 2021, 5:52am UTC](https://forum.uvvm.org/t/axi-stream-example-code-doesnt-work/254/2 "2021-12-16T05:52:55Z")

</div>

I took out the DUT and hook the driver VVC to the monitor VVC by making one

```auto
signal axistream_if_to_drv_and_mon: t_axistream_if(tdata(C_DATA_WIDTH -1 downto 0),
tkeep((C_DATA_WIDTH/8)-1 downto 0),
tuser(C_USER_WIDTH -1 downto 0),
tstrb((C_DATA_WIDTH/8)-1 downto 0),
tid(C_ID_WIDTH-1 downto 0),
tdest(C_DEST_WIDTH-1 downto 0)
);

```

Then I see the pin wiggles on the monitor VVC when I do a  
`axistream_receive(AXISTREAM_VVCT, 1, “Receive data to VVC”, C_SCOPE);`

When I replace it with the expect function  
– copy of vvc quick ref page 4 and 5  
axistream\_expect(AXISTREAM\_VVCT, 1, v\_exp\_data\_array(0 to 1),  
“Expect a 2 byte packet, ignoring the tuser bits”, C\_SCOPE);  
await\_completion (AXISTREAM\_VVCT, 0, 10 \* C\_AXI\_CLOCK);

the questasim problem still remains.

---

<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, 6:14am UTC](https://forum.uvvm.org/t/axi-stream-example-code-doesnt-work/254/3 "2021-12-16T06:14:10Z")

</div>

Problem solved:  
All the example code in the documentation misses the alert\_level.

```auto
axistream_expect(AXISTREAM_VVCT, 1, v_exp_data_array(0 to 1),
“Expect a 2 byte packet, ignoring the tuser bits”, C_SCOPE);

```

must be

```auto
axistream_expect(AXISTREAM_VVCT, 1, v_exp_data_array(0 to 1),
“Expect a 2 byte packet, ignoring the tuser bits”, ERROR, C_SCOPE);

```

---

<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 16, 2021, 12:39pm UTC](https://forum.uvvm.org/t/axi-stream-example-code-doesnt-work/254/4 "2021-12-16T12:39:50Z")

</div>

Hi Eric,

This seems to be a bug - I do not think it should be required to include the alert\_level.  
I’ll add this to our issue tracker.

Br,  
Marius
