cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
adrian.h
Explorer
Explorer
542 Views
Registered: ‎03-03-2011

AXIS test bench source data non-continuous TVALID

I've got a dat file that I read some test data from in the format:

eb9cffffffffffee ff 0
01000608104f22e8 ff 0
eb9c010004060008 ff 0
0a010101104f22e8 ff 0
0101000000000000 ff 0
0000000000000101 03 1

So that is 64bit data, strb and tlast. This dat file content is read in to an hls::stream<axiWord> variable using the following loop:

while (inputFile >> hex >> dataTemp >> strbTemp >> lastTemp) {
inData.data = dataTemp;
inData.strb = strbTemp;
inData.last = lastTemp;
inStream[0].write(inData);
}

axiWord is defined as:

struct axiWord
{
ap_uint<64> data;
ap_uint<8> strb;
ap_uint<1> last;
};

inStream[0] is then one of the streaming inputs to my UUT.

Everything is working, however, the input stream TVALID is not continuous (see attached screen grab). Can anyone point out what i've done wrong here?

I would expect the src_0_TVALID to be set high throughout the transaction and the UUT would throttle as required using src_0_TREADY.

hls_test_data.png
0 Kudos
10 Replies
dsakjl
Explorer
Explorer
485 Views
Registered: ‎07-20-2018

Hi @adrian.h ,

I suggest you to not define your own axi-stream data but use the ones available in ap_axi_sdata.h such as ap_axis or ap_axiu.

If you share your code I'll try to help you.

Regards.

0 Kudos
adrian.h
Explorer
Explorer
465 Views
Registered: ‎03-03-2011

Hi @dsakjl 

Thanks for replying and the offer to take a look. My code was heavily based on code from XAPP1209 which I assume could be a bit out of date now so thanks for the pointers to the axi-stream definitions, i'll give those a look over.

I've zipped up my project and attached it. Within the archive there is a file 'script.tcl' if you run that from a HLS command prompt with 'vivado_hls -f script.tcl' that should create the project and run the simulations, synthesis etc. You can then open the eth_mux_prj to view in HLS. The open wave viewer option should be there which will open up in Vivado simulator and you'll see the waveform as per my previous attachment.

I'm using 2020.1 tool versions.

Thanks again.

0 Kudos
dsakjl
Explorer
Explorer
429 Views
Registered: ‎07-20-2018

Hi @adrian.h ,

here is what I got from a run through the Vitis HLS compiler:

Running DUT .......................................... done.
Checking output .XXXXXXXXXXXXXXXXX done.

!!! TEST FAILED -- 17 mismatches detected !!!

WARNING: Hls::stream 'hls::stream<axiWord, 0>.2' contains leftover data, which may result in RTL simulation hanging.
The maximum depth reached by any of the 3 hls::stream() instances in the design is 0
ERROR: [COSIM 212-361] C TB post check failed, nonzero return value '255'.
ERROR: [COSIM 212-4] *** C/RTL co-simulation finished: FAIL ***

So, the first thing I would do is to fix the code/tb to pass the co-simulation.

Did you get the same error?

Regards.

0 Kudos
adrian.h
Explorer
Explorer
378 Views
Registered: ‎03-03-2011

Hi @dsakjl 

No, it passes just fine when I run it. I'll do a clean build of the project and see what happens.

0 Kudos
adrian.h
Explorer
Explorer
362 Views
Registered: ‎03-03-2011

Hi @dsakjl 

I've just run it again from a clean project. So I ran 'vivado_hls -f script.tcl', let that run through. Then opened up the GUI with 'vivado_hsl -p eth_mux_prj'. Even though the script runs the tests, I ran the cosim test again in the GUI and have attached the screen grab of the result which looks ok.

Which version of Vitis are you using? I would hope the fact i'm using Vivado HLS wouldn't be the reason for the difference! Are you on Windows or Linux?

Thanks.

hls.png
0 Kudos
dsakjl
Explorer
Explorer
336 Views
Registered: ‎07-20-2018

Hi @adrian.h ,

I'm using Vitis HLS 2020.2. Try the same code with Vitis HLS 2020.1, not Vivado HLS, and let me know.

I'll investigate the problem ASAP.

Regards.

0 Kudos
adrian.h
Explorer
Explorer
332 Views
Registered: ‎03-03-2011

@dsakjl 

Thanks, are you on Linux? Just wondering if it's a dos2unix issue with the .dat test files?

I'll try Vitis, will need to install first though.

0 Kudos
boba-milk-tea
Visitor
Visitor
285 Views
Registered: ‎12-09-2020

@dsakjl I am using Vitis HLS 2020.2  I have the same issue

0 Kudos
adrian.h
Explorer
Explorer
250 Views
Registered: ‎03-03-2011

Just added Vitis 2020.1 to my install.

Started a Vitis HLS 2020.1 Command Prompt. 

From the /eth_mux_hls/scripts directory I ran 'vitis_hls -f script.tcl' and got the following output as attached.

So i'm seeing a different issue here with Vitis. You'll note that the CSIM completes fine though. I'm now looking in to this error.

vitis_hls.png
0 Kudos
boba-milk-tea
Visitor
Visitor
212 Views
Registered: ‎12-09-2020

@adrian.h there is no eth_mux.cpp in the example design. So I guess it is some modification you have in your build.

I run both Vivado HLS 2020.1 and Vitis HLS 2020.1 also. Co-sim behaviors are different. However, both have gaps in TREADY. Vivado HLS seems to throttle less.

Vitis HLS 2020.1

Screenshot from 2021-03-10 10-34-29.png

Vivado HLS 2020.1

Screenshot from 2021-03-10 10-19-42.png

0 Kudos