cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
hanqiu
Visitor
Visitor
4,318 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
sskalick
Xilinx Employee
Xilinx Employee
6,852 Views
Registered: ‎06-29-2015

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

View solution in original post

0 Kudos
2 Replies
hanqiu
Visitor
Visitor
4,310 Views
Registered: ‎10-01-2016

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

0 Kudos
sskalick
Xilinx Employee
Xilinx Employee
6,853 Views
Registered: ‎06-29-2015

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

View solution in original post

0 Kudos