{"id":7458,"date":"2026-11-01T17:04:46","date_gmt":"2026-11-01T09:04:46","guid":{"rendered":"https:\/\/nullthought.net\/?p=7458"},"modified":"2026-11-01T17:04:48","modified_gmt":"2026-11-01T09:04:48","slug":"%e4%bb%8e%e4%b8%80%e6%ae%b5-systemverilog-%e4%bb%a3%e7%a0%81%e7%9c%8b-fpga-%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0%e4%b8%b2%e5%b9%b6%e8%bd%ac%e6%8d%a2","status":"publish","type":"post","link":"https:\/\/nullthought.net\/?p=7458","title":{"rendered":"\u4ece\u4e00\u6bb5 SystemVerilog \u4ee3\u7801\u770b FPGA \u5982\u4f55\u5b9e\u73b0\u4e32\u5e76\u8f6c\u6362"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u5728\u6570\u5b57\u7535\u8def\u8bbe\u8ba1\u4e2d\uff0c\u6709\u4e00\u4e2a\u770b\u4f3c\u7b80\u5355\u5374\u975e\u5e38\u57fa\u7840\u7684\u95ee\u9898\uff1a\u5f53\u6570\u636e\u901a\u8fc7\u4e00\u6839\u4fe1\u53f7\u7ebf\u9010\u4f4d\u5230\u8fbe\u65f6\uff0c\u5982\u4f55\u5c06\u8fd9\u4e9b\u8fde\u7eed\u5230\u6765\u7684\u4e8c\u8fdb\u5236\u4f4d\u7ec4\u5408\u6210\u4e00\u4e2a\u5b8c\u6574\u7684\u6570\u636e\u5b57\uff1f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff0c\u4e00\u4e2a 8 \u4f4d\u6570\u636e <code>10110010<\/code>\uff0c\u5728\u5e76\u884c\u7535\u8def\u4e2d\u53ef\u4ee5\u901a\u8fc7 8 \u6839\u4fe1\u53f7\u7ebf\u540c\u65f6\u4f20\u8f93\uff1b\u4f46\u5728\u4e32\u884c\u901a\u4fe1\u4e2d\uff0c\u5b83\u9700\u8981\u6309\u7167\u89c4\u5b9a\u7684\u987a\u5e8f\uff0c\u4e00\u4e2a\u6bd4\u7279\u63a5\u7740\u4e00\u4e2a\u6bd4\u7279\u5730\u4f20\u8f93\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728 FPGA \u4e2d\uff0c\u5b9e\u73b0\u8fd9\u79cd\u4e32\u884c\u5230\u5e76\u884c\u7684\u8f6c\u6362\uff08Serial-to-Parallel Conversion\uff09\uff0c\u901a\u5e38\u53ea\u9700\u8981\u4e00\u4e2a\u79fb\u4f4d\u5bc4\u5b58\u5668\uff08Shift Register\uff09\u3001\u4e00\u4e2a\u65f6\u949f\u4fe1\u53f7\uff0c\u4ee5\u53ca\u5c11\u91cf\u63a7\u5236\u903b\u8f91\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u66f4\u6709\u610f\u601d\u7684\u662f\uff0c\u4e00\u6761\u975e\u5e38\u7b80\u77ed\u7684 SystemVerilog \u8bed\u53e5\uff0c\u5b9e\u9645\u4e0a\u5c31\u53ef\u4ee5\u63cf\u8ff0\u6574\u4e2a\u79fb\u4f4d\u8fc7\u7a0b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e5f\u662f\u7406\u89e3 FPGA \u5de5\u4f5c\u539f\u7406\u3001\u65f6\u5e8f\u903b\u8f91\u548c\u786c\u4ef6\u63cf\u8ff0\u8bed\u8a00\u7684\u4e00\u6247\u5f88\u597d\u7684\u5165\u95e8\u7a97\u53e3\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e00\u3001\u4e00\u6761 SystemVerilog \u8bed\u53e5\u5982\u4f55\u5b9e\u73b0\u4e32\u5e76\u8f6c\u6362\uff1f<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5148\u6765\u770b\u4e00\u6bb5\u4ee3\u7801\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>logic &#91;7:0] shift;\n\nalways_ff @(posedge clk) begin\n    shift &lt;= {shift&#91;6:0], sdi};\nend<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5176\u4e2d\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>shift<\/code> \u662f\u4e00\u4e2a 8 \u4f4d\u5bc4\u5b58\u5668\uff0c\u7528\u4e8e\u4fdd\u5b58\u5df2\u7ecf\u63a5\u6536\u7684\u6570\u636e\u3002<\/li>\n\n\n\n<li><code>clk<\/code> \u662f\u65f6\u949f\u4fe1\u53f7\u3002<\/li>\n\n\n\n<li><code>sdi<\/code> \u662f\u4e32\u884c\u8f93\u5165\u6570\u636e\uff0c\u6bcf\u6b21\u8f93\u5165\u4e00\u4e2a\u6bd4\u7279\u3002<\/li>\n\n\n\n<li><code>always_ff @(posedge clk)<\/code> \u8868\u793a\u5728\u65f6\u949f\u4e0a\u5347\u6cbf\u6267\u884c\u5bc4\u5b58\u5668\u66f4\u65b0\u3002<\/li>\n\n\n\n<li><code>&lt;=<\/code> \u662f\u975e\u963b\u585e\u8d4b\u503c\u8fd0\u7b97\u7b26\u3002<\/li>\n\n\n\n<li><code>{shift[6:0], sdi}<\/code> \u662f\u62fc\u63a5\u64cd\u4f5c\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u771f\u6b63\u503c\u5f97\u5173\u6ce8\u7684\u662f\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>shift &lt;= {shift[6:0], sdi};<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b83\u7684\u542b\u4e49\u662f\uff1a<strong>\u5728\u6bcf\u6b21\u65f6\u949f\u4e0a\u5347\u6cbf\u5230\u6765\u65f6\uff0c\u5c06\u5bc4\u5b58\u5668\u539f\u6765\u7684\u4f4e 7 \u4f4d\u5411\u9ad8\u4f4d\u65b9\u5411\u79fb\u52a8\u4e00\u4f4d\uff0c\u5e76\u628a\u65b0\u63a5\u6536\u5230\u7684\u4e32\u884c\u6570\u636e\u653e\u5230\u6700\u4f4e\u4f4d\u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff0c\u5047\u8bbe\u539f\u6765\u7684\u5bc4\u5b58\u5668\u5185\u5bb9\u4e3a\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>01011001<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u65b0\u5230\u8fbe\u7684\u4e32\u884c\u6bd4\u7279\u662f <code>1<\/code>\uff0c\u90a3\u4e48\u65f6\u949f\u4e0a\u5347\u6cbf\u4e4b\u540e\uff0c\u5bc4\u5b58\u5668\u53d8\u6210\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>10110011<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u4ee5\u770b\u5230\uff0c\u539f\u6765\u7684\u6700\u9ad8\u4f4d <code>0<\/code> \u88ab\u79fb\u51fa\uff0c\u5176\u4ed6 7 \u4f4d\u5411\u5de6\u79fb\u52a8\uff0c\u65b0\u6bd4\u7279 <code>1<\/code> \u8fdb\u5165\u6700\u4f4e\u4f4d\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ea\u9700\u8981\u91cd\u590d\u8fd9\u4e00\u8fc7\u7a0b\uff0c\u5c31\u80fd\u628a\u9010\u4f4d\u5230\u6765\u7684\u4e32\u884c\u6570\u636e\u88c5\u5165\u5bc4\u5b58\u5668\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72471\uff1a8\u4f4d\u79fb\u4f4d\u5bc4\u5b58\u5668\u7684\u5de5\u4f5c\u539f\u7406-1024x1024.jpg\" alt=\"\" class=\"wp-image-7459\" srcset=\"https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72471\uff1a8\u4f4d\u79fb\u4f4d\u5bc4\u5b58\u5668\u7684\u5de5\u4f5c\u539f\u7406-1024x1024.jpg 1024w, https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72471\uff1a8\u4f4d\u79fb\u4f4d\u5bc4\u5b58\u5668\u7684\u5de5\u4f5c\u539f\u7406-150x150.jpg 150w, https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72471\uff1a8\u4f4d\u79fb\u4f4d\u5bc4\u5b58\u5668\u7684\u5de5\u4f5c\u539f\u7406-300x300.jpg 300w, https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72471\uff1a8\u4f4d\u79fb\u4f4d\u5bc4\u5b58\u5668\u7684\u5de5\u4f5c\u539f\u7406-768x768.jpg 768w, https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72471\uff1a8\u4f4d\u79fb\u4f4d\u5bc4\u5b58\u5668\u7684\u5de5\u4f5c\u539f\u7406-120x120.jpg 120w, https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72471\uff1a8\u4f4d\u79fb\u4f4d\u5bc4\u5b58\u5668\u7684\u5de5\u4f5c\u539f\u7406.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">8\u4f4d\u79fb\u4f4d\u5bc4\u5b58\u5668\u7684\u5de5\u4f5c\u539f\u7406<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u30018 \u4e2a\u65f6\u949f\u5468\u671f\uff0c\u5982\u4f55\u63a5\u6536\u4e00\u4e2a\u5b8c\u6574\u5b57\u8282\uff1f<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5047\u8bbe\u73b0\u5728\u9700\u8981\u63a5\u6536\u4e00\u4e2a 8 \u4f4d\u6570\u636e\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>10110010<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7ea6\u5b9a\u6700\u9ad8\u6709\u6548\u4f4d\uff08MSB\uff09\u9996\u5148\u5230\u8fbe\uff0c\u5e76\u4e14\u6bcf\u4e2a\u65f6\u949f\u4e0a\u5347\u6cbf\u63a5\u6536\u4e00\u4f4d\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u63a5\u6536\u5f00\u59cb\u4e4b\u524d\uff0c\u79fb\u4f4d\u5bc4\u5b58\u5668\u6e05\u96f6\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6574\u4e2a\u8fc7\u7a0b\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>\u65f6\u949f\u5468\u671f<\/th><th>\u8f93\u5165\u6bd4\u7279<\/th><th>\u79fb\u4f4d\u5bc4\u5b58\u5668\u5185\u5bb9<\/th><\/tr><tr><td>\u521d\u59cb<\/td><td>\u2014<\/td><td>00000000<\/td><\/tr><tr><td>1<\/td><td>1<\/td><td>00000001<\/td><\/tr><tr><td>2<\/td><td>0<\/td><td>00000010<\/td><\/tr><tr><td>3<\/td><td>1<\/td><td>00000101<\/td><\/tr><tr><td>4<\/td><td>1<\/td><td>00001011<\/td><\/tr><tr><td>5<\/td><td>0<\/td><td>00010110<\/td><\/tr><tr><td>6<\/td><td>0<\/td><td>00101100<\/td><\/tr><tr><td>7<\/td><td>1<\/td><td>01011001<\/td><\/tr><tr><td>8<\/td><td>0<\/td><td>10110010<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u7ecf\u8fc7 8 \u6b21\u65f6\u949f\u4e0a\u5347\u6cbf\u4e4b\u540e\uff0c\u5bc4\u5b58\u5668\u4e2d\u7684\u5185\u5bb9\u6070\u597d\u5c31\u662f\u539f\u6765\u7684 8 \u4f4d\u6570\u636e\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u8bf4\u660e\uff0cFPGA \u4e0d\u9700\u8981\u7b49\u5230\u5168\u90e8 8 \u4f4d\u6570\u636e\u90fd\u5230\u8fbe\u540e\u518d\u8fdb\u884c\u590d\u6742\u8ba1\u7b97\uff0c\u800c\u662f\u5728\u6bcf\u4e2a\u65f6\u949f\u5468\u671f\u5b8c\u6210\u4e00\u6b21\u7b80\u5355\u7684\u79fb\u4f4d\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f53\u7b2c 8 \u4f4d\u6570\u636e\u63a5\u6536\u5b8c\u6210\u65f6\uff0c\u4e32\u884c\u6570\u636e\u5c31\u81ea\u7136\u53d8\u6210\u4e86\u4e00\u4e2a\u53ef\u4ee5\u5e76\u884c\u8bfb\u53d6\u7684\u5b57\u8282\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72472\uff1a\u4e32\u884c\u6570\u636e\u7ecf\u8fc78\u4e2a\u65f6\u949f\u5468\u671f\u5b8c\u6210\u5e76\u884c\u8f6c\u6362-1024x1024.jpg\" alt=\"\" class=\"wp-image-7460\" srcset=\"https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72472\uff1a\u4e32\u884c\u6570\u636e\u7ecf\u8fc78\u4e2a\u65f6\u949f\u5468\u671f\u5b8c\u6210\u5e76\u884c\u8f6c\u6362-1024x1024.jpg 1024w, https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72472\uff1a\u4e32\u884c\u6570\u636e\u7ecf\u8fc78\u4e2a\u65f6\u949f\u5468\u671f\u5b8c\u6210\u5e76\u884c\u8f6c\u6362-300x300.jpg 300w, https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72472\uff1a\u4e32\u884c\u6570\u636e\u7ecf\u8fc78\u4e2a\u65f6\u949f\u5468\u671f\u5b8c\u6210\u5e76\u884c\u8f6c\u6362-150x150.jpg 150w, https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72472\uff1a\u4e32\u884c\u6570\u636e\u7ecf\u8fc78\u4e2a\u65f6\u949f\u5468\u671f\u5b8c\u6210\u5e76\u884c\u8f6c\u6362-768x768.jpg 768w, https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72472\uff1a\u4e32\u884c\u6570\u636e\u7ecf\u8fc78\u4e2a\u65f6\u949f\u5468\u671f\u5b8c\u6210\u5e76\u884c\u8f6c\u6362-120x120.jpg 120w, https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72472\uff1a\u4e32\u884c\u6570\u636e\u7ecf\u8fc78\u4e2a\u65f6\u949f\u5468\u671f\u5b8c\u6210\u5e76\u884c\u8f6c\u6362.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">\u4e32\u884c\u6570\u636e\u7ecf\u8fc78\u4e2a\u65f6\u949f\u5468\u671f\u5b8c\u6210\u5e76\u884c\u8f6c\u6362}<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u91cc\u8fd8\u6709\u4e00\u4e2a\u5bb9\u6613\u88ab\u5ffd\u7565\u7684\u95ee\u9898\uff1a<strong>\u79fb\u4f4d\u65b9\u5411\u548c\u4e32\u884c\u6570\u636e\u7684\u53d1\u9001\u987a\u5e8f\u5fc5\u987b\u5339\u914d\u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8ff0\u4ee3\u7801\u9002\u7528\u4e8e\u6700\u9ad8\u6709\u6548\u4f4d\u5148\u5230\u8fbe\u7684\u60c5\u51b5\u3002\u5982\u679c\u6700\u4f4e\u6709\u6548\u4f4d\u5148\u5230\u8fbe\uff0c\u90a3\u4e48\u53ef\u4ee5\u91c7\u7528\u53e6\u4e00\u79cd\u79fb\u4f4d\u65b9\u5f0f\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>shift &lt;= {sdi, shift[7:1]};<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b83\u628a\u65b0\u8f93\u5165\u7684\u6570\u636e\u653e\u5165\u6700\u9ad8\u4f4d\uff0c\u5176\u4f59\u6570\u636e\u5411\u4f4e\u4f4d\u65b9\u5411\u79fb\u52a8\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u56e0\u6b64\uff0c\u51b3\u5b9a\u6700\u7ec8\u6570\u636e\u662f\u5426\u6b63\u786e\u7684\uff0c\u4e0d\u53ea\u662f\u63a5\u6536\u4e86\u591a\u5c11\u4e2a\u6bd4\u7279\uff0c\u8fd8\u5305\u62ec\u53d1\u9001\u987a\u5e8f\u3001\u79fb\u4f4d\u65b9\u5411\u548c\u91c7\u6837\u65f6\u523b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001\u4e3a\u4ec0\u4e48\u8fd9\u91cc\u4f7f\u7528\u975e\u963b\u585e\u8d4b\u503c\uff1f<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5bf9\u4e8e\u6709 C\u3001C++ \u6216 Python \u7f16\u7a0b\u7ecf\u9a8c\u7684\u4eba\u6765\u8bf4\uff0cSystemVerilog \u4e2d\u7684 <code>&lt;=<\/code> \u5bb9\u6613\u5f15\u8d77\u8bef\u89e3\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u8fd9\u91cc\uff0c\u5b83\u4e0d\u662f\u201c\u5c0f\u4e8e\u7b49\u4e8e\u201d\uff0c\u800c\u662f\u975e\u963b\u585e\u8d4b\u503c\uff08Non-blocking Assignment\uff09\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u65f6\u5e8f\u903b\u8f91\u4e2d\uff0c\u975e\u963b\u585e\u8d4b\u503c\u7684\u6838\u5fc3\u7279\u70b9\u662f\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u5728\u540c\u4e00\u4e2a\u65f6\u949f\u4e8b\u4ef6\u89e6\u53d1\u7684\u66f4\u65b0\u8fc7\u7a0b\u4e2d\uff0c\u5148\u6839\u636e\u5bc4\u5b58\u5668\u7684\u65e7\u503c\u8ba1\u7b97\u53f3\u4fa7\u8868\u8fbe\u5f0f\uff0c\u518d\u7edf\u4e00\u66f4\u65b0\u5bc4\u5b58\u5668\u7684\u65b0\u503c\u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>always_ff @(posedge clk) begin\n    a &lt;= input_data;\n    b &lt;= a;\n    c &lt;= b;\nend<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u6bb5\u4ee3\u7801\u63cf\u8ff0\u7684\u662f\u4e09\u4e2a\u5bc4\u5b58\u5668\u6784\u6210\u7684\u6d41\u6c34\u7ebf\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6bcf\u4e2a\u65f6\u949f\u4e0a\u5347\u6cbf\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>a<\/code> \u63a5\u6536\u5f53\u524d\u7684 <code>input_data<\/code>\u3002<\/li>\n\n\n\n<li><code>b<\/code> \u63a5\u6536\u66f4\u65b0\u524d\u7684 <code>a<\/code>\u3002<\/li>\n\n\n\n<li><code>c<\/code> \u63a5\u6536\u66f4\u65b0\u524d\u7684 <code>b<\/code>\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u5e76\u4e0d\u662f\u8ba9\u6570\u636e\u5728\u4e00\u4e2a\u65f6\u949f\u5468\u671f\u5185\u4f9d\u6b21\u7a7f\u8fc7\u4e09\u4e2a\u5bc4\u5b58\u5668\uff0c\u800c\u662f\u8ba9\u6570\u636e\u6bcf\u7ecf\u8fc7\u4e00\u4e2a\u65f6\u949f\u5468\u671f\uff0c\u5411\u540e\u4f20\u9012\u4e00\u7ea7\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ece\u786c\u4ef6\u89d2\u5ea6\u770b\uff0c\u4e09\u4e2a\u5bc4\u5b58\u5668\u5728\u540c\u4e00\u4e2a\u65f6\u949f\u8fb9\u6cbf\u8fdb\u884c\u72b6\u6001\u66f4\u65b0\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5bf9\u4e8e\u4e32\u5e76\u8f6c\u6362\u4e2d\u7684\u4ee3\u7801\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>shift &lt;= {shift[6:0], sdi};<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e5f\u662f\u540c\u6837\u7684\u9053\u7406\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u53f3\u4fa7\u7684 <code>shift[6:0]<\/code> \u4f7f\u7528\u66f4\u65b0\u524d\u7684\u5bc4\u5b58\u5668\u5185\u5bb9\uff0c\u7136\u540e\u751f\u6210\u4e0b\u4e00\u6b21\u9700\u8981\u4fdd\u5b58\u7684 8 \u4f4d\u6570\u636e\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72473\uff1a\u975e\u963b\u585e\u8d4b\u503c\u4e0e\u5bc4\u5b58\u5668\u540c\u6b65\u66f4\u65b0-1024x1024.jpg\" alt=\"\" class=\"wp-image-7461\" srcset=\"https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72473\uff1a\u975e\u963b\u585e\u8d4b\u503c\u4e0e\u5bc4\u5b58\u5668\u540c\u6b65\u66f4\u65b0-1024x1024.jpg 1024w, https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72473\uff1a\u975e\u963b\u585e\u8d4b\u503c\u4e0e\u5bc4\u5b58\u5668\u540c\u6b65\u66f4\u65b0-300x300.jpg 300w, https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72473\uff1a\u975e\u963b\u585e\u8d4b\u503c\u4e0e\u5bc4\u5b58\u5668\u540c\u6b65\u66f4\u65b0-150x150.jpg 150w, https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72473\uff1a\u975e\u963b\u585e\u8d4b\u503c\u4e0e\u5bc4\u5b58\u5668\u540c\u6b65\u66f4\u65b0-768x768.jpg 768w, https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72473\uff1a\u975e\u963b\u585e\u8d4b\u503c\u4e0e\u5bc4\u5b58\u5668\u540c\u6b65\u66f4\u65b0-120x120.jpg 120w, https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72473\uff1a\u975e\u963b\u585e\u8d4b\u503c\u4e0e\u5bc4\u5b58\u5668\u540c\u6b65\u66f4\u65b0.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">\u975e\u963b\u585e\u8d4b\u503c\u4e0e\u5bc4\u5b58\u5668\u540c\u6b65\u66f4\u65b0<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e5f\u63ed\u793a\u4e86 SystemVerilog \u4e0e\u666e\u901a\u8f6f\u4ef6\u7f16\u7a0b\u8bed\u8a00\u7684\u91cd\u8981\u533a\u522b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>SystemVerilog \u63cf\u8ff0\u7684\u4e3b\u8981\u662f\u786c\u4ef6\u7535\u8def\u7684\u7ed3\u6784\u548c\u968f\u65f6\u95f4\u53d8\u5316\u7684\u884c\u4e3a\uff0c\u800c\u4e0d\u662f\u7b80\u5355\u5730\u6307\u6325\u5904\u7406\u5668\u9010\u6761\u6267\u884c\u7a0b\u5e8f\u3002<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u56db\u3001\u4ece\u79fb\u4f4d\u5bc4\u5b58\u5668\u5230\u5b8c\u6574\u7684\u4e32\u5e76\u8f6c\u6362\u6a21\u5757<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u524d\u9762\u7684\u4ee3\u7801\u867d\u7136\u5b9e\u73b0\u4e86\u79fb\u4f4d\uff0c\u5374\u8fd8\u6709\u4e00\u4e2a\u95ee\u9898\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">FPGA \u5982\u4f55\u77e5\u9053\u5df2\u7ecf\u63a5\u6536\u5b8c 8 \u4e2a\u6bd4\u7279\uff1f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u6ca1\u6709\u989d\u5916\u63a7\u5236\uff0c\u79fb\u4f4d\u5bc4\u5b58\u5668\u4f1a\u5728\u6bcf\u6b21\u65f6\u949f\u4e0a\u5347\u6cbf\u6301\u7eed\u79fb\u4f4d\u3002\u5373\u4f7f\u5df2\u7ecf\u6536\u5230\u5b8c\u6574\u5b57\u8282\uff0c\u540e\u7eed\u6570\u636e\u4ecd\u7136\u4f1a\u7ee7\u7eed\u8986\u76d6\u539f\u6709\u5185\u5bb9\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u56e0\u6b64\uff0c\u5b9e\u9645\u8bbe\u8ba1\u4e2d\u901a\u5e38\u8fd8\u9700\u8981\u4e00\u4e2a\u6bd4\u7279\u8ba1\u6570\u5668\uff0c\u4ee5\u53ca\u4e00\u4e2a\u8868\u793a\u6570\u636e\u6709\u6548\u7684\u4fe1\u53f7\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5316\u7684 8 \u4f4d\u4e32\u5e76\u8f6c\u6362\u6a21\u5757\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>module serial_to_parallel (\n    input  logic       clk,\n    input  logic       rst_n,\n    input  logic       sdi,\n    input  logic       sdi_valid,\n\n    output logic &#91;7:0] data_out,\n    output logic       data_valid\n);\n\n    logic &#91;7:0] shift;\n    logic &#91;2:0] bit_count;\n\n    always_ff @(posedge clk or negedge rst_n) begin\n        if (!rst_n) begin\n            shift      &lt;= 8'b0;\n            bit_count  &lt;= 3'd0;\n            data_out   &lt;= 8'b0;\n            data_valid &lt;= 1'b0;\n        end\n        else begin\n            data_valid &lt;= 1'b0;\n\n            if (sdi_valid) begin\n                shift &lt;= {shift&#91;6:0], sdi};\n\n                if (bit_count == 3'd7) begin\n                    data_out &lt;= {shift&#91;6:0], sdi};\n                    data_valid &lt;= 1'b1;\n                    bit_count &lt;= 3'd0;\n                end\n                else begin\n                    bit_count &lt;= bit_count + 3'd1;\n                end\n            end\n        end\n    end\n\nendmodule<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e2a\u6a21\u5757\u6bd4\u6700\u521d\u7684\u79fb\u4f4d\u4ee3\u7801\u591a\u4e86\u51e0\u4e2a\u529f\u80fd\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u9996\u5148\uff0c<code>sdi_valid<\/code> \u63a7\u5236\u5f53\u524d\u8f93\u5165\u6bd4\u7279\u662f\u5426\u6709\u6548\u3002\u53ea\u6709\u5b83\u4e3a\u9ad8\u7535\u5e73\u65f6\uff0c\u6a21\u5757\u624d\u63a5\u6536\u6570\u636e\u5e76\u589e\u52a0\u8ba1\u6570\u3002\u8fd9\u5141\u8bb8\u8f93\u5165\u6570\u636e\u4e4b\u95f4\u51fa\u73b0\u7a7a\u95f2\u65f6\u949f\u5468\u671f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5176\u6b21\uff0c<code>bit_count<\/code> \u8bb0\u5f55\u5df2\u7ecf\u63a5\u6536\u7684\u6709\u6548\u6bd4\u7279\u6570\u91cf\u3002\u7531\u4e8e\u4e00\u5171\u53ea\u6709 8 \u4e2a\u4f4d\u7f6e\uff0c\u56e0\u6b64 3 \u4f4d\u8ba1\u6570\u5668\u5c31\u8db3\u591f\u4e86\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b2c\u4e09\uff0c\u5f53 <code>bit_count<\/code> \u7b49\u4e8e 7 \u65f6\uff0c\u610f\u5473\u7740\u5f53\u524d\u8f93\u5165\u7684\u662f\u7b2c 8 \u4e2a\u6bd4\u7279\u3002\u8fd9\u65f6\u5c06\u5b8c\u6574\u6570\u636e\u5199\u5165 <code>data_out<\/code>\uff0c\u540c\u65f6\u5c06 <code>data_valid<\/code> \u7f6e\u4e3a\u9ad8\u7535\u5e73\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u91cc\u6709\u4e00\u4e2a\u7ec6\u8282\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>data_out &lt;= {shift[6:0], sdi};<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e3a\u4ec0\u4e48\u4e0d\u76f4\u63a5\u5199\u6210\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>data_out &lt;= shift;<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u539f\u56e0\u5c31\u5728\u4e8e\u524d\u9762\u8ba8\u8bba\u7684\u975e\u963b\u585e\u8d4b\u503c\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u7b2c 8 \u4e2a\u6bd4\u7279\u5230\u8fbe\u7684\u65f6\u949f\u4e0a\u5347\u6cbf\uff0c<code>shift<\/code> \u7684\u66f4\u65b0\u8fd8\u6ca1\u6709\u751f\u6548\u3002\u5982\u679c\u76f4\u63a5\u4f7f\u7528 <code>shift<\/code>\uff0c\u90a3\u4e48 <code>data_out<\/code> \u5f97\u5230\u7684\u662f\u5c1a\u672a\u5305\u542b\u7b2c 8 \u4e2a\u8f93\u5165\u6bd4\u7279\u7684\u65e7\u6570\u636e\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u56e0\u6b64\uff0c\u9700\u8981\u4f7f\u7528\u62fc\u63a5\u8868\u8fbe\u5f0f\uff0c\u5c06\u5f53\u524d\u521a\u521a\u5230\u8fbe\u7684\u6bd4\u7279\u5305\u542b\u8fdb\u6765\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u6b63\u662f\u4e00\u4e2a\u5178\u578b\u7684\u65f6\u5e8f\u903b\u8f91\u95ee\u9898\uff1a<strong>\u7406\u89e3\u4ee3\u7801\u7684\u5173\u952e\uff0c\u4e0d\u4ec5\u662f\u77e5\u9053\u6bcf\u6761\u8bed\u53e5\u505a\u4ec0\u4e48\uff0c\u8fd8\u8981\u77e5\u9053\u5b83\u5728\u4ec0\u4e48\u65f6\u523b\u751f\u6548\u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8ff0\u793a\u4f8b\u5047\u5b9a <code>sdi<\/code> \u548c <code>sdi_valid<\/code> \u5df2\u6ee1\u8db3\u63a5\u6536\u65f6\u949f\u57df\u7684\u65f6\u5e8f\u8981\u6c42\uff0c8 \u4e2a\u6709\u6548\u6bd4\u7279\u8fde\u7eed\u7ec4\u6210\u4e00\u4e2a\u5b57\u8282\uff1b\u5982\u679c\u53d1\u751f\u4e2d\u9014\u4e22\u4f4d\u3001\u91cd\u65b0\u540c\u6b65\u6216\u5e27\u9519\u4f4d\uff0c\u8fd8\u9700\u8981\u989d\u5916\u7684\u534f\u8bae\u63a7\u5236\u903b\u8f91\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e94\u3001FPGA \u6700\u7ec8\u4f1a\u628a\u8fd9\u4e9b\u4ee3\u7801\u53d8\u6210\u4ec0\u4e48\u7535\u8def\uff1f<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u8f6f\u4ef6\u7a0b\u5e8f\u901a\u5e38\u7531\u5904\u7406\u5668\u9010\u6761\u6267\u884c\uff0c\u800c FPGA \u7684\u5f00\u53d1\u8fc7\u7a0b\u4e0d\u540c\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">SystemVerilog \u4ee3\u7801\u7ecf\u8fc7\u7efc\u5408\u5de5\u5177\u5904\u7406\u540e\uff0c\u4f1a\u88ab\u8f6c\u6362\u6210\u7531\u5bc4\u5b58\u5668\u3001\u903b\u8f91\u95e8\u548c\u5176\u4ed6\u786c\u4ef6\u8d44\u6e90\u6784\u6210\u7684\u7535\u8def\u7f51\u7edc\uff0c\u4e5f\u5c31\u662f\u7f51\u8868\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5bf9\u4e8e\u524d\u9762\u7684\u4e32\u5e76\u8f6c\u6362\u6a21\u5757\uff0c\u7efc\u5408\u5de5\u5177\u901a\u5e38\u4f1a\u8bc6\u522b\u51fa\u51e0\u7c7b\u57fa\u672c\u7ed3\u6784\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>SystemVerilog \u63cf\u8ff0<\/th><th>\u5bf9\u5e94\u7684\u786c\u4ef6\u529f\u80fd<\/th><\/tr><tr><td><code>logic [7:0] shift<\/code><\/td><td>8 \u4f4d\u79fb\u4f4d\u5bc4\u5b58\u5668<\/td><\/tr><tr><td><code>logic [2:0] bit_count<\/code><\/td><td>3 \u4f4d\u8ba1\u6570\u5668<\/td><\/tr><tr><td><code>if (sdi_valid)<\/code><\/td><td>\u5bc4\u5b58\u5668\u66f4\u65b0\u4f7f\u80fd\u903b\u8f91<\/td><\/tr><tr><td><code>bit_count == 3'd7<\/code><\/td><td>\u8ba1\u6570\u6bd4\u8f83\u903b\u8f91<\/td><\/tr><tr><td><code>data_out<\/code><\/td><td>8 \u4f4d\u8f93\u51fa\u5bc4\u5b58\u5668<\/td><\/tr><tr><td><code>data_valid<\/code><\/td><td>\u8f93\u51fa\u6709\u6548\u6807\u5fd7\u5bc4\u5b58\u5668<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u9700\u8981\u8bf4\u660e\u7684\u662f\uff0c\u6700\u7ec8\u7684\u5b9e\u73b0\u672a\u5fc5\u4e0e\u6e90\u4ee3\u7801\u4e2d\u7684\u5bc4\u5b58\u5668\u548c\u903b\u8f91\u95e8\u4e00\u4e00\u5bf9\u5e94\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7efc\u5408\u5de5\u5177\u4f1a\u8fdb\u884c\u903b\u8f91\u4f18\u5316\uff0c\u968f\u540e\u901a\u8fc7\u5e03\u5c40\u5e03\u7ebf\uff0c\u5c06\u903b\u8f91\u6620\u5c04\u5230\u5177\u4f53 FPGA \u82af\u7247\u7684\u53ef\u914d\u7f6e\u903b\u8f91\u8d44\u6e90\u4e2d\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5bf9\u8fd9\u4e2a\u793a\u4f8b\u6765\u8bf4\uff0c\u6700\u7ec8\u786c\u4ef6\u4e3b\u8981\u662f\u4e00\u7ec4\u89e6\u53d1\u5668\u4ee5\u53ca\u5c11\u91cf\u7ec4\u5408\u903b\u8f91\u3002\u6574\u4e2a\u4e32\u5e76\u8f6c\u6362\u8fc7\u7a0b\u4e0d\u9700\u8981\u5904\u7406\u5668\u9010\u4f4d\u642c\u8fd0\u6570\u636e\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72474\uff1aSystemVerilog\u4ee3\u7801\u7ecf\u8fc7\u7efc\u5408\u6620\u5c04\u4e3aFPGA\u786c\u4ef6\u7535\u8def-1024x1024.jpg\" alt=\"\" class=\"wp-image-7462\" srcset=\"https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72474\uff1aSystemVerilog\u4ee3\u7801\u7ecf\u8fc7\u7efc\u5408\u6620\u5c04\u4e3aFPGA\u786c\u4ef6\u7535\u8def-1024x1024.jpg 1024w, https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72474\uff1aSystemVerilog\u4ee3\u7801\u7ecf\u8fc7\u7efc\u5408\u6620\u5c04\u4e3aFPGA\u786c\u4ef6\u7535\u8def-150x150.jpg 150w, https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72474\uff1aSystemVerilog\u4ee3\u7801\u7ecf\u8fc7\u7efc\u5408\u6620\u5c04\u4e3aFPGA\u786c\u4ef6\u7535\u8def-300x300.jpg 300w, https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72474\uff1aSystemVerilog\u4ee3\u7801\u7ecf\u8fc7\u7efc\u5408\u6620\u5c04\u4e3aFPGA\u786c\u4ef6\u7535\u8def-768x768.jpg 768w, https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72474\uff1aSystemVerilog\u4ee3\u7801\u7ecf\u8fc7\u7efc\u5408\u6620\u5c04\u4e3aFPGA\u786c\u4ef6\u7535\u8def-120x120.jpg 120w, https:\/\/nullthought.net\/wp-content\/uploads\/2026\/11\/\u56fe\u72474\uff1aSystemVerilog\u4ee3\u7801\u7ecf\u8fc7\u7efc\u5408\u6620\u5c04\u4e3aFPGA\u786c\u4ef6\u7535\u8def.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">SystemVerilog\u4ee3\u7801\u7ecf\u8fc7\u7efc\u5408\u6620\u5c04\u4e3aFPGA\u786c\u4ef6\u7535\u8def<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u516d\u3001\u5982\u4f55\u901a\u8fc7\u4eff\u771f\u9a8c\u8bc1\u4e32\u5e76\u8f6c\u6362\u662f\u5426\u6b63\u786e\uff1f<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u7f16\u5199 RTL \u4ee3\u7801\u4e4b\u540e\uff0c\u5e76\u4e0d\u610f\u5473\u7740\u8bbe\u8ba1\u5df2\u7ecf\u6b63\u786e\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728 FPGA \u5f00\u53d1\u4e2d\uff0c\u901a\u5e38\u9700\u8981\u5148\u901a\u8fc7\u4eff\u771f\u9a8c\u8bc1\u529f\u80fd\uff0c\u518d\u8003\u8651\u7efc\u5408\u3001\u65f6\u5e8f\u7ea6\u675f\u4ee5\u53ca\u5b9e\u9645\u786c\u4ef6\u6d4b\u8bd5\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528 Verilator\u3001Questa \u7b49\u5de5\u5177\u8fdb\u884c SystemVerilog \u4eff\u771f\uff0c\u5e76\u901a\u8fc7 GTKWave \u7b49\u6ce2\u5f62\u67e5\u770b\u5de5\u5177\u5206\u6790\u8f93\u51fa\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5bf9\u4e8e\u672c\u6587\u7684\u6a21\u5757\uff0c\u81f3\u5c11\u9700\u8981\u9a8c\u8bc1\u4ee5\u4e0b\u51e0\u79cd\u60c5\u51b5\uff1a<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>\u5b8c\u6574\u63a5\u6536\uff1a<\/strong> \u8f93\u5165 <code>10110010<\/code>\uff0c\u786e\u8ba4\u7b2c 8 \u4e2a\u6709\u6548\u6bd4\u7279\u63a5\u6536\u540e\uff0c<code>data_out<\/code> \u4e3a <code>10110010<\/code>\u3002<\/li>\n\n\n\n<li><strong>\u95f4\u65ad\u63a5\u6536\uff1a<\/strong> \u5728\u4e24\u4e2a\u8f93\u5165\u6bd4\u7279\u4e4b\u95f4\u63d2\u5165\u7a7a\u95f2\u65f6\u949f\u5468\u671f\uff0c\u786e\u8ba4\u8ba1\u6570\u5668\u4e0d\u4f1a\u9519\u8bef\u589e\u52a0\u3002<\/li>\n\n\n\n<li><strong>\u8fde\u7eed\u63a5\u6536\uff1a<\/strong> \u8fde\u7eed\u8f93\u5165\u4e24\u4e2a\u5b57\u8282\uff0c\u786e\u8ba4\u8f93\u51fa\u987a\u5e8f\u6b63\u786e\uff0c\u6bcf\u4e2a\u5b57\u8282\u5b8c\u6210\u65f6\u5404\u4ea7\u751f\u4e00\u6b21\u6709\u6548\u4fe1\u53f7\u3002<\/li>\n\n\n\n<li><strong>\u590d\u4f4d\u5904\u7406\uff1a<\/strong> \u5728\u63a5\u6536\u8fc7\u7a0b\u4e2d\u89e6\u53d1\u590d\u4f4d\uff0c\u786e\u8ba4\u8ba1\u6570\u5668\u3001\u79fb\u4f4d\u5bc4\u5b58\u5668\u548c\u8f93\u51fa\u72b6\u6001\u6062\u590d\u521d\u59cb\u503c\u3002<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u4eff\u771f\u65f6\u5c24\u5176\u9700\u8981\u89c2\u5bdf <code>data_valid<\/code> \u4e0e <code>data_out<\/code> \u7684\u5173\u7cfb\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5bf9\u4e8e\u4e0a\u8ff0\u8bbe\u8ba1\uff0c\u63a5\u6536\u7b2c 8 \u4e2a\u6709\u6548\u6bd4\u7279\u7684\u65f6\u949f\u4e0a\u5347\u6cbf\u4e4b\u540e\uff0c<code>data_out<\/code> \u66f4\u65b0\u4e3a\u5b8c\u6574\u5b57\u8282\uff0c<code>data_valid<\/code> \u540c\u65f6\u53d8\u4e3a\u9ad8\u7535\u5e73\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e24\u4e2a\u8f93\u51fa\u4f1a\u5728\u4e0b\u4e00\u4e2a\u65f6\u949f\u4e0a\u5347\u6cbf\u4e4b\u524d\u4fdd\u6301\u7a33\u5b9a\u3002\u4e0b\u6e38\u540c\u6b65\u903b\u8f91\u901a\u5e38\u5728\u4e0b\u4e00\u6b21\u65f6\u949f\u4e0a\u5347\u6cbf\u91c7\u6837\u5230\u8fd9\u4e2a\u6709\u6548\u6807\u5fd7\u548c\u5bf9\u5e94\u7684\u6570\u636e\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u9700\u8981\u6ce8\u610f\uff0c\u4eff\u771f\u9a8c\u8bc1\u7684\u662f RTL \u7684\u9884\u671f\u884c\u4e3a\u3002\u5b9e\u9645 FPGA \u4e2d\u8fd8\u8981\u8003\u8651\u5efa\u7acb\u65f6\u95f4\u3001\u4fdd\u6301\u65f6\u95f4\u3001\u65f6\u949f\u504f\u5dee\u4ee5\u53ca\u5f02\u6b65\u8f93\u5165\u7b49\u95ee\u9898\u3002\u5982\u679c\u4e32\u884c\u8f93\u5165\u6765\u81ea\u4e0d\u540c\u7684\u65f6\u949f\u57df\uff0c\u5c31\u4e0d\u80fd\u76f4\u63a5\u5047\u8bbe\u5b83\u80fd\u88ab\u672c\u5730\u65f6\u949f\u7a33\u5b9a\u91c7\u6837\uff1b\u5e94\u6839\u636e\u5b9e\u9645\u63a5\u53e3\u91c7\u7528\u9002\u5f53\u7684\u540c\u6b65\u6216\u91c7\u6837\u8bbe\u8ba1\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e03\u3001\u4e32\u5e76\u8f6c\u6362\u80cc\u540e\uff0c\u5176\u5b9e\u662f FPGA \u7684\u57fa\u672c\u5de5\u4f5c\u65b9\u5f0f<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ece\u6700\u521d\u7684\u4e00\u884c\u4ee3\u7801\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>shift &lt;= {shift[6:0], sdi};<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5230\u5b8c\u6574\u7684\u4e32\u5e76\u8f6c\u6362\u6a21\u5757\uff0c\u6211\u4eec\u5b9e\u9645\u4e0a\u63a5\u89e6\u5230\u4e86 FPGA \u5f00\u53d1\u4e2d\u7684\u51e0\u4e2a\u6838\u5fc3\u6982\u5ff5\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b2c\u4e00\uff0cFPGA \u4e2d\u7684\u8bb8\u591a\u6570\u636e\u5904\u7406\u64cd\u4f5c\uff0c\u53ef\u4ee5\u901a\u8fc7\u5bc4\u5b58\u5668\u4e4b\u95f4\u7684\u6570\u636e\u79fb\u52a8\u548c\u7ec4\u5408\u903b\u8f91\u5b8c\u6210\uff0c\u4e0d\u4e00\u5b9a\u9700\u8981\u590d\u6742\u7684\u8fd0\u7b97\u5355\u5143\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b2c\u4e8c\uff0c\u65f6\u949f\u51b3\u5b9a\u4e86\u5bc4\u5b58\u5668\u4f55\u65f6\u66f4\u65b0\u3002\u53ea\u6709\u7406\u89e3\u65f6\u949f\u8fb9\u6cbf\u3001\u65e7\u503c\u4e0e\u65b0\u503c\u4e4b\u95f4\u7684\u5173\u7cfb\uff0c\u624d\u80fd\u6b63\u786e\u8bbe\u8ba1\u65f6\u5e8f\u7535\u8def\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b2c\u4e09\uff0c\u786c\u4ef6\u63cf\u8ff0\u8bed\u8a00\u4e2d\u7684\u4ee3\u7801\u5e76\u4e0d\u7b49\u540c\u4e8e\u8f6f\u4ef6\u6267\u884c\u6b65\u9aa4\u3002\u5f00\u53d1\u4eba\u5458\u7f16\u5199\u7684\u662f\u7535\u8def\u884c\u4e3a\u63cf\u8ff0\uff0c\u800c\u7efc\u5408\u5de5\u5177\u8d1f\u8d23\u5c06\u8fd9\u4e9b\u63cf\u8ff0\u8f6c\u5316\u6210\u786c\u4ef6\u7ed3\u6784\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b2c\u56db\uff0c\u4e00\u4e2a\u771f\u6b63\u53ef\u7528\u7684\u6a21\u5757\uff0c\u9664\u4e86\u5b8c\u6210\u6838\u5fc3\u6570\u636e\u53d8\u6362\uff0c\u8fd8\u9700\u8981\u89e3\u51b3\u6570\u636e\u6709\u6548\u6027\u3001\u8fb9\u754c\u8bc6\u522b\u3001\u590d\u4f4d\u548c\u5f02\u5e38\u5904\u7406\u7b49\u95ee\u9898\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e32\u5e76\u8f6c\u6362\u53ef\u4ee5\u8bf4\u662f FPGA \u4e2d\u6700\u7b80\u5355\u7684\u529f\u80fd\u6a21\u5757\u4e4b\u4e00\uff0c\u5374\u5e7f\u6cdb\u5b58\u5728\u4e8e\u4e32\u884c\u901a\u4fe1\u3001\u4f20\u611f\u5668\u63a5\u53e3\u3001\u6570\u636e\u91c7\u96c6\u4ee5\u53ca\u5404\u79cd\u6570\u5b57\u4fe1\u53f7\u5904\u7406\u7cfb\u7edf\u4e2d\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7406\u89e3\u5b83\uff0c\u4e0d\u4ec5\u80fd\u5e2e\u52a9\u6211\u4eec\u638c\u63e1\u79fb\u4f4d\u5bc4\u5b58\u5668\uff0c\u8fd8\u80fd\u5efa\u7acb\u7406\u89e3 FPGA \u65f6\u5e8f\u903b\u8f91\u7684\u57fa\u672c\u601d\u7ef4\u65b9\u5f0f\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u5728 FPGA \u4e2d\uff0c\u91cd\u8981\u7684\u5e76\u4e0d\u53ea\u662f\u6570\u636e\u8fdb\u884c\u4e86\u4ec0\u4e48\u8fd0\u7b97\uff0c\u66f4\u662f\u6570\u636e\u5728\u7b2c\u51e0\u4e2a\u65f6\u949f\u5468\u671f\u3001\u7ecf\u8fc7\u54ea\u4e00\u7ea7\u5bc4\u5b58\u5668\u3001\u4ee5\u4ec0\u4e48\u72b6\u6001\u8fdb\u5165\u4e0b\u4e00\u6bb5\u7535\u8def\u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u800c\u8fd9\uff0c\u6b63\u662f FPGA \u8bbe\u8ba1\u4e0e\u666e\u901a\u8f6f\u4ef6\u7f16\u7a0b\u6700\u6839\u672c\u7684\u533a\u522b\u4e4b\u4e00\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u53c2\u8003\u8d44\u6599<\/h2>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>SystemVerilog Primer \u2014 UC Berkeley EECS 151<br><a href=\"https:\/\/eecs151.org\/fpga\/lab1\/docs\/pg-4-systemverilog\/\">https:\/\/eecs151.org\/fpga\/lab1\/docs\/pg-4-systemverilog\/<\/a><\/li>\n\n\n\n<li>Verilator User Guide \u2014 Overview<br><a href=\"https:\/\/verilator.org\/guide\/latest\/overview.html\">https:\/\/verilator.org\/guide\/latest\/overview.html<\/a><\/li>\n\n\n\n<li>Verilator User Guide \u2014 Example Create-Binary Execution<br><a href=\"https:\/\/verilator.org\/guide\/latest\/example_binary.html\">https:\/\/verilator.org\/guide\/latest\/example_binary.html<\/a><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u6570\u5b57\u7535\u8def\u8bbe\u8ba1\u4e2d\uff0c\u6709\u4e00\u4e2a\u770b\u4f3c\u7b80\u5355\u5374\u975e\u5e38\u57fa\u7840\u7684\u95ee\u9898\uff1a\u5f53\u6570\u636e\u901a\u8fc7\u4e00\u6839\u4fe1\u53f7\u7ebf\u9010\u4f4d\u5230\u8fbe\u65f6\uff0c\u5982\u4f55\u5c06\u8fd9\u4e9b\u8fde\u7eed\u5230\u6765\u7684\u4e8c\u8fdb\u5236\u4f4d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[8],"tags":[39,101,100,75],"class_list":["post-7458","post","type-post","status-publish","format-standard","hentry","category-tech","tag-ai","tag-old-programmer-in-ai-era","tag-electrical-electronic","tag-ic"],"rttpg_featured_image_url":null,"rttpg_author":{"display_name":"NullThought","author_link":"https:\/\/nullthought.net\/?author=1"},"rttpg_comment":0,"rttpg_category":"<a href=\"https:\/\/nullthought.net\/?cat=8\" rel=\"category\">Tech<\/a>","rttpg_excerpt":"\u5728\u6570\u5b57\u7535\u8def\u8bbe\u8ba1\u4e2d\uff0c\u6709\u4e00\u4e2a\u770b\u4f3c\u7b80\u5355\u5374\u975e\u5e38\u57fa\u7840\u7684\u95ee\u9898\uff1a\u5f53\u6570\u636e\u901a\u8fc7\u4e00\u6839\u4fe1\u53f7\u7ebf\u9010\u4f4d\u5230\u8fbe\u65f6\uff0c\u5982\u4f55\u5c06\u8fd9\u4e9b\u8fde\u7eed\u5230\u6765\u7684\u4e8c\u8fdb\u5236\u4f4d&hellip;","_links":{"self":[{"href":"https:\/\/nullthought.net\/index.php?rest_route=\/wp\/v2\/posts\/7458","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nullthought.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nullthought.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nullthought.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nullthought.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7458"}],"version-history":[{"count":1,"href":"https:\/\/nullthought.net\/index.php?rest_route=\/wp\/v2\/posts\/7458\/revisions"}],"predecessor-version":[{"id":7463,"href":"https:\/\/nullthought.net\/index.php?rest_route=\/wp\/v2\/posts\/7458\/revisions\/7463"}],"wp:attachment":[{"href":"https:\/\/nullthought.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nullthought.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7458"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nullthought.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}