{"id":10624,"date":"2025-11-15T10:35:32","date_gmt":"2025-11-15T02:35:32","guid":{"rendered":"http:\/\/www.hellofpga.com\/?p=10624"},"modified":"2025-11-20T23:13:07","modified_gmt":"2025-11-20T15:13:07","slug":"block_ram_test","status":"publish","type":"post","link":"http:\/\/www.hellofpga.com\/index.php\/2025\/11\/15\/block_ram_test\/","title":{"rendered":"\u57fa\u4e8eSmart Artix \u7684FPGA\u5b9e\u9a8c\u4e5d\u00a0 FPGA\u7247\u5185\u8d44\u6e90 BLOCK RAM IP\u6838\u7684\u4f7f\u7528"},"content":{"rendered":"\n<p>\u51e0\u4e4e\u6240\u6709\u7684FPGA\u82af\u7247\u5185\u90e8\u90fd\u6709\u5b58\u50a8\u5355\u5143BLOCK RAM\uff0cArtix\u4e5f\u4e0d\u4f8b\u5916\uff0c\u672c\u6587\u5c06\u4e3b\u8981\u4ecb\u7ecdBRAM IP\u6838\u7684\u4f7f\u7528<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6b64\u7ae0\u8282\u5185\u5bb9\u9002\u7528\u4e8eSmart Artix \u7684\u4e3b\u677f \uff0c\u5982\u662f\u672c\u7ad9\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<p>\u5355\u7247\u673a\u548cSTM32\u8fd9\u6837\u7684\u5fae\u5904\u7406\u5668\u5185\u90e8\u6709RAM\u7528\u6765\u7f13\u5b58\u53d8\u91cf\uff0cFPGA\u4e5f\u4e0d\u4f8b\u5916\uff0c\u7528FPGA\u7684\u8bbe\u8ba1\u8fc7\u7a0b\u4e2d\u6211\u4eec\u4e5f\u9700\u8981\u7ecf\u5e38\u6027\u7684\u7f13\u5b58\u4e00\u4e9b\u6570\u636e\uff08\u5982\u4e2d\u95f4\u53d8\u91cf\uff0c\u56fe\u50cf\u7684\u4e34\u65f6\u6587\u4ef6\uff0c\u6216\u8005\u77e9\u9635\u8fd0\u7b97\u7684\u6a21\u677f\u7b49\uff09\uff0c\u90a3\u6211\u4eec\u5728FPGA\u7684\u8bbe\u8ba1\u4e2d\u53c8\u8be5\u5982\u4f55\u5b9e\u73b0\u6570\u636e\u7684\u6682\u5b58\u5462\uff0c\u6709\u5f88\u591a\u65b9\u6cd5\u3002 \u6211\u4eec\u53ef\u4ee5\u5c06\u8fd9\u4e9b\u6570\u636e\u5b58\u50a8\u5728\u82af\u7247\u5916\u90e8\u7684DDR\u548cSDRAM\u4e2d\uff0c\u4e5f\u53ef\u4ee5\u5b58\u50a8\u5728FPGA\u7684\u82af\u7247\u5185\u90e8\u3002<\/p>\n\n\n\n<p>FPGA\u7684\u82af\u7247\u5185\u90e8\u6709\u4e24\u79cd\u65b9\u5f0f\u6765\u5b9e\u73b0\u6570\u636e\u7684\u7f13\u5b58\u529f\u80fd\uff0c\u4e00\u79cd\u662f\u57fa\u4e8e\u786c\u4ef6\u7684BLOCK RAM\uff08\u53ef\u4ee5\u7406\u89e3\u4e3aFPGA\u5185\u90e8\u653e\u4e86\u4e00\u4e2aRAM\u82af\u7247\uff0c\u76f8\u5f53\u4e8e\u662f\u7269\u7406\u5b58\u50a8\u6a21\u5757\uff09\uff0c\u53e6\u4e00\u79cd\u662fDRAM\uff0c\uff08Distributed&nbsp;RAM\uff09\u7531fpga\u7684\u903b\u8f91\u8d44\u6e90\u62fc\u63a5\u51fa\u6765\u7684\u3002<\/p>\n\n\n\n<p>DRAM \u548cBRAM \u5404\u6709\u4f18\u7f3a\u70b9\uff0c\u6700\u660e\u663e\u7684\u533a\u522b\u662f BRAM\u4e0d\u5360\u7528FPGA\u903b\u8f91\u8d44\u6e90\uff0cDRAM\u9700\u8981\u5360\u7528LUT\u53ca\u67e5\u627e\u8868\uff0cBRAM \u4f7f\u7528\u8d77\u6765\u590d\u6742(\u9700\u8981\u65f6\u949f\u540c\u6b65\u5e76\u4e14\u7ed9\u4e00\u4e9b\u63a7\u5236\u4fe1\u53f7)\uff0cDRAM \u53ea\u9700\u8981\u7b80\u5355\u8c03\u7528\u67e5\u627e\u8868\u5c31\u597d\uff08\u53ef\u4ee5\u4e0d\u7528\u65f6\u949f\uff0c\u5f02\u6b65\u5b58\u50a8\u548c\u8bfb\u53d6\uff0c\u76f8\u5f53\u4e8e\u7ec4\u5408\u903b\u8f91\uff09\uff0c BRAM \u53ef\u4ee5\u5b58\u50a8\u6bd4\u8f83\u591a\u7684\u6570\u636e\uff0c \u800cDRAM\u53d7FPGA\u903b\u8f91\u8d44\u6e90\u95f2\u7f6e\u8f83\u5927\uff08\u901a\u5e38\u4ec5\u5c11\u91cf\u6570\u636e\u5982\u51e0\u4e2a\u5b57\u8282\u7684\u65f6\u5019\u63a8\u8350\u7528DRAM\uff0c\uff09\uff0c\u5f53\u6570\u636e\u8f83\u591a\u5982\u7f13\u5b58\u4e00\u884c\u56fe\u50cf\u6570\u636e\u6216\u8005\u5b58\u50a8\u5377\u79ef\u6a21\u677f\u7684\u65f6\u5019\u4f1a\u7528BRAM\uff08\u51e0K \u5230\u51e0\u767eK\uff09\uff0c \u5f53\u5b58\u50a8\u975e\u5e38\u5927\u7684\u6570\u636e \u5982\u6574\u5f20\u56fe\u50cf\uff08\u51e0M \u751a\u81f3\u51e0\u5341M\uff09\u65f6 \uff0c\u8fd9\u65f6\u5019\u63a8\u8350\u4f7f\u7528\u5916\u90e8\u5b58\u50a8\u82af\u7247\uff08SDRAM \u6216\u8005 DDR\uff09 \u5f53\u7136\u5982\u4f55\u53bb\u4f7f\u7528\u65b9\u6cd5\u4e0d\u662f\u56fa\u5b9a\u7684\uff0c\u53ea\u8981\u9879\u76ee\u7684\u7a0b\u5e8f\u80fd\u8dd1\u901a\uff0c\u54ea\u6015\u5916\u90e8\u6302\u4e2a\u5185\u5b58\u6761\u90fd\u6ca1\u4e8b\u3002<\/p>\n\n\n\n<p>\u6211\u4eec\u53ef\u4ee5\u5229\u7528BRAM \u751f\u6210\u591a\u79cd\u4e0d\u540c\u5f62\u5f0f\u7684RAM\uff0c\u6bd4\u65b9\u8bf4 ROM FIFO \u7b49\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e00\u3001Vivado\u5de5\u7a0b\u521b\u5efa<\/strong><\/h2>\n\n\n\n<p>\u5de5\u7a0b\u521b\u5efa\u7684\u8fc7\u7a0b\u53ef\u4ee5\u53c2\u8003\u5b9e\u9a8c\u4e00\u4e2d\u7684\u5185\u5bb9\uff0c\u8fd9\u91cc\u4e0d\u8be6\u7ec6\u63cf\u8ff0\u4e86\u3002<a href=\"http:\/\/www.hellofpga.com\/index.php\/2023\/04\/27\/smart-zynq_sp_sl_01_led\/\"><\/a><a href=\"http:\/\/www.hellofpga.com\/index.php\/2025\/11\/14\/led_test\/\">\u57fa\u4e8eSmart Artix \u7684FPGA\u5b9e\u9a8c\u4e00 \u7528FPGA\u8d44\u6e90\u70b9\u4eae\u4e00\u4e2aLED\uff08\u5b8c\u6574\u56fe\u6587\uff09<\/a>&nbsp;(\u82af\u7247\u578b\u53f7\u9009XC7A50TFGG484-2)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e8c\u3001\u6dfb\u52a0PLL IP\u6838<\/strong><\/h2>\n\n\n\n<p>1\uff09\u5728Vivado\u8f6f\u4ef6\u7684\u9009\u4e2d\u201cIP Catalog\u201d<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"233\" height=\"161\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-95.png\" alt=\"\" class=\"wp-image-1242\"\/><\/figure>\n\n\n\n<p>2\uff09\u5728\u5f39\u51fa\u7684\u7a97\u53e3\u4e2d\u641c\u7d22 BRAM \u5e76\u5728\u641c\u7d22\u51fa\u7684\u7ed3\u679c\u4e2d\u53cc\u51fbBlock Me\u3002\u8fdb\u5165\u65f6\u949f\u6a21\u5757\u8bbe\u7f6e\u5411\u5bfc<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"577\" height=\"401\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-107.png\" alt=\"\" class=\"wp-image-1289\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-107.png 577w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-107-300x208.png 300w\" sizes=\"auto, (max-width: 577px) 100vw, 577px\" \/><\/figure>\n\n\n\n<p>3\uff09Xilinx 7\u7cfb\u5217FPGA \u5185\u90e8\u7684BRAM \u53ef\u4ee5\u914d\u7f6e\u6210&nbsp;<strong>\u771f\u53cc\u53e3RAM<\/strong>\uff08True Dual-Port ram\uff0c\u80fd\u540c\u65f6\u8d1f\u8d23\u8bfb\u5199\uff09\uff0c<strong>\u7b80\u5355\u53cc\u53e3RAM<\/strong>\uff08Simple Dual-Port ram\uff0c\u4e00\u4e2a\u53ea\u80fd\u8d1f\u8d23\u8bfb \u4e00\u4e2a\u53ea\u80fd\u8d1f\u8d23\u5199\uff09<strong>\u5355\u7aef\u53e3RAM<\/strong>\uff08\u53ea\u6709\u4e00\u4e2a\u7aef\u53e3\uff09\u4ee5\u53caROM\uff0c\u5982\u4e0b\u56fe\u6240\u793a\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"677\" height=\"544\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-108.png\" alt=\"\" class=\"wp-image-1292\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-108.png 677w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-108-300x241.png 300w\" sizes=\"auto, (max-width: 677px) 100vw, 677px\" \/><\/figure>\n\n\n\n<p>4\uff09\u5404\u79cdRAM\u4f7f\u7528\u8d77\u6765\u5927\u540c\u5c0f\u5f02\uff0c \u6211\u4eec\u8fd9\u8fb9\u9009\u62e9\u4e00\u4e2a<strong>\u7b80\u5355\u53cc\u53e3RAM<\/strong>\u6765\u8fdb\u884c\u6f14\u793a\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"712\" height=\"584\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-109.png\" alt=\"\" class=\"wp-image-1293\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-109.png 712w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-109-300x246.png 300w\" sizes=\"auto, (max-width: 712px) 100vw, 712px\" \/><\/figure>\n\n\n\n<p>5\uff09\u63a5\u4e0b\u6765 \u8bbe\u7f6e A\u7aef\u53e3 \uff08\u8fd9\u91cc\u6211\u4eec\u521b\u5efa\u4e00\u4e2a8bit \u4f4d\u5bbd\uff0c16\u6df1\u5ea6\u7684\u4e00\u4e2aRAM\uff09 \u6df1\u5ea6\u4ee3\u8868\u6709\u591a\u5c11\u4e2a 8bit\u4f4d\u5bbd\u7684RAM\u5355\u5143\uff0c \u8fd9\u91cc\u752816 \u4e5f\u662f\u4e3a\u4e86\u65b9\u4fbf\u6f14\u793a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"713\" height=\"472\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-121.png\" alt=\"\" class=\"wp-image-1354\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-121.png 713w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-121-300x199.png 300w\" sizes=\"auto, (max-width: 713px) 100vw, 713px\" \/><\/figure>\n\n\n\n<p>\u5173\u4e8eOperating Mode\u9009\u9879 \u6709\u4e09\u79cd\u6a21\u5f0f\uff0c\u8bfb\u4f18\u5148\uff0c\u5199\u4f18\u5148\uff0c\u548c\u4fdd\u6301\u6a21\u5f0f\uff0c \u56e0\u4e3a\u6211\u4eec\u7528\u7684simple dual port ram \u5c5e\u4e8e \u4e24\u4e2a\u7aef\u53e3 \u4e00\u4e2a\u8d1f\u8d23\u5199 \u4e00\u4e2a\u8d1f\u8d23\u8bfb\uff0c\u6240\u4ee5\u8fd9\u8fb9 operating Mode\u9009\u4fdd\u6301\u6a21\u5f0f\u5c31\u597d<\/p>\n\n\n\n<p>6\uff09\u63a5\u4e0b\u6765\u662fB\u7aef\u53e3\u8bbe\u7f6e\uff0c \u4f4d\u5bbd\u548c\u6df1\u5ea6\u7cfb\u7edf\u9ed8\u8ba4\u4f1a\u548cA\u7aef\u53e3\u5339\u914d\uff0c\u8fd9\u91cc\u4e0d\u9700\u8981\u8fdb\u884c\u4fee\u6539\u3002\u8fd9\u91cc\u6709\u4e2a\u8f93\u51fa\u5bc4\u5b58\u5668\u9009\u9879 Primitives Output Register\u9700\u8981\u6ce8\u610f\u7cfb\u7edf\u9ed8\u8ba4\u662f\u6253\u5f00\u7684\uff0c\u8fd9\u6837BRAM \u7684B\u7aef\u53e3\u8bfb\u51fa\u7684\u6570\u636e\u4f1a\u7ecf\u8fc7\u4e00\u4e2a\u5bc4\u5b58\u5668\uff0c\u5728\u9ad8\u901f\u6d41\u6c34\u7ebf\u7684\u8bbe\u8ba1\u4e2d\uff0c\u53ef\u4ee5\u63d0\u9ad8\u65f6\u5e8f\u6027\u80fd\uff0c\u8ba9\u6570\u636e\u548c\u8f93\u51fa\u65f6\u949f\u540c\u6b65\uff0c\u4f46\u662f\u8fd9\u4f1a\u4f7f\u5f97BRAM\u8f93\u51fa\u7684\u6570\u636e\u5ef6\u8fdf\u4e00\u62cd\uff0c\u6240\u4ee5\u9700\u8981\u7279\u522b\u6ce8\u610f\uff08\u4e0b\u9762\u4f1a\u63d0\u5230\uff09\uff0c\u4e4b\u540e\u9009\u62e9OK \u751f\u6210IP \u6a21\u5757<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"649\" height=\"466\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-122.png\" alt=\"\" class=\"wp-image-1355\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-122.png 649w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-122-300x215.png 300w\" sizes=\"auto, (max-width: 649px) 100vw, 649px\" \/><\/figure>\n\n\n\n<p>\u5728\u5176\u4ed6\u9009\u9879\u91cc \u53ef\u4ee5\u5bfc\u5165\u521d\u59cb\u5316\u6587\u4ef6 \u6765\u7ed9RAM\u8d4b\u521d\u503c\uff0c \u8fd9\u91cc\u6211\u4eec\u7528\u4e0d\u5230 \u6240\u4ee5\u7559\u7a7a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"487\" height=\"194\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-123.png\" alt=\"\" class=\"wp-image-1364\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-123.png 487w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-123-300x120.png 300w\" sizes=\"auto, (max-width: 487px) 100vw, 487px\" \/><\/figure>\n\n\n\n<p>7\uff09\u4e4b\u540e\u70b9\u9009\u786e\u8ba4\u4fdd\u5b58\u5e76\u751f\u6210bram\u8d44\u6e90<\/p>\n\n\n\n<p>\u4e3a\u4e86\u8ba9BRAM \u7684\u8c03\u7528\u7ed3\u679c\u66f4\u76f4\u89c2\uff0c \u8fd9\u91cc\u6211\u4eec\u589e\u52a0\u4e00\u4e2aILA\u6a21\u5757\uff08ILA\u6a21\u5757\u76f8\u5f53\u4e8eFPGA\u5185\u90e8\u7684\u903b\u8f91\u5206\u6790\u4eea\u529f\u80fd\uff09<\/p>\n\n\n\n<p><strong>\u5728IP\u83dc\u5355\u91cc\u6dfb\u52a0ILA \u6a21\u5757<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"498\" height=\"332\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-5.png\" alt=\"\" class=\"wp-image-1457\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-5.png 498w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-5-300x200.png 300w\" sizes=\"auto, (max-width: 498px) 100vw, 498px\" \/><\/figure>\n\n\n\n<p>\u5c06\u63a2\u9488\u7684\u6570\u91cf\u4fee\u6539\u62106\uff08\u8fd9\u91cc\u6211\u4eec\u8981\u6293\u53d66\u4e2a\u4fe1\u53f7\uff09<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"676\" height=\"514\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-6.png\" alt=\"\" class=\"wp-image-1458\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-6.png 676w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-6-300x228.png 300w\" sizes=\"auto, (max-width: 676px) 100vw, 676px\" \/><\/figure>\n\n\n\n<p><br>\u5728ILA\u7684\u7b2c\u4e8c\u9875\u8bbe\u7f6e\u680f\uff0c\u5206\u522b\u8bbe\u7f6e\u6bcf\u4e00\u4e2a\u63a2\u9488\u7684\u4f4d\u5bbd<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"522\" height=\"349\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-7.png\" alt=\"\" class=\"wp-image-1459\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-7.png 522w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-7-300x201.png 300w\" sizes=\"auto, (max-width: 522px) 100vw, 522px\" \/><\/figure>\n\n\n\n<p>\u4e4b\u540e\u70b9\u9009OK \u4fdd\u5b58\u5e76\u751f\u6210ILA\u8d44\u6e90<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e09\u3001\u7a0b\u5e8f\u8bbe\u8ba1<\/strong><\/h2>\n\n\n\n<p>\u63a5\u4e0b\u6765\u662f\u672c\u6b21\u8bd5\u9a8c\u7684\u7a0b\u5e8f\u8bbe\u8ba1\u90e8\u5206\uff0c\u672c\u6b21\u7a0b\u5e8f\u8bbe\u8ba1\u5171\u52063\u4e2a\u9636\u6bb5<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7b2c\u4e00\u4e2a\u9636\u6bb5\uff08mode=0\uff09\u5bf9\u7cfb\u7edf\u4e2d\u7684\u5bc4\u5b58\u5668\uff08\u5305\u62ecbram \u8c03\u7528\u7684\u5730\u5740\uff0c\u8bfb\u5199\u4f7f\u80fd\u7b49\u5bc4\u5b58\u5668\uff09\u8fdb\u884c\u521d\u59cb\u5316\uff08mode 0\uff09<\/li>\n\n\n\n<li>\u7b2c\u4e8c\u4e2a\u9636\u6bb5\uff08mode=1\uff09(port a\u53e3\u7684\u5730\u5740\u4ece0-15\u8fdb\u884c\u81ea\u589e\uff0c\u5e76\u4e14\u5c06\u5bf9\u5e94\u76840-15\u5b58\u50a8\u5230bram\u5185\uff0c\u5b58\u50a8\u5b8c16\u4e2a\u6570\u5b57\u540e\uff0c\u5bf9port a\u7684\u8bfb\u5199\u529f\u80fd\u5207\u6362\u6210\u8bfb\uff0c\u5373\u4e0d\u518d\u5199\u5165\u6570\u636e\uff09<\/li>\n\n\n\n<li>\u7b2c\u4e09\u9636\u6bb5 \uff08mode=2\uff09\uff08port b\u53e3\u7684\u5730\u5740\u4ece0-15\u8fdb\u884c\u81ea\u589e\uff0c\u5e76\u4e14\u8bfb\u53d6port b \u7684\u8f93\u51fa\u6570\u636e\uff0c\u5f53\u81ea\u589e\u523015\u65f6\uff0c\u5c06mode\u7684\u503c\u8d4b\u503c\u4e3a3\uff09<\/li>\n\n\n\n<li>\u7b2c\u56db\u9636\u6bb5 \uff08mode=3\uff09\u4e0d\u505a\u4efb\u4f55\u64cd\u4f5c \u7ed9mode\u8d4b\u503c0 \u8ba9\u56db\u4e2a\u9636\u6bb5\u5faa\u73af\u8d77\u6765<strong>\uff08\u4e3a\u4ec0\u4e48\u8fd9\u91cc\u8981\u5faa\u73af\uff0c\u56e0\u4e3a\u5982\u679c\u4e0d\u589e\u52a0\u5faa\u73af\uff0c\u4e0a\u7535\u77ac\u95f4\u4f60\u8fd8\u6ca1\u7528ila\u5f00\u59cb\u6293\u6ce2\u5f62\uff0c\u4eba\u5bb6FPGA\u5df2\u7ecf\u5b8c\u6210\u4e86\u5168\u90e8\u7684\u8bfb\u5199\u64cd\u4f5c\uff0c\u4f60\u5c31\u770b\u4e0d\u5230\u5b8c\u6574\u7684\u8fc7\u7a0b\u4e86\uff0c\u6240\u4ee5\u8fd9\u91cc\u9700\u8981\u5bf9\u6574\u4e2a\u8fc7\u7a0b\u8fdb\u884c\u5faa\u73af\u53ef\u4ee5\u65b9\u4fbf\u89c2\u5bdf\uff09<\/strong><\/li>\n<\/ul>\n\n\n\n<p>\u4ee5\u4e0b\u662f\u5b8c\u6574\u7a0b\u5e8f<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">`timescale 1ns \/ 1ps\nmodule BRAM_TEST(\n    input CLK\n);\n     \nreg [3:0]addr_a;\nreg [3:0]addr_b;\nreg  wr_en_a;\nreg  [1:0]mode=2'd0;\nreg  [7:0]din_a;\nwire  [7:0]dout_b;\n\nalways@(posedge CLK)begin\n    if(mode==0)begin\n        addr_a&lt;=4'd0;\n        din_a&lt;=8'd0;\n        addr_b&lt;=4'd0;\n        wr_en_a&lt;=1'b1;\n        mode&lt;=2'd1;\n    end\n    else if(mode==1)begin\n        if(addr_a==4'd15)begin\n            mode&lt;=2'd2;\n            wr_en_a&lt;=1'b0;\n        end\n        else begin\n            addr_a&lt;=addr_a+1'b1;\n            din_a&lt;=din_a+1'b1;\n        end\n    end\n    else if(mode==2)begin\n        if(addr_b==4'd15)begin\n            mode&lt;=2'd3;\n        end\n        else addr_b&lt;=addr_b+1'b1;\n    end\n    else mode&lt;=2'd0;\nend\n\n\nblk_mem_gen_0 u_bram (\n  .clka(CLK),   \n  .ena(1'b1),    \n  .wea(wr_en_a),    \n  .addra(addr_a),\n  .dina(din_a),  \n  .clkb(CLK),   \n  .enb(1'b1),  \n  .addrb(addr_b), \n  .doutb(dout_b) \n);  \n\nila_0 ila_u (\n\t.clk(CLK),\n\t.probe0(mode),\n\t.probe1(wr_en_a),\n\t.probe2(addr_a), \n\t.probe3(din_a), \n\t.probe4(addr_b), \n\t.probe5(dout_b) \n);\n\nendmodule<\/pre>\n\n\n\n<p>\u672c\u7a0b\u5e8f\u4e2d\u4e00\u5171\u53ea\u6709\u4e00\u4e2aalways\u5757\uff0c\u6839\u636emode\u5bc4\u5b58\u5668\u503c\u7684\u4e0d\u540c\u5206\u522b\u6267\u884c\u4e0a\u9762\u63d0\u5230\u76844\u4e2a\u9636\u6bb5\u7684\u529f\u80fd\uff0c\u5176\u4e2d din_a\u548caddr_a\u7684\u503c\u4e00\u76f4\u76f8\u540c; \u4ee3\u8868\u6bcf\u4e2a\u5730\u5740\u5b58\u5165\u7684\u5185\u5bb9\u5373\u8be5\u5730\u5740\u7684\u5730\u5740\u53f7\uff0c\u4e5f\u5373\u662f\u5bf9\u5e94\uff080-15\uff09\u4e4b\u95f4\u7684\u6570\u5b57<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u56db\u3001\u6dfb\u52a0\u7ea6\u675f\u6587\u4ef6<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"># Clock Constraints<br>set_property PACKAGE_PIN Y18 [get_ports CLK]<br>set_property IOSTANDARD LVCMOS33 [get_ports CLK]<br><br># Define the clock period for 50 MHz<br>create_clock -period 20.000 -name CLK -waveform {0.000 10.000} [get_ports CLK]<br><\/pre>\n\n\n\n<p>\u4e4b\u540e\u8fdb\u884c\u7f16\u8bd1\u7efc\u5408<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e94\u3001\u5728\u7ebfILA \u89c2\u5bdf\u6ce2\u5f62\u770b\u8bd5\u9a8c\u7ed3\u679c<\/strong><\/h2>\n\n\n\n<p>\u5c06\u521a\u624d\u7f16\u8bd1\u7efc\u5408\u597d\u7684\u7a0b\u5e8f \u5bf9FPGA\u8fdb\u884cPROGRAM<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"357\" height=\"228\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-8.png\" alt=\"\" class=\"wp-image-1464\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-8.png 357w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-8-300x192.png 300w\" sizes=\"auto, (max-width: 357px) 100vw, 357px\" \/><\/figure>\n\n\n\n<p>\u4fdd\u6301\u9ed8\u8ba4\u9009\u9879\uff0c\u70b9\u9009program<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"609\" height=\"332\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-9.png\" alt=\"\" class=\"wp-image-1465\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-9.png 609w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-9-300x164.png 300w\" sizes=\"auto, (max-width: 609px) 100vw, 609px\" \/><\/figure>\n\n\n\n<p>\u4e4b\u540e\u7cfb\u7edf\u4f1a\u81ea\u52a8\u589e\u52a0\u4e00\u4e2aILA\u7a97\u53e3\uff08\u7a97\u53e3\u4e2d\u5305\u542b\u7740\u6211\u4eec\u4e4b\u524d\u7a0b\u5e8f\u4e2d\u7528\u63a2\u9488\u89c2\u5bdf\u7684\u6240\u6709\u4fe1\u53f7\uff09<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"894\" height=\"509\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-10.png\" alt=\"\" class=\"wp-image-1466\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-10.png 894w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-10-300x171.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-10-768x437.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>\u70b9\u9009\u7bad\u5934\uff0c\u5f00\u59cb\u6293\u53d6\u4fe1\u53f7<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"505\" height=\"210\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-11.png\" alt=\"\" class=\"wp-image-1467\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-11.png 505w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-11-300x125.png 300w\" sizes=\"auto, (max-width: 505px) 100vw, 505px\" \/><\/figure>\n\n\n\n<p>\u4e4b\u540e\u6211\u4eec\u8981\u89c2\u5bdf\u7684\u4fe1\u53f7\u5c31\u88ab\u6293\u53d6\u51fa\u6765\u4e86<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"988\" height=\"379\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-12.png\" alt=\"\" class=\"wp-image-1468\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-12.png 988w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-12-300x115.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-12-768x295.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>\u5982\u679c\u6570\u636e\u662f\u5341\u516d\u8fdb\u5236\u7684 \uff0c\u53ef\u4ee5\u5c06\u89c2\u5bdf\u7684\u4fe1\u53f7\u5168\u90e8\u9009\u4e2d\uff0c\u5207\u6362\u6570\u636e\u8fdb\u5236<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"687\" height=\"707\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-13.png\" alt=\"\" class=\"wp-image-1469\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-13.png 687w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-13-292x300.png 292w\" sizes=\"auto, (max-width: 687px) 100vw, 687px\" \/><\/figure>\n\n\n\n<p>\u4e0b\u56fe\u4e3a\u6293\u51fa\u6765\u7684\u6ce2\u5f62\u7ed3\u679c\uff0c\u8fd9\u91cc\u6709\u51e0\u4e2a\u5730\u65b9\u5907\u6ce8\u4e0b\uff0c\u8f93\u51fa\u8f93\u51fa\u662f\u8ddf\u5730\u5740\u6709\u4e24\u4e2a\u65f6\u949f\u8282\u62cd\u7684\u5ef6\u8fdf\uff08ram\u5757\u8bfb\u5165\u5730\u5740\uff0c\u5bf9\u5730\u5740\u6570\u636e\u8fdb\u884c\u8f93\u51fa\u8fd9\u4e2a\u8fc7\u7a0b\u662f\u9700\u8981\u65f6\u949f\u540c\u6b65\u7684\uff0c\u8fd9\u91cc\u6709\u4e00\u4e2a\u65f6\u949f\uff0c\u800c\u8f93\u51fa\u7684\u6570\u636e\u9700\u8981\u7ecf\u8fc7ram\u53e3\u7684\u5bc4\u5b58\u5668\uff0c\u8fd9\u91cc\u5c31\u662f\u7b2c\u4e8c\u4e2a\u65f6\u949f\uff09 \u7b2c\u4e8c\u4e2a\u65f6\u949f\u5ef6\u8fdf\u53ef\u4ee5\u5728\u4e4b\u524d\u8bbe\u7f6ebram\u7684\u754c\u9762\u628a\u8f93\u51fa\u5bc4\u5b58\u5668\u5173\u95ed\u6765\u53d6\u6d88\uff0c\u4f46\u662f\u5728\u9ad8\u901f\u8bbf\u95ee\u7684\u60c5\u51b5\u4e0b\u4e0d\u5229\u4e8e\u7cfb\u7edf\u7684\u7a33\u5b9a\u6027\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"344\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-14-1024x344-1.png\" alt=\"\" class=\"wp-image-1478\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-14-1024x344-1.png 1024w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-14-1024x344-1-300x101.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/11\/image-14-1024x344-1-768x258.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>\u7a0b\u5e8f\u6bd4\u8f83\u7b80\u5355\uff0c\u5728\u5b9e\u9645\u8c03\u7528BRAM\u6a21\u5757\u7684\u65f6\u5019\uff0c\u9664\u4e86\u7528ILA\u6765\u9a8c\u8bc1\uff0c\u4e5f\u53ef\u4ee5\u7528\u4eff\u771f\u7684\u65b9\u5f0f\u6765\u9a8c\u8bc1\u3002 \u53e6\u5916BRAM\u6a21\u5757\u5728\u4f7f\u7528\u7684\u8fc7\u7a0b\u4e2d\u5bf9\u8f93\u51fa\u5ef6\u65f6\u9700\u8981\u683c\u5916\u6ce8\u610f\uff08\u8fd9\u91cc\u5728\u5b9e\u9645\u9879\u76ee\u4e2d\u5f88\u5bb9\u6613\u5ffd\u89c6\u8f93\u51fa\u6570\u636e\u7684\u5ef6\u65f6\uff0c\u800c\u9020\u6210\u5b9e\u9645\u7684bug\uff09<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u672c\u7ae0\u8282\u7684\u5de5\u7a0b\uff1a<\/strong><\/h2>\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\/2025\/11\/09_BRAM_TEST.zip\">09_BRAM_TEST<\/a> \uff08Smart Artix 50T\uff09<\/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\uff1aE:\\Smart_Artix\\4_Code\\09_BRAM_TEST<\/strong><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u51e0\u4e4e\u6240\u6709\u7684FPGA\u82af\u7247\u5185\u90e8\u90fd\u6709\u5b58\u50a8\u5355\u5143BLOCK RAM\uff0cArtix\u4e5f\u4e0d\u4f8b\u5916\uff0c\u672c\u6587\u5c06\u4e3b\u8981\u4ecb\u7ecdBRAM IP\u6838\u7684\u4f7f\u7528<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[],"class_list":["post-10624","post","type-post","status-publish","format-standard","hentry","category-smart-artix"],"views":459,"_links":{"self":[{"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/posts\/10624","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=10624"}],"version-history":[{"count":10,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/posts\/10624\/revisions"}],"predecessor-version":[{"id":10720,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/posts\/10624\/revisions\/10720"}],"wp:attachment":[{"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/media?parent=10624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/categories?post=10624"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/tags?post=10624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}