{"id":7679,"date":"2024-10-07T14:04:59","date_gmt":"2024-10-07T06:04:59","guid":{"rendered":"http:\/\/www.hellofpga.com\/?p=7679"},"modified":"2025-06-24T10:59:08","modified_gmt":"2025-06-24T02:59:08","slug":"lemon_zynq_ps_pl_reg","status":"publish","type":"post","link":"http:\/\/www.hellofpga.com\/index.php\/2024\/10\/07\/lemon_zynq_ps_pl_reg\/","title":{"rendered":"\u57fa\u4e8eLemon ZYNQ\u7684PS\u5b9e\u9a8c\u5341\u4e09  PS\u4e0ePL\u6570\u636e\u4ea4\u4e92\u4e4b PS\u8bbf\u95ee PL\u7aef\u7684reg \u5bc4\u5b58\u5668"},"content":{"rendered":"\n<p>PS\u7aef\u4e0ePL\u7aef\u5728\u786c\u4ef6\u4e0a\u662f\u76f8\u4e92\u72ec\u7acb\u7684\uff0c\u4e4b\u524d\u53ef\u4ee5\u901a\u8fc7EMIO \u548c AXI GPIO\u7b49\u65b9\u5f0f \u8ba9ZYNQ PS \u7aef\u7684GPIO \u53e3\u6620\u5c04\u5230PL\u7aef\u4e0a\uff0c\u4f46\u662f\u4ec5\u4ec5\u53ea\u80fd\u63a7\u5236GPIO\u3002 \u672c\u6587\u4ecb\u7ecd\u4e00\u79cd\u65b0\u7684\u65b9\u6cd5\uff0c\u901a\u8fc7\u8ba9PS\u7aef\u8bbf\u95eePL\u7aef\u5bc4\u5b58\u5668\u7684\u65b9\u5f0f\uff0c\u6765\u8ba9ARM \u548cFPGA\u5b9e\u73b0\u7b80\u5355\u7684\u6570\u636e\u4ea4\u4e92\uff08\u5c0f\u6570\u636e\u91cf\uff09<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6b64\u7ae0\u8282\u5185\u5bb9\u9002\u7528\u4e8eLemon ZYNQ\u4e3b\u677f\uff0c\u5982\u662f\u5176\u4ed6\u677f\u5b50\u8bf7\u770b\u5bf9\u5e94\u677f\u5b50\u76ee\u5f55<\/strong><\/li>\n\n\n\n<li><strong>\u672c\u6587\u5728 vivado2018.3\u7248\u672c\u4e0a\u6f14\u793a<\/strong><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e00\u3001\u5de5\u7a0b\u521b\u5efa<\/strong><\/h2>\n\n\n\n<p>\u5de5\u7a0b\u521b\u5efa\u7684\u8fc7\u7a0b\u53ef\u4ee5\u53c2\u8003\u8bd5\u9a8c\u4e00\u4e2d\u7684\u5185\u5bb9\uff0c\u8fd9\u91cc\u4e0d\u518d\u8be6\u7ec6\u63cf\u8ff0\u4e86\u3002<a href=\"http:\/\/www.hellofpga.com\/index.php\/2024\/10\/04\/lemon_zynq_ps_gpio_emio\/\">\u57fa\u4e8eLemon ZYNQ\u7684PS\u5b9e\u9a8c\u4e00 GPIO\u4e4b\u7528EMIO\u65b9\u5f0f\u70b9\u4eaeLED\uff08\u5b8c\u6574\u56fe\u6587\uff09<\/a>(\u82af\u7247\u578b\u53f7\u9009XC7Z020CLG400-1)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u4e00-\u521b\u5efa\u4e00\u4e2a\u5e26axi-\u63a5\u53e3\u7684ip\"><strong>\u4e8c\u3001\u521b\u5efa\u4e00\u4e2a\u5e26AXI \u63a5\u53e3\u7684IP<\/strong><\/h2>\n\n\n\n<p>1\uff09\u521b\u5efa\u5e76\u5c01\u88c5\u4e00\u4e2a\u5e26AXI \u63a5\u53e3\u7684IP \u5177\u4f53\u8fc7\u7a0b\u5982\u4e0b \uff0cTOOLS-&gt;Create and Package New IP<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"385\" height=\"188\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image.png\" alt=\"\" class=\"wp-image-500\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image.png 385w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-300x146.png 300w\" sizes=\"auto, (max-width: 385px) 100vw, 385px\" \/><\/figure>\n\n\n\n<p>2\uff09\u9009\u62e9\u5c01\u88c5\u5e26AXI4\u603b\u7ebf\u7684<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"324\" height=\"327\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-2.png\" alt=\"\" class=\"wp-image-502\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-2.png 324w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-2-297x300.png 297w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-2-150x150.png 150w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-2-100x100.png 100w\" sizes=\"auto, (max-width: 324px) 100vw, 324px\" \/><\/figure>\n\n\n\n<p>3\uff09next\uff0c\u586b\u5199\u540d\u79f0\u7b49\u4fe1\u606f\uff0c\u6ce8\u610fIP\u4fdd\u5b58\u8def\u5f84\uff08\u4fdd\u5b58\u5230\u5de5\u7a0b\u76ee\u5f55\u4e0b\u5c31\u53ef\uff09\u3002\u8fd9\u91cc\u7ed9IP\u53d6\u540d PS_PL_REG \u5373 PS\u548cPL\u7684REG\u4e92\u76f8\u8bbf\u95ee<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"839\" height=\"555\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-3.png\" alt=\"\" class=\"wp-image-503\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-3.png 839w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-3-300x198.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-3-768x508.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p><br>4\uff09next\uff0c\u9009\u62e9\u603b\u7ebf\u76f8\u5173\u4fe1\u606f\uff0c\u8fd9\u91ccAXI\u7684 \u534f\u8bae\u9009\u62e9 LITE \u8f7b\u578b\uff0c \u7136\u540enumber of registers \u6839\u636e\u9700\u6c42\u9009\u62e9\uff0c4\u5373\u4ee3\u8868\u6709\u56db\u4e2a32bit\u7684\u5bc4\u5b58\u5668 \u6700\u5c0f\u9009\u62e9\u662f4\u4e2a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"470\" height=\"291\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-5.png\" alt=\"\" class=\"wp-image-505\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-5.png 470w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-5-300x186.png 300w\" sizes=\"auto, (max-width: 470px) 100vw, 470px\" \/><\/figure>\n\n\n\n<p>5\uff09 \u9009\u62e9 \u4e0b\u4e00\u6b65 EDIT IP \u5e76\u70b9FINISH\u5b8c\u6210\uff08\u8fd9\u91cc\u4e00\u5b9a\u8981\u9009\u62e9\u201cEdit IP\u201d\uff0c\u5426\u5219\uff0c\u8f6f\u4ef6\u53ea\u662f\u751f\u6210\u4e86\u6846\u67b6\u6587\u4ef6\uff0c\u800c\u4e0d\u4f1a\u521b\u5efa\u4e00\u4e2a\u5173\u4e8eIP \u6838\u7684\u5de5\u7a0b\uff09<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"831\" height=\"561\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-6.png\" alt=\"\" class=\"wp-image-506\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-6.png 831w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-6-300x203.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-6-768x518.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>6\uff09\u4e4b\u540e\u7cfb\u7edf\u4f1a\u81ea\u52a8\u751f\u6210\u4e00\u4e2a\u8be5IP\u7684\u5de5\u7a0b\u3002 \u8fd9\u91cc\u6211\u4eec\u53cc\u51fb\u6253\u5f00\u7cfb\u7edf\u9ed8\u8ba4\u751f\u6210\u7684IP\u4ee3\u7801<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"893\" height=\"432\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-7.png\" alt=\"\" class=\"wp-image-507\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-7.png 893w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-7-300x145.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-7-768x372.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>7\uff09\u7814\u7a76\u4ee3\u7801\uff0c\u53ef\u4ee5\u770b\u5230 \u6211\u4eec\u8bbe\u7f6eIP\u7684\u65f6\u5019 PL\u7aef\u76844\u4e2a\u7528\u4e8ePS\u8bbf\u95ee\u7684\u5bc4\u5b58\u5668\u5206\u522b\u662f slv_reg0,slv_reg1,slv_reg2,svl_reg3 \uff0c\u8fd94\u4e2a\u5bc4\u5b58\u5668 \u901a\u8fc7AXI \u63a5\u53e3\uff0c\u53ef\u4f9bARM PS\u7aef\u8fdb\u884c\u8bfb\u548c\u5199\u7684\u64cd\u4f5c\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"309\" height=\"108\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-9.png\" alt=\"\" class=\"wp-image-509\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-9.png 309w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-9-300x105.png 300w\" sizes=\"auto, (max-width: 309px) 100vw, 309px\" \/><\/figure>\n\n\n\n<p>8\uff09\u4e3a\u4e86\u8ba9\u4ea4\u4e92\u7684\u8fc7\u7a0b\u66f4\u4e3a\u76f4\u89c2\uff0c\u6211\u4eec\u5728\u539f\u6709\u7684IP\u4ee3\u7801\u4e2d\u6dfb\u52a0\u4e00\u4e2aLED\u6307\u793a\u706f\u7528\u6765\u89c2\u5bdf\u4ea4\u4e92\u7684\u7ed3\u679c<\/p>\n\n\n\n<p>output reg LED;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"290\" height=\"105\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-10.png\" alt=\"\" class=\"wp-image-510\"\/><\/figure>\n\n\n\n<p>\u5e76\u5728\u4ee3\u7801\u4e2d\u589e\u52a0\u4ee5\u4e0b\u4ee3\u7801\u7528\u6765\u5c06\u706f\u548c\u6570\u636e\u8fdb\u884c\u5bf9\u5e94<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>   always@(posedge S_AXI_ACLK)begin\n        if(slv_reg0==32'd0)LED&lt;=0;\n        else if(slv_reg0&lt;=32'd1)LED&lt;=1;\n    end<\/code><\/pre>\n\n\n\n<p>\u4ee3\u7801\u89e3\u91ca \uff0c\u5f53slv_reg0\u7b49\u4e8e32\u4f4d\u76840\u65f6 LED \u7184\u706d\uff0c \u5f53slv_reg0\u7b49\u4e8e32\u2018d1\u65f6\uff0c\u5373\u5341\u8fdb\u52361\u65f6\uff0cLED\u70b9\u4eae\uff08slv_reg0\u540e\u9762\u53ef\u7531ARM\u7aef\u7684\u7a0b\u5e8f\u76f4\u63a5\u8bfb\u5199\uff09<\/p>\n\n\n\n<p>9\uff09\u5bf9\u7cfb\u7edf\u751f\u6210\u7684IP\u7684\u4e0a\u5c42\u6a21\u5757\uff0c\u4e5f\u76f8\u5e94\u7684\u589e\u52a0LED \u63a5\u53e3\uff0c\u5e76\u4e0e\u5185\u90e8\u7684\u6a21\u5757\u76f8\u8fde\u63a5<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"394\" height=\"194\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-11.png\" alt=\"\" class=\"wp-image-511\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-11.png 394w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-11-300x148.png 300w\" sizes=\"auto, (max-width: 394px) 100vw, 394px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"442\" height=\"158\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-12.png\" alt=\"\" class=\"wp-image-512\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-12.png 442w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-12-300x107.png 300w\" sizes=\"auto, (max-width: 442px) 100vw, 442px\" \/><\/figure>\n\n\n\n<p>10\uff09\u7f16\u8f91\u5b8c\u540e\uff0c\u4fdd\u5b58\u4fee\u6539\uff0c\u63a5\u4e0b\u6765\u662f\u6253\u5305 \u4fee\u6539\u5b8c\u7684IP(\u5c01\u88c5\u4e4b\u524d\uff0c\u5148\u7f16\u8bd1\u7efc\u5408\u770b\u770b\u4ee3\u7801\u662f\u5426\u6709\u62a5\u62a5\u9519)\uff0c\u56de\u5230Package IP\u9875\u9762\u8bbe\u7f6eIP,\u5982\u4e0b\u6240\u793a\u8f93\u5165\u76f8\u5173\u4fe1\u606f\uff0c\u4e5f\u53ef\u4ee5\u4e0d\u4fee\u6539<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"457\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-13-1024x457.png\" alt=\"\" class=\"wp-image-514\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-13-1024x457.png 1024w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-13-300x134.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-13-768x343.png 768w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-13.png 1373w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>11\uff09\u5728file Groups\u9879\u4e2d\u70b9\u51fbMerge changs from File Groups Wizard<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"938\" height=\"487\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-14.png\" alt=\"\" class=\"wp-image-515\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-14.png 938w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-14-300x156.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-14-768x399.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>12\uff09\u6839\u636e\u4e0a\u9762\u7684\u64cd\u4f5c\uff0c\u4e5f\u5c06\u8f6f\u4ef6\u754c\u9762\u4e2d\u6ca1\u6709\u6253\u52fe\u7684 \u9009\u9879\u5168\u90e8\u90fdmerge\u4e86<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"619\" height=\"339\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-15.png\" alt=\"\" class=\"wp-image-516\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-15.png 619w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-15-300x164.png 300w\" sizes=\"auto, (max-width: 619px) 100vw, 619px\" \/><\/figure>\n\n\n\n<p>13\uff09\u5f53\u9664\u4e86\u6700\u540e\u4e00\u9879\uff0c\u6240\u6709\u7684\u9009\u9879\u90fd\u52fe\u4e0a\u66f4\u65b0\u540e\uff0c \u5728\u6700\u540e\u4e00\u680f\u91cc\u70b9\u91cd\u65b0\u6253\u5305\u5c01\u88c5IP\uff0c\u5b8c\u6210IP\u7684\u6253\u5305<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"878\" height=\"559\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-16.png\" alt=\"\" class=\"wp-image-517\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-16.png 878w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-16-300x191.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-16-768x489.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>IP\u6253\u5305\u540e\uff0c\u4fee\u6539IP\u7684\u5de5\u7a0b\u4f1a\u88ab\u7cfb\u7edf\u81ea\u52a8\u5173\u95ed<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u4e8c-\u5728vivado\u5de5\u7a0b\u4e2d\u589e\u52a0zynq\u6a21\u5757\"><strong>\u4e09\u3001\u5728vivado\u5de5\u7a0b\u4e2d\u589e\u52a0ZYNQ\u6a21\u5757<\/strong><\/h2>\n\n\n\n<p>1\uff09\u589e\u52a0ZYNQ \u6a21\u5757<\/p>\n\n\n\n<p>\u5728Block Design \u4e2d \u589e\u52a0ZYNQ\u6a21\u5757\uff0c\u5e76\u4e14\u5728\u8bbe\u7f6e\u754c\u9762 \u5c06DDR\u9009\u9879\u8bbe\u7f6e\u6210 MT41K256M16RE-125 \u4f4d\u5bbd\u9009\u62e916bit<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"442\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/04\/image-1.png\" alt=\"\" class=\"wp-image-3746\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/04\/image-1.png 768w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/04\/image-1-300x173.png 300w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>2\uff09\u56e0\u4e3aLemon ZYNQ\u4e3b\u677f\u7684PS\u65f6\u949f\u662f50M\u7684\u6676\u632f\u8f93\u5165\u7684\uff0c\u6240\u4ee5\u8fd9\u91cc\u9700\u8981\u628a\u9ed8\u8ba4\u7684PS\u8f93\u5165\u65f6\u949f33.33M\u6539\u621050M<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"531\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-22-1024x531.png\" alt=\"\" class=\"wp-image-7455\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-22-1024x531.png 1024w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-22-300x156.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-22-768x398.png 768w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-22.png 1060w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>3\uff09\u9009\u62e9 Run Block Automation \u5b8c\u6210\u7aef\u53e3\u81ea\u52a8\u5e03\u7ebf<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"420\" height=\"143\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-17.png\" alt=\"\" class=\"wp-image-520\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-17.png 420w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-17-300x102.png 300w\" sizes=\"auto, (max-width: 420px) 100vw, 420px\" \/><\/figure>\n\n\n\n<p>4\uff09\u624b\u52a8\u8fde\u63a5 FCLK_CLK0\u5230 M_AXI_GP0_ACLK<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"577\" height=\"259\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-18.png\" alt=\"\" class=\"wp-image-521\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-18.png 577w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-18-300x135.png 300w\" sizes=\"auto, (max-width: 577px) 100vw, 577px\" \/><\/figure>\n\n\n\n<p>5\uff09\u5728block design \u4e2d\u6dfb\u52a0\u6211\u4eec\u521a\u624d\u521b\u5efa\u7684PS_TO_PL_REG IP\u6a21\u5757<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"666\" height=\"423\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-19.png\" alt=\"\" class=\"wp-image-522\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-19.png 666w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-19-300x191.png 300w\" sizes=\"auto, (max-width: 666px) 100vw, 666px\" \/><\/figure>\n\n\n\n<p>6\uff09 \u5982\u4e0b\u56fe\u6240\u793a \u6211\u4eec\u6dfb\u52a0\u7684PS_PL_REG\u6a21\u5757\u5df2\u7ecf\u6dfb\u52a0\u5230\u8bbe\u8ba1\u4e2d\uff0c\u518d\u6b21\u70b9\u9009run connection automation\u5c1d\u8bd5\u81ea\u52a8\u8fde\u7ebf<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"888\" height=\"466\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-20.png\" alt=\"\" class=\"wp-image-523\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-20.png 888w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-20-300x157.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-20-768x403.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u7cfb\u7edf\u4e3a\u6211\u4eec\u81ea\u52a8\u6dfb\u52a0\u9700\u8981\u589e\u52a0\u7684\u6a21\u5757\uff0c\u5e76\u81ea\u52a8\u8fde\u63a5\u597d\u4e86\u5404\u4e2a\u6a21\u5757<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"478\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-21-1024x478.png\" alt=\"\" class=\"wp-image-524\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-21-1024x478.png 1024w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-21-300x140.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-21-768x359.png 768w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-21.png 1235w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>7\uff09 \u56e0\u4e3a\u6211\u4eec\u7684\u6f14\u793a \u662f\u9700\u8981\u901a\u8fc7LED \u6765\u89c2\u5bdf\u7ed3\u679c\u7684\uff0c\u6240\u4ee5\u8fd9\u91cc\u53f3\u952eLED \u5c06LED\u7a97\u53e3\u5370\u51fa\u6765<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"473\" height=\"489\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-22.png\" alt=\"\" class=\"wp-image-525\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-22.png 473w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-22-290x300.png 290w\" sizes=\"auto, (max-width: 473px) 100vw, 473px\" \/><\/figure>\n\n\n\n<p>\u8fd9\u6837\u6211\u4eec\u7684\u6574\u4e2a\u786c\u4ef6\u7cfb\u7edf\u5c31\u7b97\u5e03\u5c40\u5b8c\u6210\u4e86\u3002<\/p>\n\n\n\n<p>8\uff09 \u5728design Sources\u4e2d \u53f3\u952e\u6211\u4eec\u521a\u521a\u8bbe\u8ba1\u7684ZYNQ\u6a21\u5757\uff0c\u7136\u540e\u70b9\u9009 Create HDL Wrapper<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"367\" height=\"176\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-23.png\" alt=\"\" class=\"wp-image-526\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-23.png 367w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-23-300x144.png 300w\" sizes=\"auto, (max-width: 367px) 100vw, 367px\" \/><\/figure>\n\n\n\n<p>9\uff09\u7f16\u8bd1 RUN<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"131\" height=\"86\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-24.png\" alt=\"\" class=\"wp-image-527\"\/><\/figure>\n\n\n\n<p>10\uff09\u4e3aLED \u5206\u914d\u7ba1\u811a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"141\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-68-1024x141.png\" alt=\"\" class=\"wp-image-7686\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-68-1024x141.png 1024w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-68-300x41.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-68-768x106.png 768w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-68.png 1372w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>11\uff09\u7efc\u5408\u5e76\u751f\u6210 bit\u6587\u4ef6<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"239\" height=\"102\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-27.png\" alt=\"\" class=\"wp-image-531\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u4e09-ps\u90e8\u5206\u5de5\u7a0b\u521b\u5efa\"><strong>\u4e09\u3001PS\u90e8\u5206\u5de5\u7a0b\u521b\u5efa<\/strong><\/h2>\n\n\n\n<p>1\uff09File\u2192Export\u2192Export hardware\u2026\uff0c\u5728\u5f39\u51fa\u7684\u5bf9\u8bdd\u6846\u4e2d\u52fe\u9009\u201cinclude bitstream\u201d\uff0c\u70b9\u51fb\u201cOK\u201d\u786e\u8ba4\uff0c\u5982\u4e0b\u56fe\u6240\u793a\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"462\" height=\"541\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-20.png\" alt=\"\" class=\"wp-image-207\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-20.png 462w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-20-256x300.png 256w\" sizes=\"auto, (max-width: 462px) 100vw, 462px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"332\" height=\"252\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-24.png\" alt=\"\" class=\"wp-image-211\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-24.png 332w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-24-300x228.png 300w\" sizes=\"auto, (max-width: 332px) 100vw, 332px\" \/><\/figure>\n\n\n\n<p>2\uff09File\u2192Lauch SDK\uff0c\u5728\u5f39\u51fa\u7684\u5bf9\u8bdd\u6846\u4e2d\uff0c\u4fdd\u5b58\u9ed8\u8ba4\uff0c\u70b9\u51fb\u201cOK\u201d\uff0c\u5982\u4e0b\u56fe\u6240\u793a\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"361\" height=\"285\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-21.png\" alt=\"\" class=\"wp-image-212\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-21.png 361w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-21-300x237.png 300w\" sizes=\"auto, (max-width: 361px) 100vw, 361px\" \/><\/figure>\n\n\n\n<p>\u7cfb\u7edf\u5c06\u81ea\u52a8\u6253\u5f00SDK\u5f00\u53d1\u73af\u5883<\/p>\n\n\n\n<p>3\uff09\u518d\u521b\u5efa\u4e00\u4e2aLED \u5de5\u7a0b\uff0c\u8d1f\u8d23LED \u6307\u793a\u706f\u7684\u95ea\u70c1<\/p>\n\n\n\n<p>a. \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u7a7a\u5de5\u7a0b,\u53ef\u4ee5\u53d6\u540d\u53ebPS_PL_REG_TEST<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"457\" height=\"405\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/01\/image-18.png\" alt=\"\" class=\"wp-image-463\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/01\/image-18.png 457w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/01\/image-18-300x266.png 300w\" sizes=\"auto, (max-width: 457px) 100vw, 457px\" \/><\/figure>\n\n\n\n<p>b.\u53f3\u952e\u5de5\u7a0b\u7684SRC\u76ee\u5f55\uff0c\u7136\u540e\u65b0\u5efa\u4e00\u4e2aSOURCE FILE<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"615\" height=\"347\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-28.png\" alt=\"\" class=\"wp-image-533\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-28.png 615w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-28-300x169.png 300w\" sizes=\"auto, (max-width: 615px) 100vw, 615px\" \/><\/figure>\n\n\n\n<p>c.\u53d6\u540d main.c<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"477\" height=\"270\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-29.png\" alt=\"\" class=\"wp-image-534\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-29.png 477w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-29-300x170.png 300w\" sizes=\"auto, (max-width: 477px) 100vw, 477px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u56db-ps\u7aef\u4ee3\u7801\u7f16\u5199\"><strong>\u56db\u3001PS\u7aef\u4ee3\u7801\u7f16\u5199<\/strong><\/h2>\n\n\n\n<p>1.\u70b9\u5f00platform\u4e2d\u7684 system.hdf \u8fd9\u91cc\u6240\u6709\u7684\u8d44\u6e90\u90fd\u4f1a\u663e\u793a\u5728\u8fd9\u91cc\uff0c \u627e\u5230\u6211\u4eec\u4e4b\u524d\u521b\u5efa\u7684PS_PL_REG \uff0c\u53ef\u4ee5\u770b\u5230 \u8fd9\u4e2a\u5916\u8bbe\u7684\u57fa\u5730\u5740\u662f 0X43C00000 \uff0c\u540e\u9762\u6211\u4eec\u4f1a\u7528\u5230\u8fd9\u4e2a\u5730\u5740<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"698\" height=\"337\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-30.png\" alt=\"\" class=\"wp-image-535\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-30.png 698w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/02\/image-30-300x145.png 300w\" sizes=\"auto, (max-width: 698px) 100vw, 698px\" \/><\/figure>\n\n\n\n<p>2.\u5728main .c\u4e2d\u6dfb\u52a0\u5982\u4e0b\u4ee3\u7801<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#include \"xparameters.h\"\n#include \"xil_io.h\"\n\n#define LED_BASE_ADDR 0x43c00000\n\nint main()\n{\n\tvolatile int Delay;\n\n    while(1)\n    {\n\n    \tXil_Out32(LED_BASE_ADDR, 1);\n    \tfor (Delay = 0; Delay &lt; 10000000; Delay++);\n    \tXil_Out32(LED_BASE_ADDR, 0);\n    \tfor (Delay = 0; Delay &lt; 10000000; Delay++);\n    }\n\n    return 0;\n}\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e94\u3001\u4e0b\u8f7d\u4e0e\u9a8c\u8bc1<\/strong><\/h2>\n\n\n\n<p>1\uff09\u65b0\u521b\u5efa\u7684\u5de5\u7a0b\u6700\u597d\u5148\u5bf9Run as \u8fdb\u884c\u914d\u7f6e\uff1a\u53f3\u952e\u5de5\u7a0b\uff0c\u5e76\u70b9\u9009Run As -&gt; Run Configurations<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"798\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-27.png\" alt=\"\" class=\"wp-image-7494\" style=\"width:558px;height:auto\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-27.png 750w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-27-282x300.png 282w\" sizes=\"auto, (max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px\" \/><\/figure>\n\n\n\n<p>2\uff09 \u5728\u5f39\u51fa\u7684\u7a97\u53e3\u4e2d\u5bf9Reset entire system \u548c Program FPGA\u4e24\u4e2a\u9009\u9879\u8fdb\u884c\u52fe\u9009\u64cd\u4f5c\uff0c\u8fd9\u6837\u5c31\u4e0d\u4f1a\u51fa\u73b0\u4e0b\u8f7d\u7a0b\u5e8fdebug\u7684\u65f6\u5019\u6982\u7387\u6027\u4e0d\u5de5\u4f5c\u7684\u95ee\u9898\u4e86\u3002<strong>\uff08\u8fd9\u6837\u64cd\u4f5c\u540e\u7cfb\u7edf\u4f1a\u81ea\u52a8\u5bf9FPGA\u8fdb\u884c\u914d\u7f6e\uff0c\u4e0d\u9700\u8981\u6309\u4e4b\u524d\u5de5\u7a0b\u624b\u52a8\u5bf9FPGA\u8fdb\u884c\u7f16\u7a0b\u4e86\uff09<\/strong><\/p>\n\n\n\n<p>PS\u5982\u679c\u6ca1\u6709\u51fa\u73b0\u4e0b\u56fe\u5bf9\u8bdd\u6846\uff0c\u53ef\u4ee5\u76f4\u63a5\u53cc\u51fb\u5de6\u4fa7\u7684applicationo \uff08System Debugger\uff09\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"705\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-29-1024x705.png\" alt=\"\" class=\"wp-image-7496\" style=\"width:574px;height:auto\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-29-1024x705.png 1024w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-29-300x206.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-29-768x528.png 768w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-29.png 1401w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>3\uff09\u8bbe\u7f6e\u597d\u4e4b\u540e\uff0c\u9009\u62e9<code>Run As<\/code>&nbsp;-&gt;&nbsp;<code>Launch on Hardware (System Debugger)<\/code>&nbsp;\u8fdb\u884c\u8c03\u8bd5\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"780\" height=\"178\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/07\/image-14.png\" alt=\"\" class=\"wp-image-835\" style=\"width:548px;height:auto\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/07\/image-14.png 780w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/07\/image-14-300x68.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/07\/image-14-768x175.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>\u53ef\u4ee5\u770b\u5230\u677f\u5b50\u4e0a\u7684LED1\u706f\u5728\u95ea\u70c1<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u516d\u3001\u4ee3\u7801\u89e3\u8bfb<\/strong><\/h2>\n\n\n\n<p>#define LED_BASE_ADDR 0x43c00000\uff0c\u8fd9\u91cc\u76840X43C00000\u5c31\u662f\u6211\u4eec\u4e4b\u524d\u770b\u5230\u7684 \u6a21\u5757\u5730\u5740<\/p>\n\n\n\n<p>Xil_Out32(LED_BASE_ADDR, 1); \u76f8\u5f53\u4e8e\u5411\u4e0a\u9762\u7684\u6a21\u5757\u5730\u5740\u5199\u51651<\/p>\n\n\n\n<p>Xil_Out32(LED_BASE_ADDR,0) ; \u76f8\u5f53\u4e8e\u5411\u6a21\u5757\u7684\u57fa\u5730\u5740\u5199\u51650<\/p>\n\n\n\n<p><strong>\u56e0\u4e3a\u6211\u4eec\u5728PL\u7aef\u521b\u5efa\u7684\u6a21\u5757\u4e2d\u76844\u4e2a\u5bc4\u5b58\u5668\uff0c\u53ea\u6709\u5bc4\u5b58\u56680\u5bf9\u5e94\u4e86LED \uff0c\u6240\u4ee5\u6211\u4eec\u53ea\u8981\u5411\u57fa\u5730\u5740\u5199\u5165\u4fe1\u606f\u5c31\u53ef\u4ee5\u63a7\u5236LED \u6307\u793a\u706f\u4e86<\/strong>\u3002<\/p>\n\n\n\n<p><strong>\u5982\u679c\u8981\u63a7\u5236\u5bc4\u5b58\u56681\uff0c\u5bc4\u5b58\u56682 \uff0c\u5bc4\u5b58\u56683 \u53ea\u9700\u8981\u5728\u57fa\u5730\u5740\u7684\u57fa\u7840\u4e0a+4\u5c31\u53ef\u4ee5\u4e86<\/strong>&nbsp;\uff08+4\u662f\u56e0\u4e3a\u6570\u636e\u90fd\u662f32bit\u7684\uff09<\/p>\n\n\n\n<p>\u53e6\u5916\u6211\u4eec\u4e5f\u53ef\u4ee5\u53cd\u5411\u7528PS \u53bb\u8bfb\u53d6PL\u7aef\u7684\u5bc4\u5b58\u5668\u503c\uff0c\u5177\u4f53\u8fc7\u7a0b\u4e0d\u5c55\u5f00\u63cf\u8ff0\u4e86\uff0c \u5b9e\u9645PS\u8bbf\u95ee \u53ef\u4ee5\u901a\u8fc7\u6307\u4ee4Xil_In32(LED_BASE_ADDR)\uff1b<strong>&nbsp;<\/strong>\uff08LED_BASE_ADDR \u4e3a\u6211\u4eec\u5b9a\u4e49\u7684\u57fa\u5730\u5740 \uff09\u6765\u8fdb\u884c\u8bfb\u53d6\u3002<\/p>\n\n\n\n<p>\u901a\u8fc7\u4e0a\u8ff0\u65b9\u5f0f \u6211\u4eec\u6210\u529f\u7684\u5b9e\u73b0\u4e86 PS\u548cPL \u901a\u8fc7\u5bc4\u5b58\u5668\u65b9\u5f0f\u7684\u4ea4\u4e92\uff0c\u8fd9\u79cd\u65b9\u5f0f\u76f8\u5bf9\u6bd4\u8f83\u7b80\u5355 \u5bb9\u6613\u5165\u624b\uff0c\u5f53\u7136\u4ea4\u4e92\u7684\u65b9\u5f0f\u8fd8\u6709\u5f88\u591a\uff0c\u540e\u9762 \u6709\u65f6\u95f4\u518d\u7ee7\u7eed\u6574\u7406\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e03\u3001\u7b80\u5355\u4ecb\u7ecd\u8bfb\u53d6\u90e8\u5206<\/strong>\uff08\u672c\u90e8\u5206\u65b0\u589e\u52a0\uff0c\u6ca1\u6709\u63d0\u4f9b\u5de5\u7a0b\uff0c\u5927\u5bb6\u81ea\u884c\u5c1d\u8bd5\uff09<\/h2>\n\n\n\n<p>\u56de\u5230\u7cfb\u7edf\u81ea\u52a8\u751f\u6210\u7684 IP \u6a21\u5757\u4e2d\uff08\u5982\u4e0b\u56fe\u6240\u793a\uff09\uff0c<code>axi_rdata<\/code> \u662f\u6211\u4eec\u4ece PL \u4fa7\u8bfb\u53d6\u6570\u636e\u65f6\u8fd4\u56de\u7ed9 PS \u7684\u901a\u9053\u3002\u800c\u53e6\u4e00\u4e2a <code>always<\/code> \u6a21\u5757\u5219\u8d1f\u8d23\u6839\u636e\u5f53\u524d\u8bbf\u95ee\u7684\u5730\u5740\uff0c\u9009\u62e9\u8fd4\u56de\u54ea\u4e2a\u5bc4\u5b58\u5668\u7684\u6570\u636e\u3002<\/p>\n\n\n\n<p>\u7531\u4e8e\u6211\u4eec\u7684\u793a\u4f8b\uff08demo\uff09\u4e2d\u5171\u5b9a\u4e49\u4e86 4 \u8def 32 \u4f4d\u5bc4\u5b58\u5668\uff0c\u56e0\u6b64\u5728\u5730\u5740\u5339\u914d\u90e8\u5206\u6709 4 \u4e2a <code>case<\/code> \u5206\u652f\u6765\u5bf9\u5e94\u4e0d\u540c\u7684\u5bc4\u5b58\u5668\u5730\u5740\u3002<\/p>\n\n\n\n<p>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u8fd9\u4e2a IP \u662f\u7531 Xilinx \u5de5\u5177\u81ea\u52a8\u751f\u6210\u7684 AXI \u5916\u8bbe\u6a21\u677f\uff0c\u5176\u539f\u59cb\u7528\u9014\u662f\u6f14\u793a PS \u901a\u8fc7 AXI \u63a5\u53e3\u5bf9\u5bc4\u5b58\u5668\u8fdb\u884c\u8bfb\u5199\u64cd\u4f5c\u7684\u56de\u73af\u529f\u80fd\uff08loopback demo\uff09\u3002\u56e0\u6b64\uff0c\u5728\u8bfb\u64cd\u4f5c\u4e2d\u8fd4\u56de\u7684\u6570\u636e\u6b63\u662f\u4e4b\u524d\u901a\u8fc7\u5199\u64cd\u4f5c\u5199\u5165\u7684\u503c\uff08\u4f8b\u5982 <code>slv_reg0<\/code> \u7b49\uff09\u3002<\/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=\"366\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/04\/87d78763a3ddca00285b6d5e9114d1e-1024x366.png\" alt=\"\" class=\"wp-image-10195\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/04\/87d78763a3ddca00285b6d5e9114d1e-1024x366.png 1024w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/04\/87d78763a3ddca00285b6d5e9114d1e-300x107.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/04\/87d78763a3ddca00285b6d5e9114d1e-768x275.png 768w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/04\/87d78763a3ddca00285b6d5e9114d1e-1536x549.png 1536w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/04\/87d78763a3ddca00285b6d5e9114d1e.png 1771w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>\u8981\u5b9e\u73b0\u6211\u4eec\u81ea\u5df1\u7684\u6570\u636e\u5199\u5165\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5c06\u5730\u5740\u5207\u6362\u76844\u4e2acase \u7684\u8f93\u5165\u7aef\u6539\u6210\u81ea\u5df1\u7684\u5bc4\u5b58\u5668\u6216wire \u5373\u53ef\uff08\u5373\u5c06slv_reg0\u7b49\u5bc4\u5b58\u5668\u6362\u6210\u81ea\u5df1\u7684\u6570\u636e\uff09\u3002\u4e3a\u4e86\u65b9\u4fbf\u6f14\u793a\uff0c\u8fd9\u91cc\u6211\u4eec\u76f4\u63a5\u7ed9\u5b9a\u56fa\u5b9a\u768432\u4f4d\u6570\u5b57\uff08<strong>32&#8217;d1\uff0c32&#8217;d3\uff0c32&#8217;d5\uff0c32&#8217;d7<\/strong>\uff09\u3002\u5b9e\u9645\u5927\u5bb6\u53ef\u4ee5\u628a\u8fd9\u4e2a\u5e38\u6570\u6539\u6210\u81ea\u5df1\u8f93\u5165\u7684reg \u6216\u8005wire\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">assign slv_reg_rden = axi_arready &amp; S_AXI_ARVALID &amp; ~axi_rvalid;<br>\talways @(*)<br>\tbegin<br>\t      \/\/ Address decoding for reading registers<br>\t      case ( axi_araddr[ADDR_LSB+OPT_MEM_ADDR_BITS:ADDR_LSB] )<br><strong>\t        2'h0   : reg_data_out &lt;= 32'd1;<br>\t        2'h1   : reg_data_out &lt;= 32'd3;<br>\t        2'h2   : reg_data_out &lt;= 32'd5;<br>\t        2'h3   : reg_data_out &lt;= 32'd7;<br>\t        default : reg_data_out &lt;= 0;<\/strong><br>\t      endcase<br>\tend<\/pre>\n\n\n\n<p>\u4e4b\u540e\u6309\u4e0a\u6587\u4ecb\u7ecd\u7684\u6d41\u7a0b\u91cd\u65b0 \u6253\u5305IP\uff0c\u5e76\u4e14\u5728\u4e3b\u5de5\u7a0b\u4e2d\u91cd\u65b0\u66f4\u65b0IP\uff0c\u4ee5\u53ca\u5bf9\u5de5\u7a0b\u91cd\u65b0\u8fdb\u884c\u7f16\u8bd1\u7efc\u5408\u548cExport\u3002\uff08Export\u4e4b\u540e SDK\u4e5f\u4f1a\u63d0\u793a\u66f4\u65b0\uff0c\u70b9\u66f4\u65b0\u5373\u53ef\uff09<\/p>\n\n\n\n<p>\u5728SDK \u4e0b\u7684\u4ee3\u7801\u4e5f\u6bd4\u8f83\u7b80\u5355\uff0c\u7528\u4e00\u4e2afor \u5faa\u73af\u5206\u522b\u7528Xil_In32\u53bb\u8bfb\u8fd94\u4e2a\u5bc4\u5b58\u5668\u7684\u5730\u5740<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#include \"xparameters.h\"<br>#include \"xil_io.h\"<br><br>#define reg_base_addr 0x43c00000<br><br>int main()<br>{<br>    u32 reg_values[4];<br><br>    for (int i = 0; i &lt; 4; i++) {<br>        reg_values[i] = Xil_In32(reg_base_addr + i * 4); <br>    }<br><br>    while(1);<br><br>}<\/pre>\n\n\n\n<p>\u63a5\u4e0b\u6765\uff0c\u70b9\u51fb\u5de5\u5177\u680f\u4e0a\u7684\u5c0f\u7532\u866b\uff08Debug\uff09\u6309\u94ae\uff0c\u5c06\u7a0b\u5e8f\u4e0b\u8f7d\u5230\u5f00\u53d1\u677f\u5e76\u5f00\u59cb\u8c03\u8bd5\u3002\u5728 <code>while(1)<\/code> \u5904\u8bbe\u7f6e\u4e00\u4e2a\u65ad\u70b9\uff0c\u8fd0\u884c\u7a0b\u5e8f\u540e\uff0c\u5f53\u7a0b\u5e8f\u505c\u5728\u65ad\u70b9\u5904\u65f6\uff0c\u53ef\u4ee5\u89c2\u5bdf\u5230 <code>reg_values[i]<\/code> \u4e2d\u8bfb\u53d6\u5230\u7684\u6570\u636e\u6b63\u662f\u6211\u4eec\u5728 PL \u7aef\u9884\u8bbe\u7684 4 \u4e2a\u5e38\u6570\uff081\u30013\u30015\u30017\uff09\uff0c\u8fd9\u8bf4\u660e\u5bc4\u5b58\u5668\u8bfb\u53d6\u529f\u80fd\u5df2\u7ecf\u6210\u529f\u5b9e\u73b0\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"891\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/04\/image-85-1024x891.png\" alt=\"\" class=\"wp-image-10197\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/04\/image-85-1024x891.png 1024w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/04\/image-85-300x261.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/04\/image-85-768x668.png 768w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/04\/image-85.png 1153w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>\uff08\u672c\u90e8\u5206\u65b0\u589e\u52a0\uff0c\u6ca1\u6709\u63d0\u4f9b\u5de5\u7a0b\uff0c\u5927\u5bb6\u81ea\u884c\u5c1d\u8bd5\uff09<\/p>\n\n\n\n<p><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u672c\u6587\u7684\u5b8c\u6574\u5de5\u7a0b\u4e0b\u8f7d\uff1a<a href=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/13_PS_TO_PL_REG.zip\">13_PS_TO_PL_REG<\/a><\/strong><\/li>\n\n\n\n<li><strong>VIVADO\u7684\u7248\u672c\uff1a2018.3<\/strong><\/li>\n\n\n\n<li><strong>\u5de5\u7a0b\u521b\u5efa\u76ee\u5f55\uff1a E:\\Lemon_ZYNQ\\SDK\\13_PS_TO_PL_REG<\/strong><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>PS\u7aef\u4e0ePL\u7aef\u5728\u786c\u4ef6\u4e0a\u662f\u76f8\u4e92\u72ec\u7acb\u7684\uff0c\u4e4b\u524d\u53ef\u4ee5\u901a\u8fc7EMIO \u548c AXI GPIO\u7b49\u65b9\u5f0f \u8ba9ZYNQ PS \u7aef\u7684GPIO \u53e3\u6620\u5c04\u5230PL\u7aef\u4e0a\uff0c\u4f46\u662f\u4ec5\u4ec5\u53ea\u80fd\u63a7\u5236GPIO\u3002 \u672c\u6587\u4ecb\u7ecd\u4e00\u79cd\u65b0\u7684\u65b9\u6cd5\uff0c\u901a\u8fc7\u8ba9PS\u7aef\u8bbf\u95eePL\u7aef\u5bc4\u5b58\u5668\u7684\u65b9\u5f0f\uff0c\u6765\u8ba9ARM \u548cFPGA\u5b9e\u73b0\u7b80\u5355\u7684\u6570\u636e\u4ea4\u4e92\uff08\u5c0f\u6570\u636e\u91cf\uff09<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"class_list":["post-7679","post","type-post","status-publish","format-standard","hentry","category-lemon-zynq"],"views":2178,"_links":{"self":[{"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/posts\/7679","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/comments?post=7679"}],"version-history":[{"count":8,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/posts\/7679\/revisions"}],"predecessor-version":[{"id":10203,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/posts\/7679\/revisions\/10203"}],"wp:attachment":[{"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/media?parent=7679"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/categories?post=7679"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/tags?post=7679"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}