{"id":422,"date":"2022-04-20T09:20:13","date_gmt":"2022-04-20T02:20:13","guid":{"rendered":"https:\/\/dgway.com\/blog_E\/?p=422"},"modified":"2022-04-20T09:22:44","modified_gmt":"2022-04-20T02:22:44","slug":"002-using-multiple-ddr-banks","status":"publish","type":"post","link":"https:\/\/dgway.com\/blog_E\/2022\/04\/20\/002-using-multiple-ddr-banks\/","title":{"rendered":"#002 Using Multiple DDR Banks"},"content":{"rendered":"\n<p>Based on Xilinx\u2019s Vitis<sup>TM<\/sup> Application Acceleration Development Flow Tutorial:<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/Xilinx\/Vitis-Tutorials\/tree\/2021.2\/Hardware_Acceleration\/Feature_Tutorials\/04-mult-ddr-banks\">https:\/\/github.com\/Xilinx\/Vitis-Tutorials\/tree\/2021.2\/Hardware_Acceleration\/Feature_Tutorials\/04-mult-ddr-banks<\/a><\/p>\n\n\n\n<p>By default, the data transfer between the Kernel and the DDR is accomplished by using single DDR. In some applications, transferring large amount of data between global memory (DDR) and FPGA can be a cause of performance dropped. Using multiple DDR banks can be one of the solutions. Therefore, this tutorial illustrates you how to map kernel ports to multiple DDR banks.<\/p>\n\n\n\n<p><strong>Overviews<\/strong><\/p>\n\n\n\n<p>In this tutorial, it uses a simple vector addition, called \u2018vadd\u2019. The \u2018vadd\u2019 kernel is reading data from \u2018in1\u2019 and \u2018in2\u2019 and the result is \u2018out\u2019. The basic behavior of Vitis core development is to use only a single DDR bank to exchange data between kernel and global memory. In this case, all the data access of port \u2018in1\u2019, \u2018in2\u2019 and \u2018out\u2019 of \u2018vadd\u2019 kernel come from the default DDR bank only, as shown in picture below.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"639\" height=\"321\" src=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650087352153.jpg\" alt=\"\" class=\"wp-image-423\" srcset=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650087352153.jpg 639w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650087352153-300x151.jpg 300w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650087352153-500x250.jpg 500w\" sizes=\"auto, (max-width: 639px) 100vw, 639px\" \/><figcaption>Thanks for the pic from <a href=\"https:\/\/github.com\/Xilinx\/Vitis-Tutorials\/tree\/2021.2\/Hardware_Acceleration\/Feature_Tutorials\/04-mult-ddr-banks\">https:\/\/github.com\/Xilinx\/Vitis-Tutorials\/tree\/2021.2\/Hardware_Acceleration\/Feature_Tutorials\/04-mult-ddr-banks<\/a><\/figcaption><\/figure><\/div>\n\n\n\n<p>The picture below demonstrates a plan to reduce the load of access data by using multiple DDR which will carry out in this tutorial later.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"638\" height=\"319\" src=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650087380976.jpg\" alt=\"\" class=\"wp-image-424\" srcset=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650087380976.jpg 638w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650087380976-300x150.jpg 300w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650087380976-500x250.jpg 500w\" sizes=\"auto, (max-width: 638px) 100vw, 638px\" \/><figcaption>Thanks for the pic from <a href=\"https:\/\/github.com\/Xilinx\/Vitis-Tutorials\/tree\/2021.2\/Hardware_Acceleration\/Feature_Tutorials\/04-mult-ddr-banks\">https:\/\/github.com\/Xilinx\/Vitis-Tutorials\/tree\/2021.2\/Hardware_Acceleration\/Feature_Tutorials\/04-mult-ddr-banks<\/a><\/figcaption><\/figure><\/div>\n\n\n\n<p><strong>Step by step to run on TKAS<\/strong><\/p>\n\n\n\n<p>Using set environment and old folder from last issue. Then, navigate to .\/Hardware_Acceleration\/Feature_Tutorials\/04-mult-ddr-banks\/reference-files<\/p>\n\n\n\n<p><strong>Changing configuration for Alveo U250 card<\/strong><\/p>\n\n\n\n<p>File makefile<\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">Line 4 | PLATFORM := xilinx_u250_gen3x16_xdma_3_1_202020_1<\/mark><\/p>\n\n\n\n<p>Save makefile and close.<\/p>\n\n\n\n<p><strong>Build<\/strong><strong> &amp; Check<\/strong><\/p>\n\n\n\n<p>Execute the command below in order to see the default behavior of Vitis core development tool<\/p>\n\n\n\n<p><em><mark style=\"background-color:#abb8c3\" class=\"has-inline-color\">make all<\/mark><\/em><\/p>\n\n\n\n<p>After execute command, user would see the console indicate the default behavior as picture below<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"807\" height=\"83\" src=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650007816644-1.jpg\" alt=\"\" class=\"wp-image-428\" srcset=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650007816644-1.jpg 807w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650007816644-1-300x31.jpg 300w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650007816644-1-768x79.jpg 768w\" sizes=\"auto, (max-width: 807px) 100vw, 807px\" \/><\/figure>\n\n\n\n<p>To ensure the automatically mapping of Vitis development core, user can be used option \u2018check\u2019 when execute \u2018make\u2019 command as below.<\/p>\n\n\n\n<p><em><mark style=\"background-color:#abb8c3\" class=\"has-inline-color\">make check<\/mark><\/em><\/p>\n\n\n\n<p>After the simulation complete, the report of memory transfer is generated as shown below.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"345\" src=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650008029601-1024x345.jpg\" alt=\"\" class=\"wp-image-429\" srcset=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650008029601-1024x345.jpg 1024w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650008029601-300x101.jpg 300w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650008029601-768x259.jpg 768w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650008029601.jpg 1312w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p>As you can see, all data transfer is done by using DDR bank 1 only. User can view it as graphic by using command below<\/p>\n\n\n\n<p><em><mark style=\"background-color:#abb8c3\" class=\"has-inline-color\">vitis_analyzer vadd.hw_emu.xclbin<\/mark><\/em><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"279\" src=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650009109542-1024x279.jpg\" alt=\"\" class=\"wp-image-430\" srcset=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650009109542-1024x279.jpg 1024w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650009109542-300x82.jpg 300w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650009109542-768x209.jpg 768w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650009109542.jpg 1079w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p>From now on, this is steps to use multiple DDR in order to reduce bottleneck due to using single DDR data transfer.<\/p>\n\n\n\n<p><strong>Set v++ Linker options<\/strong><\/p>\n\n\n\n<p>navigate to .\/Hardware_Acceleration\/Feature_Tutorials\/04-mult-ddr-banks\/reference-files<\/p>\n\n\n\n<p>Open the makefile comment line 18 and uncomment line 19 in order to use file connectivity.cfg instead of using default behavior of Vitis development core relevant to mapping DDR bank, as shown in picture below.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"543\" height=\"58\" src=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650009917472.jpg\" alt=\"\" class=\"wp-image-431\" srcset=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650009917472.jpg 543w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650009917472-300x32.jpg 300w\" sizes=\"auto, (max-width: 543px) 100vw, 543px\" \/><\/figure><\/div>\n\n\n\n<p>The connectivity.cfg file is shown below.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"216\" height=\"143\" src=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650008100026.jpg\" alt=\"\" class=\"wp-image-432\"\/><\/figure><\/div>\n\n\n\n<p>sp = &lt;kernel_cu_name&gt;.&lt;kernel_arg&gt;:&lt;sptag&gt;<br>sp : the option to allow user to map kernel port to a specific global memory banks.<br>&lt;kernel_cu_name&gt; : The compute unit (CU) based on the kernel name followed by \u2018_\u2019 and index.<br>&lt;kernel_arg&gt; : The function argument of the CU, for this tutorial is argument as found in \u2018vadd.cpp\u2019 file<br>&lt;sptag&gt; : Represents a memory resource available on the target platform.<\/p>\n\n\n\n<p><strong>Build<\/strong><strong> &amp; Check<\/strong><\/p>\n\n\n\n<p>Execute the command below in order to perform multiple DDR banks<\/p>\n\n\n\n<p><em><mark style=\"background-color:#abb8c3\" class=\"has-inline-color\">make all<\/mark><\/em><\/p>\n\n\n\n<p>After execute command, user would see the console indicate the default behavior as picture below<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650008504964-1.jpg\" alt=\"\" class=\"wp-image-434\" width=\"861\" height=\"155\" srcset=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650008504964-1.jpg 694w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650008504964-1-300x54.jpg 300w\" sizes=\"auto, (max-width: 861px) 100vw, 861px\" \/><\/figure><\/div>\n\n\n\n<p>To confirm using multiple DDR by using makefile with option check as shown below<\/p>\n\n\n\n<p><em><mark style=\"background-color:#abb8c3\" class=\"has-inline-color\">make check<\/mark><\/em><\/p>\n\n\n\n<p>After test is completed, the message shows as below<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"363\" src=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650008610129-1024x363.jpg\" alt=\"\" class=\"wp-image-435\" srcset=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650008610129-1024x363.jpg 1024w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650008610129-300x106.jpg 300w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650008610129-768x272.jpg 768w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650008610129.jpg 1303w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Furthermore, to view a graphic of multiple DDR bank by using below command<\/p>\n\n\n\n<p><em><mark style=\"background-color:#abb8c3\" class=\"has-inline-color\">vitis_analyzer vadd.hw_emu.xclbin<\/mark><\/em><\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"409\" src=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650008666117-1024x409.jpg\" alt=\"\" class=\"wp-image-436\" srcset=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650008666117-1024x409.jpg 1024w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650008666117-300x120.jpg 300w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650008666117-768x307.jpg 768w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2022\/04\/1650008666117.jpg 1086w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Based on Xilinx\u2019s VitisTM Application Acceleration Development Flow Tutorial: https:\/\/github.com\/Xilinx\/Vitis-Tutorials\/tree\/2021.2\/Hardware_Acceleration\/Feature_Tutorials\/04-mult-ddr-banks By default, the data transfer between the Kernel and the DDR is accomplished by using single DDR. In some applications, transferring large amount of data between global memory (DDR) and FPGA can be a cause of performance dropped. Using multiple DDR banks can be one of the solutions. Therefore, this&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":424,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-422","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-accelerated-computing-tutorial"],"_links":{"self":[{"href":"https:\/\/dgway.com\/blog_E\/wp-json\/wp\/v2\/posts\/422","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dgway.com\/blog_E\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dgway.com\/blog_E\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dgway.com\/blog_E\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dgway.com\/blog_E\/wp-json\/wp\/v2\/comments?post=422"}],"version-history":[{"count":3,"href":"https:\/\/dgway.com\/blog_E\/wp-json\/wp\/v2\/posts\/422\/revisions"}],"predecessor-version":[{"id":438,"href":"https:\/\/dgway.com\/blog_E\/wp-json\/wp\/v2\/posts\/422\/revisions\/438"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dgway.com\/blog_E\/wp-json\/wp\/v2\/media\/424"}],"wp:attachment":[{"href":"https:\/\/dgway.com\/blog_E\/wp-json\/wp\/v2\/media?parent=422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dgway.com\/blog_E\/wp-json\/wp\/v2\/categories?post=422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dgway.com\/blog_E\/wp-json\/wp\/v2\/tags?post=422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}