UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor hanqiu
Visitor
3,351 Views
Registered: ‎10-01-2016

Error using hls stream for global variable

Jump to solution

Here is part of my code:

 

hls::stream<in_type> test_stream;
#pragma HLS STREAM variable=test_stream depth=3

Here is the error message

 

 

CRITICAL WARNING: [HLS 200-70] Pragma 'STREAM' (/home/hqiu/systolic_gemm_bi/systolic_gemm_bi.cpp:25) is not inserted at a valid location. Pragma must be inside functions.
Wrong pragma usage.
    while executing

It seems that I can't specify the depth of a global stream and I'm wondering why.

 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
5,885 Views
Registered: ‎06-29-2015

Re: Error using hls stream for global variable

Jump to solution

Hi hanqiu,

 

Yes, in VHLS you can specify a pragma inside of a function for a global variable.

 

Please keep in mind that in SDSoC global variables are expressly prohibited except in special circumstances. See UG1027 page 33 where is says:

 

It is an error to refer to a global variable within a hardware function or any of its sub-functions when this global variable is also referenced by other functions running in software.

 

The global variable is only allowed when it is referred to entirely within your hardware function and never from the code that will run on the processor.

 

Sam

0 Kudos
2 Replies
Visitor hanqiu
Visitor
3,343 Views
Registered: ‎10-01-2016

Re: Error using hls stream for global variable

Jump to solution

I'm not quite sure, but it seems that I can use pragma in a function to control the global variable

0 Kudos
Xilinx Employee
Xilinx Employee
5,886 Views
Registered: ‎06-29-2015

Re: Error using hls stream for global variable

Jump to solution

Hi hanqiu,

 

Yes, in VHLS you can specify a pragma inside of a function for a global variable.

 

Please keep in mind that in SDSoC global variables are expressly prohibited except in special circumstances. See UG1027 page 33 where is says:

 

It is an error to refer to a global variable within a hardware function or any of its sub-functions when this global variable is also referenced by other functions running in software.

 

The global variable is only allowed when it is referred to entirely within your hardware function and never from the code that will run on the processor.

 

Sam

0 Kudos