{"id":3316,"date":"2023-02-23T09:49:36","date_gmt":"2023-02-23T01:49:36","guid":{"rendered":"http:\/\/www.hellofpga.com\/?p=3316"},"modified":"2023-02-23T09:49:36","modified_gmt":"2023-02-23T01:49:36","slug":"smart-zynq_simulation","status":"publish","type":"post","link":"http:\/\/www.hellofpga.com\/index.php\/2023\/02\/23\/smart-zynq_simulation\/","title":{"rendered":"Smart ZYNQ\u677f \u5de5\u7a0b\u5341 Vivado\u81ea\u5e26\u7684\u4eff\u771f\u529f\u80fd\u6f14\u793a"},"content":{"rendered":"\n<p>\u7528FPGA\u505a\u9879\u76ee\u7684\u65f6\u5019\uff0c\u5927\u90e8\u5206\u65f6\u95f4\u90fd\u82b1\u5728\u8c03\u8bd5\u4e0a\u4e86\uff0c\u8c03\u8bd5\u9664\u4e86\u677f\u5b50\u5b9e\u9645\u8dd1\u770b\u7ed3\u679c\u548c\u7528ILA\u8fdb\u884c\u8c03\u8bd5\u5916\uff0c\u8fd8\u53ef\u4ee5\u7528\u8f6f\u4ef6\u8fdb\u884c\u4eff\u771f\uff0c\u672c\u6587\u5c31\u7b80\u5355\u6f14\u793a\u4e0b XILINX\u81ea\u5e26\u7684\u4eff\u771f\u529f\u80fd\u3002<\/p>\n\n\n\n<p><strong>\u672c\u6587\u5728 vivado2018.3\u7248\u672c\u4e0a \u6f14\u793a\uff0c \u5176\u4ed6\u7248\u672c\u8bf7\u81ea\u884c\u7814\u7a76<\/strong><\/p>\n\n\n\n<p>\u4eff\u771f\u5728\u6211\u4eec\u7684\u8bbe\u8ba1\u4e2d\u662f\u975e\u5e38\u91cd\u8981\u7684\uff0c \u5f53\u6211\u4eec\u7f16\u5199\u7684\u903b\u8f91\u6bd4\u8f83\u590d\u6742\u65f6\uff0c\u7528vivado \u5e03\u7ebf\u7efc\u5408\u52a8\u8f84\u51e0\u5341\u5206\u949f\u751a\u81f3\u51e0\u4e2a\u5c0f\u65f6\uff0c\u6709\u65f6\u5019\u597d\u4e0d\u5bb9\u7efc\u5408\u597d\uff0c\u751f\u6210bit\u4e0b\u8f7d\u8fdb\u53bb\uff0c\u53c8\u53d1\u73b0\u6211\u4eec\u7684\u903b\u8f91\u6709\u95ee\u9898\uff0c\u8fd9\u65f6\u5019\u518d\u4fee\u6539\uff0c\u518d\u4e0b\u8f7d\u53ef\u80fd\u53c8\u8981\u82b1\u53bb\u5f88\u591a\u65f6\u95f4\uff0c\u751a\u81f3\u8fd8\u4e0d\u4e00\u5b9a\u627e\u5230\u95ee\u9898\u70b9\uff0c \u8fd9\u4e2a\u65f6\u5019\u4eff\u771f\u7684\u91cd\u8981\u6027\u5c31\u51f8\u663e\u51fa\u6765\u4e86\u3002<\/p>\n\n\n\n<p>\u4eff\u771f\u529f\u80fd\u548cila \u4e0d\u540c\uff0cila\u529f\u80fd\u53ef\u4ee5\u7406\u89e3\u4e3a\u662fFPGA\u5185\u90e8\u7684\u903b\u8f91\u5206\u6790\u4eea\uff0c\u76f8\u5f53\u4e8e\u5bf9FPGA\u5185\u90e8\u7684\u4fe1\u53f7\u6ce2\u5f62\u8fdb\u884c\u91c7\u96c6\u5e76\u4e14\u4e0a\u4f20\u5230\u8f6f\u4ef6\u8fdb\u884c\u663e\u793a\uff0c\u800c\u4eff\u771f\u529f\u80fd\u76f8\u5f53\u4e8e\u662f\u6839\u636e\u6211\u4eec\u6240\u5199\u7684\u903b\u8f91\u6a21\u62df\u4eff\u771f\u51fa\u7ed3\u679c\u4ee5\u53ca\u5404\u4e2a\u4e2d\u95f4\u7684\u4fe1\u53f7\u6ce2\u5f62\uff0c\u901a\u8fc7\u4eff\u771f\u6211\u4eec\u53ef\u4ee5\u5728\u7a0b\u5e8f\u8bbe\u8ba1\u7684\u8fc7\u7a0b\u4e2d\u5c31\u5224\u65ad\u51fa\u5404\u4e2a\u6a21\u5757\u5de5\u4f5c\u662f\u5426\u7b26\u5408\u9884\u671f\uff0c\u662f\u5426\u6709\u610f\u60f3\u4e0d\u5230\u7684\u95ee\u9898\u7b49\u3002<\/p>\n\n\n\n<p>\u4eff\u771f\u8fd8\u6709\u4e2a\u4f18\u52bf\u662f\uff0c\u4eff\u771f\u53ef\u4ee5\u4ece0\u65f6\u523b\u5c31\u5f00\u59cb\u89c2\u5bdf\u6ce2\u5f62\uff0c\u800c\u4e14\u53ef\u4ee5\u6dfb\u52a0\u5927\u91cf\u7684\u89c2\u5bdf\u4fe1\u53f7\uff0c\u8fd9\u4e2a\u662f\u4e0b\u8f7d\u5230\u677f\u5b50\u4e0a\u89c2\u5bdf\u7ed3\u679c\uff0c\u6216\u8005\u7528ila\u6293\u6ce2\u5f62\u65e0\u6cd5\u6bd4\u62df\u7684\u3002<\/p>\n\n\n\n<p>\u65b0\u624b\u4f1a\u6bd4\u8f83\u6297\u62d2\u4eff\u771f\uff0c\u4e0d\u8fc7\u5982\u679c\u719f\u7ec3\u638c\u63e1\u4eff\u771f\u6280\u80fd\uff0c\u53ef\u4ee5\u4e8b\u534a\u529f\u500d\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4eff\u771f\u5b9e\u9645\u6f14\u793a<\/h2>\n\n\n\n<p>\u672c\u6587\u7528\u4e00\u4e2a\u8ba1\u6570\u5668\u7684\u7b80\u5355\u5de5\u7a0b\u6765\u6f14\u793a\u4e0b ILA\u529f\u80fd\u6a21\u5757\u7684\u4f7f\u7528\u3002<\/p>\n\n\n\n<p>\u672c\u6587\u5728 vivado2018.3\u7248\u672c\u4e0a \u6f14\u793a\uff0c \u5176\u4ed6\u7248\u672c\u8bf7\u81ea\u884c\u7814\u7a76<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>1\u3001\u5177\u4f53\u6b65\u9aa4<\/strong><\/h1>\n\n\n\n<p>1) \u5177\u4f53\u6b65\u9aa4 \u65b0\u5efa\u4e00\u4e2aVIVADO \u5de5\u7a0b\uff0c\u6253\u5f00\u8f6f\u4ef6 \u9009\u4e2dCreate Project, \u5982\u4e0b\u56fe\u6240\u793a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"230\" height=\"136\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/07\/Create-Project.png\" alt=\"\" class=\"wp-image-35\"\/><\/figure>\n\n\n\n<p>2\uff09\u70b9\u51fbNEXT \uff0c\u5728\u51fa\u73b0\u7684\u7b2c\u4e8c\u4e2a\u5bf9\u8bdd\u6846\u201cProject name\u201d\u4e2d\u8f93\u5165\u5de5\u7a0b\u540d\uff1b\u5728\u201cProject location\u201d\u4e2d\u9009\u62e9\u4fdd\u5b58\u8def\u5f84\uff1b\u52fe\u9009\u201cCreate project subdirectory\u201d\uff0c\u6700\u540e\u70b9\u51fb\u201cNext\u201d&nbsp;<strong>\u5907\u6ce8\uff0c\u6240\u6709\u7684\u8def\u5f84\u5747\u4e0d\u80fd\u51fa\u73b0\u4e2d\u6587\u540d\u79f0<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"570\" height=\"175\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-86.png\" alt=\"\" class=\"wp-image-3271\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-86.png 570w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-86-300x92.png 300w\" sizes=\"auto, (max-width: 570px) 100vw, 570px\" \/><\/figure>\n\n\n\n<p>3)\u70b9\u51fb RTL PROJECT \u9009\u9879\uff0c\u70b9\u51fbNEXT<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"681\" height=\"466\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/07\/image.png\" alt=\"\" class=\"wp-image-40\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/07\/image.png 681w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/07\/image-300x205.png 300w\" sizes=\"auto, (max-width: 681px) 100vw, 681px\" \/><\/figure>\n\n\n\n<p>4\uff09 \u7b2c\u56db\u6b65Add Sources \u9009\u9879\u76f4\u63a5\u7559\u7a7a\uff0cNEXT<\/p>\n\n\n\n<p>5\uff09\u7b2c\u4e94\u6b65Add Constraints \u9009\u9879\u76f4\u63a5\u7559\u7a7a\uff0cNEXT<\/p>\n\n\n\n<p>6\uff09\u9009\u62e9\u82af\u7247\u578b\u53f7 \u6211\u4eec\u677f\u5b50\u4e0a\u7528\u7684\u82af\u7247\u662fXC7Z010 \uff0c\u5e76\u5728\u5217\u8868\u680f\u4e2d\u9009\u62e9\u5bf9\u5e94\u7684\u5c01\u88c5\u578b\u53f7\uff0c\u5b8c\u6574\u578b\u53f7\u662fXC7Z010CLG400-1 \u5982\u4e0b\u6240\u793a\uff0c\u9009\u4e2d\u540e\u70b9NEXT<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"774\" height=\"622\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/07\/image-1.png\" alt=\"\" class=\"wp-image-42\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/07\/image-1.png 774w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/07\/image-1-300x241.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/07\/image-1-768x617.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\u786e\u8ba4\u6240\u9009\u4fe1\u606f \u70b9\u51fb\u201cFinish\u201d\uff0c\u5b8c\u6210vivado\u7684\u5de5\u7a0b\u521b\u5efa<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"650\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/07\/image-4.png\" alt=\"\" class=\"wp-image-46\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/07\/image-4.png 770w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/07\/image-4-300x253.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/07\/image-4-768x648.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>2&nbsp;<\/strong>\u589e\u52a0\u6211\u4eec\u7684verilog\u903b\u8f91<\/h2>\n\n\n\n<p>1\uff09\u5728\u4e3b\u754c\u9762\u70b9\u51fb\u5de6\u4fa7 Add Sources ,\u70b9\u51fb \u590d\u9009\u6846\u7684Add or create design sources \u9009\u9879 \u5e76\u70b9\u51fbNEXT<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"595\" height=\"389\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/07\/image-5.png\" alt=\"\" class=\"wp-image-48\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/07\/image-5.png 595w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/07\/image-5-300x196.png 300w\" sizes=\"auto, (max-width: 595px) 100vw, 595px\" \/><\/figure>\n\n\n\n<p>2\uff09\u5728\u51fa\u73b0\u7684Add Sources \u4e2d \u9009\u62e9\u521b\u5efa\u65b0\u6587\u4ef6 Create FILE \u5982\u4e0b\u56fe\u6240\u793a\uff0c\u5e76\u5728\u5f39\u51fa\u7684\u7a97\u53e3\u4e2d \u9009\u62e9\u7c7b\u522b\u4e3aVerilog \uff0c\u5728FILE name\u4e2d\u586b\u5199\u6587\u4ef6\u7684\u540d\u79f0\uff0c\u8fd9\u91cc\u7528\u201dcount_module\u201d \u4ee3\u66ff\uff0c\u70b9\u51fbOK \u5e76\u70b9\u51fbFINISH<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"432\" height=\"311\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-87.png\" alt=\"\" class=\"wp-image-3272\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-87.png 432w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-87-300x216.png 300w\" sizes=\"auto, (max-width: 432px) 100vw, 432px\" \/><\/figure>\n\n\n\n<p>3\uff09\u5728\u8df3\u51fa\u7684\u7a97\u53e3\u4e2d\u53ef\u4ee5\u586b\u5199\u6a21\u5757\u7684\u8f93\u5165\u8f93\u51fa\u4fe1\u53f7\uff0c\u7531\u4e8e\u8fd9\u90e8\u5206\u5de5\u4f5c\u5728\u4ee3\u7801\u4e2d\u53ef\u4ee5\u5b8c\u6210\uff0c\u6240\u4ee5\u8fd9\u91cc\u76f4\u63a5\u70b9OK \u5b8c\u6210VERILOG \u6587\u4ef6\u7684\u521b\u5efa<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"298\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-88.png\" alt=\"\" class=\"wp-image-3274\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-88.png 602w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-88-300x149.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/figure>\n\n\n\n<p>1.2 \u4ee3\u7801\uff1a\u8fd9\u91cc\u6211\u4eec\u4ee3\u7801\u4e0a\u505a\u4e00\u4e2a\u7b80\u5355\u7684\u529f\u80fd\uff0cFPGA\u82af\u7247\u5185\u90e8\u8ba1\u6570\u5668time_count\u6bcf\u6ee1100\u6b21\u8ba1\u6570\uff080-99\uff09result\u5bc4\u5b58\u5668\u7ffb\u8f6c\u4e00\u6b21\uff08\u4ece1\u53d8\u62100\uff0c\u6216\u8005\u4ece0\u53d8\u62101\uff09 \uff0c<strong>&nbsp;\u7a0b\u5e8f\u548c\u5de5\u7a0b\u4e00\u5f88\u50cf\uff0c\u4f46\u662f\u4e3a\u4e86\u6f14\u793a\uff0c\u6240\u4ee5\u7f29\u77ed\u4e86\u8ba1\u6570\u5668\u7684\u65f6\u95f4<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"815\" height=\"479\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-89.png\" alt=\"\" class=\"wp-image-3275\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-89.png 815w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-89-300x176.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-89-768x451.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted\">`timescale 1ns \/ 1ps\nmodule count_module(\n     input clk,\n     input rst_n\n );\n parameter T1MS = 7'd99; \/\/50M\u6676\u632f\u65f6\u949f\n reg [7:0]time_count;\/\/\u65f6\u949f\u8ba1\u6570\u5668\n reg result;\n always@(posedge clk or negedge rst_n)\n     if(!rst_n)begin\n        time_count&lt;=26'd0;\n        result&lt;=1'b0;\n     end\n     else if(time_count&gt;=T1MS)begin\n         time_count&lt;=26'd0;\n         result&lt;=~result;\n     end\n     else time_count&lt;=time_count+1'b1;   \nendmodule\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">3.\u521b\u5efa\u4eff\u771f\u6587\u4ef6<em>testbench<\/em><\/h2>\n\n\n\n<p>1\uff09\u56de\u5230\u4e3b\u754c\u9762\u70b9\u51fb\u5de6\u4fa7 Add Sources ,\u70b9\u51fb \u590d\u9009\u6846\u7684Add or createsimulation sources \u9009\u9879 \u5e76\u70b9\u51fbNEXT<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"801\" height=\"289\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-90.png\" alt=\"\" class=\"wp-image-3279\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-90.png 801w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-90-300x108.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-90-768x277.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>2\uff09\u70b9\u9009Create File \u5728\u5f39\u51fa\u7684\u5bf9\u8bdd\u6846\u91cc\u8f93\u5165 testbench \u7684\u540d\u79f0\uff08\u8fd9\u91cc\u7528count_tb\u4ee3\u66ff\uff0c\u5176\u4e2dtb\u4ee3\u8868testbench\u7684\u7f29\u5199\uff09\uff0c\u968f\u540e\u70b9OK<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"704\" height=\"289\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-91.png\" alt=\"\" class=\"wp-image-3280\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-91.png 704w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-91-300x123.png 300w\" sizes=\"auto, (max-width: 704px) 100vw, 704px\" \/><\/figure>\n\n\n\n<p>3\uff09\u5728\u4e0b\u4e00\u4e2a\u5bf9\u8bdd\u6846\u9009\u62e9OK \u5e76\u5728\u5f39\u51fa\u7684\u5bf9\u9ec4\u6846\u91cc\u9009\u62e9YES<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"567\" height=\"367\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-92.png\" alt=\"\" class=\"wp-image-3281\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-92.png 567w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-92-300x194.png 300w\" sizes=\"auto, (max-width: 567px) 100vw, 567px\" \/><\/figure>\n\n\n\n<p>4\uff09\u6b64\u65f6\u5c31\u80fd\u5728\u5de5\u7a0b\u7684\u4eff\u771f\u76ee\u5f55\u91cc\u627e\u5230\u6211\u4eec\u521a\u624d\u521b\u5efa\u7684count_tb.v\u6587\u4ef6\u4e86<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"382\" height=\"303\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-93.png\" alt=\"\" class=\"wp-image-3283\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-93.png 382w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-93-300x238.png 300w\" sizes=\"auto, (max-width: 382px) 100vw, 382px\" \/><\/figure>\n\n\n\n<p>\u53cc\u51fb\u6253\u5f00 count_tb.v \u7136\u540e\u5728\u91cc\u9762\u6dfb\u52a0testbench \u7684\u6fc0\u52b1\u4ee3\u7801<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">`timescale 1ns \/ 1ps\nmodule count_tb(\n\n    );\n    \nreg    clk_i;\nreg    rst_n_i;\n\ninitial begin    \n      clk_i = 0;\n      rst_n_i = 0;\n      #200;\n      rst_n_i = 'b1;\n  end\n\nalways #5 clk_i = ~clk_i;\n\ncount_module u_test(  \n    .clk(clk_i),   \n    .rst_n(rst_n_i)\n);\n\n  \n\nendmodule\n<\/pre>\n\n\n\n<p><strong>\u5907\u6ce8 \uff1atestbench \u7684\u5199\u6cd5\u548c\u6807\u51c6\u7684\u903b\u8f91\u6709\u70b9\u533a\u522b\uff0c\u5e76\u4e14\u5927\u90e8\u5206\u7684testbench\u4ee3\u7801\u90fd\u662f\u4e0d\u53ef\u7efc\u5408\u7684<\/strong><\/p>\n\n\n\n<p>testbench \u5185\u5bb9\u6ce8\u91ca\uff1a initial \u6a21\u5757 \u662f\u4ece0\u65f6\u523b\u5f00\u59cb\u5c31\u5de5\u4f5c\u7684\uff0c \u53ea\u6267\u884c\u4e00\u6b21\uff0c #200\u76f8\u5f53\u4e8e\u5ef6\u8fdf200\u4e2a\u5355\u4f4d\u5468\u671f\uff08\u5907\u6ce8 \u8fd9\u53e5\u662f\u4e0d\u53ef\u7efc\u5408\u8bed\u53e5\uff09<\/p>\n\n\n\n<p>#200\uff1b \u540e\u518d\u8ddf rst_n_i=1\u2019b1; \u4ee3\u8868 200\u4e2a\u5355\u4f4d\u65f6\u95f4\u540e rst\u75310\u7f6e\u4f4d\u52301<\/p>\n\n\n\n<p>always #5 clk_i = ~clk_i; \u4ee3\u8868\u6bcf5\u4e2a\u5355\u4f4d\u65f6\u95f4 \u7ffb\u8f6c\u4e00\u6b21\uff0c\u4e5f\u5c31\u662f10\u4e2a\u5355\u4f4d\u65f6\u95f4\u4e3a\u4e00\u4e2a\u5468\u671f<\/p>\n\n\n\n<p>\u81f3\u4e8e\u4eff\u771f\u7684\u65f6\u95f4\u5355\u4f4d \u5219\u5728\u7a0b\u5e8f\u7684\u6700\u9876\u7aef \u63cf\u8ff0 `timescale 1ns \/ 1ps \/\/\u4eff\u771f\u65f6\u95f4\u5355\u4f4d\/\u4eff\u771f\u65f6\u95f4\u7cbe\u5ea6<\/p>\n\n\n\n<p>count_module u_test\uff08\uff09\u76f8\u5f53\u4e8e\u662f\u5bf9count_module\u7684\u7a0b\u5e8f\u5b9e\u4f8b\u5316\u5e76\u4e14\u547d\u540d\u4e3au_test<\/p>\n\n\n\n<p>5\uff09\u4eff\u771f\u4ee3\u7801\u7f16\u5199\u5b8c\u6210\u540e\uff0c\u4fdd\u5b58\u8be5\u6587\u4ef6<\/p>\n\n\n\n<p><strong>\u4e5f\u53ef\u4ee5\u6309\u4e0b\u7eff\u8272\u7bad\u5934 \u9884\u7f16\u8bd1\u4e00\u4e0b\u770b\u770b \u4ee3\u7801\u6709\u6ca1\u6709\u62a5\u9519<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u8fdb\u884c\u4eff\u771f<\/h2>\n\n\n\n<p>1\uff09 \u70b9\u9009 Run Behavioral simulation\u542f\u52a8\u4eff\u771f<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"446\" height=\"131\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-95.png\" alt=\"\" class=\"wp-image-3288\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-95.png 446w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-95-300x88.png 300w\" sizes=\"auto, (max-width: 446px) 100vw, 446px\" \/><\/figure>\n\n\n\n<p>\u5907\u6ce8\uff1a\u5176\u4ed6\u51e0\u4e2a\u9009\u9879\u5206\u522b\u4ee3\u8868 Run Behavior Simulation \u529f\u80fd\u4eff\u771f \uff0cRun Post-Systhesis Functional Simulation \u7efc\u5408\u540e\u7684\u529f\u80fd\u4eff\u771f\uff0cRun Post-Systhesis Timing Simulation \u7efc\u5408\u540e\u7684\u65f6\u5e8f\u4eff\u771f\uff0cRun Post-Implementation Functional Simulation \u5b9e\u73b0\u540e\/\u5e03\u5c40\u5e03\u7ebf\u540e\u7684\u529f\u80fd\u4eff\u771f\uff0cRun Post-Implementation Timing Simulation \u5b9e\u73b0\u540e\/\u5e03\u5c40\u5e03\u7ebf\u540e\u7684\u65f6\u5e8f\u4eff\u771f \u4e00\u822c\u6211\u4eec\u9009\u62e9\u529f\u80fd\u4eff\u771f\u5373\u53ef\u3002<\/p>\n\n\n\n<p>2\uff09\u63a5\u4e0b\u6765\u5c31\u51fa\u73b0\u4e86\u6211\u4eec\u7684\u4eff\u771f\u4e3b\u754c\u9762<\/p>\n\n\n\n<p>\u5176\u4e2d Scope \u7a97\u53e3 \u6211\u4eec\u8bbe\u8ba1\u7684\u5c42\u6b21\u5212\u5206\uff0c \u5f53\u6211\u4eec\u9009\u4e2dScope\u7a97\u53e3\u4e2d\u7684\u4efb\u610f\u6a21\u5757\uff0c\u5bf9\u5e94\u6a21\u5757\u7684\u4fe1\u53f7\u5bc4\u5b58\u5668\u90fd\u4f1a\u51fa\u73b0\u5728 Objects\u7a97\u53e3\u4e2d<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"220\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-96-1024x220.png\" alt=\"\" class=\"wp-image-3289\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-96-1024x220.png 1024w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-96-300x65.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-96-768x165.png 768w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-96-1536x331.png 1536w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-96.png 1538w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>3)\u8fd9\u91cc\u6211\u4eec\u53f3\u952e\u6211\u4eec\u4f8b\u5316\u7684 u_test\u6a21\u5757\uff0c\u5e76\u4e14\u9009\u62e9Add to Wave Window \u5c06u_test\u4e0b\u7684\u6240\u6709\u4fe1\u53f7\u6dfb\u52a0\u5230\u89c2\u5bdf\u7a97\u53e3<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"544\" height=\"274\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-97.png\" alt=\"\" class=\"wp-image-3291\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-97.png 544w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-97-300x151.png 300w\" sizes=\"auto, (max-width: 544px) 100vw, 544px\" \/><\/figure>\n\n\n\n<p>\u8fd9\u6837\u89c2\u5bdf\u7a97\u53e3\u5c31\u4f1a\u51fa\u73b0\u6211\u4eec\u9700\u8981\u7684\u4fe1\u53f7\u548c\u5bc4\u5b58\u5668\u4e86<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"647\" height=\"305\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-98.png\" alt=\"\" class=\"wp-image-3293\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-98.png 647w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-98-300x141.png 300w\" sizes=\"auto, (max-width: 647px) 100vw, 647px\" \/><\/figure>\n\n\n\n<p>4\uff09\u56e0\u4e3a\u4e0a\u9762\u7684\u4fe1\u53f7\u662f\u65b0\u6dfb\u52a0\u7684\uff0c\u6240\u4ee5\u8fd9\u91cc\u9700\u8981rerun \u4e00\u4e0b\u4eff\u771f\uff0c\u518d\u70b9Run all\uff08\u5982\u679c\u4e0drerun\u7684\u8bdd\uff0c\u65b0\u6dfb\u52a0\u7684\u4fe1\u53f7\u7ebf\u5c06\u4e0d\u4f1a\u6709\u6ce2\u5f62\uff09<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"972\" height=\"408\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-100.png\" alt=\"\" class=\"wp-image-3295\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-100.png 972w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-100-300x126.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-100-768x322.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>\u7528\u9f20\u6807\u7f29\u5c0f \uff0c\u5e76\u5c06\u6ce2\u5f62\u50cf\u5de6\u62c9\u5230\u6700\u5f00\u59cb\u7684\u5730\u65b9\u53ef\u4ee5\u770b\u5230<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"366\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-101.png\" alt=\"\" class=\"wp-image-3297\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-101.png 872w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-101-300x126.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-101-768x322.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>\u6211\u4eec\u7684\u4eff\u771f\u5df2\u7ecf\u6b63\u5e38\u5f00\u59cb\u5de5\u4f5c\u4e86\uff0c \u5e76\u4e14\u53ef\u4ee5\u770b\u5230 rst_n\u662f\u5728\u7b2c200ns \u5f00\u59cb\u7531\u4f4e\u53d8\u9ad8\uff0c\u8ddf\u6211\u4eec\u8bbe\u5b9a\u7684\u76f8\u540c\uff0c \u800cclk_i\u5219\u662f\u4e00\u76f4\u4ee510ns\u4e3a\u5468\u671f\u5728\u5de5\u4f5c<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"656\" height=\"257\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-102.png\" alt=\"\" class=\"wp-image-3298\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-102.png 656w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-102-300x118.png 300w\" sizes=\"auto, (max-width: 656px) 100vw, 656px\" \/><\/figure>\n\n\n\n<p>\u5c55\u5f00\u6ce2\u5f62 \u53f3\u952e\u70b9time_count\u8ba1\u6570\u5668 \u5728Radix \u4e2d\u5c06\u6211\u4eec\u6570\u636e\u683c\u5f0f\u6539\u6210unsigned Decimal \uff0c\u65e0\u7b26\u53f7\u5341\u8fdb\u5236<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"521\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-103-1024x521.png\" alt=\"\" class=\"wp-image-3300\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-103-1024x521.png 1024w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-103-300x153.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-103-768x391.png 768w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-103.png 1324w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>\u53ef\u4ee5\u89c2\u5bdf\u5230\u6211\u4eec\u7684\u8ba1\u6570\u5668 \u4ece\u590d\u4f4d\u4fe1\u53f7\u62c9\u9ad8\u540e\u7684\u7b2c\u4e8c\u4e2a\u4e0a\u5347\u6cbf\u5f00\u59cb\uff0c\u8ba1\u6570\u5668\u4ece0-1\u5f00\u59cb\u81ea\u589e\uff0c\u5e76\u4e14\u6bcf\u6765\u4e00\u4e2a\u4e0a\u5347\u6cbf\u81ea\u589e\u4e00\u6b21<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"213\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-104-1024x213.png\" alt=\"\" class=\"wp-image-3301\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-104-1024x213.png 1024w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-104-300x62.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-104-768x160.png 768w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-104.png 1061w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>\u5f53\u8ba1\u6570\u5668\u81ea\u589e\u5230\u7b2c99\u4e4b\u540e\uff0c\u4e0b\u4e00\u4e2a\u4e0a\u5347\u6cbf\uff0c\u8ba1\u6570\u5668\u4ece99\u53d8\u4e3a0\uff0c\u5e76\u4e14result\u4fe1\u53f7\u7ffb\u8f6c\u4e00\u6b21<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"373\" height=\"162\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-105.png\" alt=\"\" class=\"wp-image-3303\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-105.png 373w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-105-300x130.png 300w\" sizes=\"auto, (max-width: 373px) 100vw, 373px\" \/><\/figure>\n\n\n\n<p>\u7f29\u5c0f\u6ce2\u5f62\u53ef\u4ee5\u770b\u5230\uff0cresult\u5bc4\u5b58\u5668\u6b63\u5728\u4ee51us\uff08100\u4e2a10ns\uff0c\u56e0\u4e3a\u8ba1\u6570\u5668\u662f\u8ba1\u65700-99\u7684\uff09\u7684\u95f4\u9694 \u57280-1\u4e4b\u95f4\u6765\u56de\u632f\u8361 \u5468\u671f\u662f2us<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1013\" height=\"252\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-106.png\" alt=\"\" class=\"wp-image-3304\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-106.png 1013w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-106-300x75.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-106-768x191.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>\u5f53\u7136\u6211\u4eec\u4e5f\u53ef\u4ee5\u53f3\u952e\u9009\u4e2d\u6211\u4eec\u7684time_count\u8ba1\u6570\u5668\u70b9\u9009Waveform Style \u2013&gt; Analog \u6765\u663e\u793a\u6570\u503c\u5bf9\u5e94\u7684\u6a21\u62df\u6ce2\u5f62\uff08\u5982\u6b63\u5f26\u6ce2\u4e09\u89d2\u6ce2\u7b49\uff09<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"913\" height=\"406\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-107.png\" alt=\"\" class=\"wp-image-3308\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-107.png 913w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-107-300x133.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-107-768x342.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>\u8fd9\u91cc\u56e0\u4e3acount\u662f\u4ece0-99 \u518d\u52300\uff0c\u6240\u4ee5\u5916\u5f62\u770b\u4e0a\u53bb\u6709\u70b9\u7c7b\u4f3c\u4e09\u89d2\u6ce2 \u5982\u4e0b\u56fe\u6240\u793a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"907\" height=\"192\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-108.png\" alt=\"\" class=\"wp-image-3309\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-108.png 907w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-108-300x64.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/image-108-768x163.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>\u4ee5\u4e0b\u662f\u5b8c\u6574\u5de5\u7a0b\uff1a<\/p>\n\n\n\n<p><a href=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/10_PL_SIMULATION_TEST.zip\">10_PL_SIMULATION_TEST<\/a><a href=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/02\/10_PL_SIMULATION_TEST.zip\">\u4e0b\u8f7d<\/a><\/p>\n\n\n\n<p><strong>\u4ee5\u4e0a\u662f vivado \u81ea\u5e26\u7684\u4eff\u771f\u529f\u80fd\u7684\u7b80\u5355\u8c03\u7528\u548c\u4ecb\u7ecd\uff0c\u5f53\u7136vivado \u4eff\u771f\u7684\u529f\u80fd\u8fdc\u4e0d\u6b62\u6211\u4ecb\u7ecd\u7684\u8fd9\u4e9b\uff0c\u9700\u8981\u5404\u4f4d\u81ea\u884c\u53bb\u6316\u6398\u4e86\uff0c\u4e0d\u4f5c\u5c55\u5f00<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7528FPGA\u505a\u9879\u76ee\u7684\u65f6\u5019\uff0c\u5927\u90e8\u5206\u65f6\u95f4\u90fd\u82b1\u5728\u8c03\u8bd5\u4e0a\u4e86\uff0c\u8c03\u8bd5\u9664\u4e86\u677f\u5b50\u5b9e\u9645\u8dd1\u770b\u7ed3\u679c\u548c\u7528ILA\u8fdb\u884c\u8c03\u8bd5\u5916\uff0c\u8fd8\u53ef\u4ee5\u7528\u8f6f\u4ef6\u8fdb\u884c\u4eff\u771f\uff0c\u672c\u6587\u5c31\u7b80\u5355\u6f14\u793a\u4e0b XILINX\u81ea\u5e26\u7684\u4eff\u771f\u529f\u80fd\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-3316","post","type-post","status-publish","format-standard","hentry","category-smart-zynq-board"],"views":706,"_links":{"self":[{"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/posts\/3316","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=3316"}],"version-history":[{"count":2,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/posts\/3316\/revisions"}],"predecessor-version":[{"id":3318,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/posts\/3316\/revisions\/3318"}],"wp:attachment":[{"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/media?parent=3316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/categories?post=3316"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/tags?post=3316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}