cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
KKilic
Observer
Observer
508 Views
Registered: ‎01-01-2021

Static Variables

Jump to solution

Hi,

Please take a look at code below, it is  from a Xilinx sample, "XAPP1209 (v1.0.1) Designing Protocol Processing Systems with
Vivado High-Level Synthesis". (file:icmp_server.cpp)

In Vitis HLS user guide, it says, either write to or read from a static variable but do not do both. But if you look at crCurrWord, it is reading from it, then writing, then reading, then writing again, in a function with II=1.

As a new HLS developer, I`d like to ask, is this something right? Am I missing something?

 

static  axiWord crCurrWord;

      case R_READ1:
      {
         if(!inData.empty()) {
            ap_uint<32> buffer  = crCurrWord.data.range(47, 16);
            sendWord.data.range(15, 0)  = crCurrWord.data.range(63, 48);
            sendWord.data.range(63, 48) = crCurrWord.data.range(15, 0);
            inData.read(crCurrWord);
            sendWord.data.range(47, 16) = crCurrWord.data.range(31, 0);
            crCurrWord.data.range(31, 0)  = buffer;
            outData.write(sendWord);
            replyState = R_READ2;
         }
         break;
      }

 

0 Kudos
1 Solution

Accepted Solutions
aoifem
Moderator
Moderator
448 Views
Registered: ‎11-21-2018

Hi @KKilic 

XAPP1209 was written a long time ago, and is written for Vivado HLS. The coding style needed for Vitis HLS is different to that of Vivado HLS. You can see the migration guide and known issues AR for details of the coding differences. 

https://www.xilinx.com/support/answers/75342.html

https://www.xilinx.com/support/documentation/sw_manuals/xilinx2020_2/ug1391-vitis-hls-migration-guide.pdf

 

If you are looking for some examples to get you started, I would recommend ones written for Vitis HLS (assuming this is the software tool you are using), and the ones available in the user guide: 

https://github.com/Xilinx/HLS-Tiny-Tutorials

https://forums.xilinx.com/t5/Design-and-Debug-Techniques-Blog/AXI-Basics-6-Introduction-to-AXI4-Lite-in-Vitis-HLS/ba-p/1137153

https://forums.xilinx.com/t5/Design-and-Debug-Techniques-Blog/AXI-Basics-7-Connecting-to-the-PS-using-AXI4-Lite-and-Vitis-HLS/ba-p/1137753

 

Aoife
Product Application Engineer - Xilinx Technical Support EMEA


**~ Got a minute? Answer our Vitis HLS survey here! ~**

**~ Don't forget to reply, give kudos, and accept as solution.~**

View solution in original post

0 Kudos
1 Reply
aoifem
Moderator
Moderator
449 Views
Registered: ‎11-21-2018

Hi @KKilic 

XAPP1209 was written a long time ago, and is written for Vivado HLS. The coding style needed for Vitis HLS is different to that of Vivado HLS. You can see the migration guide and known issues AR for details of the coding differences. 

https://www.xilinx.com/support/answers/75342.html

https://www.xilinx.com/support/documentation/sw_manuals/xilinx2020_2/ug1391-vitis-hls-migration-guide.pdf

 

If you are looking for some examples to get you started, I would recommend ones written for Vitis HLS (assuming this is the software tool you are using), and the ones available in the user guide: 

https://github.com/Xilinx/HLS-Tiny-Tutorials

https://forums.xilinx.com/t5/Design-and-Debug-Techniques-Blog/AXI-Basics-6-Introduction-to-AXI4-Lite-in-Vitis-HLS/ba-p/1137153

https://forums.xilinx.com/t5/Design-and-Debug-Techniques-Blog/AXI-Basics-7-Connecting-to-the-PS-using-AXI4-Lite-and-Vitis-HLS/ba-p/1137753

 

Aoife
Product Application Engineer - Xilinx Technical Support EMEA


**~ Got a minute? Answer our Vitis HLS survey here! ~**

**~ Don't forget to reply, give kudos, and accept as solution.~**

View solution in original post

0 Kudos