{"id":297,"date":"2018-12-27T13:21:18","date_gmt":"2018-12-27T05:21:18","guid":{"rendered":"https:\/\/www.tiferking.cn\/?p=297"},"modified":"2023-01-30T15:05:10","modified_gmt":"2023-01-30T07:05:10","slug":"microblaze-%e4%b8%8d%e4%bd%bf%e7%94%a8-%e7%89%87%e4%b8%8a-ram-%e5%ae%9e%e7%8e%b0%e4%b8%8a%e7%94%b5%e8%87%aa%e5%90%af","status":"publish","type":"post","link":"https:\/\/www.tiferking.cn\/index.php\/2018\/12\/27\/297\/","title":{"rendered":"MicroBlaze \u4e0d\u4f7f\u7528 \u7247\u4e0a RAM \u5b9e\u73b0\u4e0a\u7535\u81ea\u542f"},"content":{"rendered":"\n<p>\u6700\u8fd1\u5728\u5b66Xilinx\u516c\u53f8\u7684\u5f00\u53d1\u6d41\u7a0b\uff0c\u6b63\u5de7\u5b66\u5230\u4e86MicroBlaze\u5904\u7406\u5668\uff0c\u7531\u4e8e\u4f7f\u7528\u7684\u8fd9\u6b3eVC707\u5f00\u53d1\u677f\u6ca1\u6709\u50cfZYNQ\u7cfb\u5217\u96c6\u6210\u4e86ARM\u7684\u786c\u6838\uff0c\u6240\u4ee5\u5728\u5904\u7406\u4e00\u4e9b\u590d\u6742\u7684\u903b\u8f91\u7684\u65f6\u5019\u8fd8\u662f\u8981\u501f\u52a9\u8f6f\u6838\u6765\u5904\u7406\u3002\u4f46\u662f\u5728\u505aMicroBlaze\u5f00\u53d1\u7684\u65f6\u5019\u9047\u5230\u4e86\u4e00\u70b9\u95ee\u9898\uff0c\u5bfc\u81f4\u6211\u82b1\u4e86\u5f88\u591a\u5929\u7684\u65f6\u95f4\u53bb\u601d\u8003\u548c\u6d4b\u8bd5\u3002<\/p>\n\n\n\n<p>\u4e3b\u8981\u95ee\u9898\u662f\uff0c\u5f53\u6211\u5728\u4f7f\u7528MicroBlaze\u5904\u7406\u5668\u7684\u65f6\u5019\uff0c\u6211\u5e0c\u671b\u80fd\u591f\u5b9e\u73b0\u4e0a\u7535\u4e4b\u540e\u4eceflash\u52a0\u8f7d\u7a0b\u5e8f\uff0c\u5e76\u4e14\u6267\u884c\u3002<\/p>\n\n\n\n<p>\u4f46\u662f\u67e5\u5230\u7684\u8d44\u6599\u591a\u90fd\u662f\u4f7f\u7528\u7247\u4e0a\u7684RAM\u8d44\u6e90\u6765\u505aRAM\uff0c\u7136\u540e\u5728\u751f\u6210FPGA\u7684bit\u6587\u4ef6\u7684\u65f6\u5019\u5c06\u4ee3\u7801\u5d4c\u8fdb\u53bb\u3002\u5f53\u4e0a\u7535\u52a0\u8f7d\u7684\u65f6\u5019\uff0c\u7a0b\u5e8f\u5c31\u5728RAM\u4e2d\uff0c\u8fd9\u6837\u81ea\u7136\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884c\u3002\u4f46\u662f\u7247\u4e0aRAM\u5bf8\u571f\u5bf8\u91d1\uff0c\u6211\u7a0b\u5e8f\u5927\u4e00\u70b9\u5c82\u4e0d\u662f\u6210\u672c\u5de8\u5927\uff1f\u4e8e\u662f\u5c31\u6709\u53e6\u5916\u7684\u65b9\u6cd5\u4e86\uff0c\u90a3\u5c31\u662f\u7528\u4e00\u5757\u5c0f\u7684\u7247\u4e0aRAM\uff0c\u7ed9\u91cc\u8fb9\u88c5\u4e0aSREC Bootloader\uff0c\u5b9e\u73b0\u4e0a\u7535\u4e86\u4e4b\u540e\u5c06\u7a0b\u5e8f\u52a0\u8f7d\u5230\u5916\u90e8\u7684SDRAM\u4e2d\uff0c\u8fd9\u4e2a\u65b9\u6cd5\u867d\u7136\u6298\u4e2d\u4e86\u8bb8\u591a\uff0c\u4f46\u662f\u7ed9\u6211\u7684\u4e00\u4e2a\u76f4\u63a5\u5370\u8c61\u5c31\u662f\uff1a<\/p>\n\n\n\n<p><strong>\u4e0d\u7f8e\uff01<\/strong><\/p>\n\n\n\n<p>\u56e0\u4e3a\u8fd9\u4e00\u5757\u5c0f\u7684\u7247\u4e0aRAM\uff0c\u5b83\u5b8c\u6210\u4e86Boot\u4efb\u52a1\u4e4b\u540e\uff0c\u6211\u7a76\u7adf\u8be5\u4e0d\u8be5\u4f7f\u7528\u5b83\u5462\uff1f\u7528\u7684\u8bdd\u5bb9\u91cf\u592a\u5c0f\u4e5f\u6ca1\u6709\u4ec0\u4e48\u7528\u5904\uff0c\u4e0d\u7528\u7684\u8bdd\uff0c\u90a3\u4e48\u8fd9\u4e9b\u8d44\u6e90\u5b8c\u5168\u5c5e\u4e8e\u6d6a\u8d39\uff0c\u80fd\u632a\u5230\u522b\u7684\u5730\u65b9\u8be5\u591a\u597d\uff1f\u6240\u4ee5\u8fd9\u5757RAM\u5b9e\u5c5e\u9e21\u808b\u3002<\/p>\n\n\n\n<p>\u6240\u4ee5\u8fd9\u51e0\u5929\u6211\u4fbf\u7814\u7a76\u4e86\u4e00\u4e0b\u5982\u4f55\u5728<strong>\u4e0d\u4f7f\u7528<\/strong>\u8fd9\u5757\u7247\u4e0aRAM\u7684\u60c5\u51b5\u4e0b\u5b8c\u6210\u4e0a\u7535\u81ea\u542f\u3002<\/p>\n\n\n\n<p>\u9996\u5148\u5206\u6790\u539f\u7406\uff1a\u5f53\u4e0d\u4f7f\u7528\u7247\u4e0aRAM\u7684\u65f6\u5019\uff0c\u4e5f\u5c31\u662f\u8bf4\u6211\u7684\u4ee3\u7801\u4e00\u5f00\u59cb\u662f\u653e\u5728flash\u5f53\u4e2d\u7684\uff0c\u6240\u4ee5\u6211\u9700\u8981\u4e00\u6bb5\u7a0b\u5e8f\u5c06flash\u4e2d\u7684\u7a0b\u5e8f\u590d\u5236\u8fdbSDRAM\u91cc\uff0c\u56e0\u4e3aflash\u662fNAND Flash\u6240\u4ee5\u4e0d\u80fd\u76f4\u63a5\u5c06flash\u5f53RAM\u4f7f\u7528\uff0c\u800cSREC flash loader\u867d\u7136\u4e5f\u662f\u5b8c\u6210\u8fd9\u4e2a\u4efb\u52a1\uff0c\u4e0d\u8fc7\u89c2\u5bdf\u5176\u4ee3\u7801\uff0c\u7531\u4e8e\u5b83\u4f7f\u7528\u4e86data\u7a7a\u95f4\uff0c\u6240\u4ee5\u5728SREC loader\u7a0b\u5e8f\u8fd0\u884c\u524d\u8fd8\u662f\u9700\u8981\u5c06\u5176\u672c\u8eab\u52a0\u8f7d\u5230RAM\u4e2d\u53bb\u3002<\/p>\n\n\n\n<p>\u6240\u4ee5\u8be6\u7ec6\u7684\u89e3\u51b3\u65b9\u6848\u662f\uff1a\u5148\u7f16\u5199\u4e00\u6bb5\u7a0b\u5e8f\u5c06SREC flash loader\u590d\u5236\u5230SDRAM\u4e2d\uff0c\u518d\u4f7f\u7528SREC flash loader\u52a0\u8f7d\u7528\u6237\u7a0b\u5e8f\u3002<\/p>\n\n\n\n<p>\u5148\u770b\u786c\u4ef6\u5de5\u7a0b\u8bbe\u8ba1\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-14.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1151\" height=\"528\" src=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-14.png\" alt=\"\" class=\"wp-image-313\" srcset=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-14.png 1151w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-14-300x138.png 300w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-14-768x352.png 768w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-14-1024x470.png 1024w\" sizes=\"auto, (max-width: 1151px) 100vw, 1151px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-12.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1370\" height=\"977\" src=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-12.png\" alt=\"\" class=\"wp-image-311\" srcset=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-12.png 1370w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-12-300x214.png 300w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-12-768x548.png 768w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-12-1024x730.png 1024w\" sizes=\"auto, (max-width: 1370px) 100vw, 1370px\" \/><\/a><\/figure>\n\n\n\n<p>\u5148\u5c06MicroBlaze\u4e0a\u7684LMB\u5173\u6389\uff0c\u5e76\u4e14\u542f\u7528AXI\u6307\u4ee4\u603b\u7ebf\u3002<strong>\u5c06\u6307\u4ee4\u603b\u7ebf\u548c\u6570\u636e\u603b\u7ebf\u540c\u65f6\u63a5\u5230DDR Memory\u548cExternal Flash\u4e0a\u3002<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-13.png\"><img loading=\"lazy\" decoding=\"async\" width=\"671\" height=\"616\" src=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-13.png\" alt=\"\" class=\"wp-image-312\" srcset=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-13.png 671w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-13-300x275.png 300w\" sizes=\"auto, (max-width: 671px) 100vw, 671px\" \/><\/a><\/figure>\n\n\n\n<p>\u5206\u914d\u5730\u5740\u7a7a\u95f4\uff0c\u8fd9\u91cc\u6211\u5c06DDR RAM\u5206\u914d\u57280x0\u81f30x3FFFFFFF\u4e4b\u95f4\uff0c\u5c06Flash\u5206\u914d\u57280x60000000\u4e4b\u540e\u3002<\/p>\n\n\n\n<p>\u7531\u4e8e\u6211\u4f7f\u7528\u7684\u662fVC707\u8bc4\u4f30\u677f\uff0c\u5176\u4e0a\u642d\u8f7d\u7684\u662fVirtex-7 XC7VX485T-2FFG1761C\u8fd9\u5757FPGA\uff0c\u5176\u914d\u7f6ebit\u6587\u4ef6\u7684\u5927\u5c0f\u4e3a20273588\u5b57\u8282\u53730x\u202d13559B4\u202c\u5b57\u8282\uff0c\u6240\u4ee5\u4ece0x60000000\u52300x613559B4\u202c\u8fd9\u6bb5\u5730\u5740\u7a7a\u95f4\u662f\u4e0d\u80fd\u4f7f\u7528\u7684\uff0c\u6240\u4ee5\u6211\u5c06\u7a0b\u5e8f\u5206\u914d\u57280x61800000\u4e4b\u540e\u3002\u56e0\u6b64\u8c03\u6574MicroBlaze\u7684reset\u5730\u5740\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-11.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1370\" height=\"977\" src=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-11.png\" alt=\"\" class=\"wp-image-310\" srcset=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-11.png 1370w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-11-300x214.png 300w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-11-768x548.png 768w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-11-1024x730.png 1024w\" sizes=\"auto, (max-width: 1370px) 100vw, 1370px\" \/><\/a><\/figure>\n\n\n\n<p>\u5728\u4f8b\u5316\u7684\u65f6\u5019\uff0c\u53ef\u80fd\u4f1a\u78b0\u5230\u4e00\u6761Critical Warning\uff0c\u8fd9\u91cc\u53ef\u4ee5\u4e0d\u7528\u7406\u4f1a\uff0c\u8fd9\u662f\u7531\u4e8e\u6ca1\u6709\u4f7f\u7528\u7247\u4e0aRAM\u5f15\u8d77\u7684\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-10.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1299\" height=\"180\" src=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-10.png\" alt=\"\" class=\"wp-image-309\" srcset=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-10.png 1299w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-10-300x42.png 300w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-10-768x106.png 768w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-10-1024x142.png 1024w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><\/figure>\n\n\n\n<p>\u63a5\u4e0b\u6765\u8fdb\u884c\u8f6f\u4ef6\u5f00\u53d1\uff0c\u9996\u5148\u7f16\u8bd1\u751f\u6210SREC Bootloader\uff1a<a href=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-09.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-308\" src=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-09.png\" alt=\"\" width=\"374\" height=\"71\" srcset=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-09.png 374w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-09-300x57.png 300w\" sizes=\"auto, (max-width: 374px) 100vw, 374px\" \/><\/a><\/p>\n\n\n\n<p>\u5c06blconfig.h\u4e2dflash\u6620\u50cf\u5730\u5740\u6539\u6210\u5982\u56fe\u6240\u793a\u3002\u8fd9\u4e2a\u5730\u5740\u4fbf\u662f\u4e4b\u540e\u7528\u6237\u7a0b\u5e8f\u5b58\u50a8\u70b9\u3002<\/p>\n\n\n\n<p>\u5c06\u94fe\u63a5\u811a\u672c\u4e2d\u7684\u914d\u7f6e\u66f4\u6539\u4e3a\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-08.png\"><img loading=\"lazy\" decoding=\"async\" width=\"715\" height=\"477\" src=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-08.png\" alt=\"\" class=\"wp-image-307\" srcset=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-08.png 715w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-08-300x200.png 300w\" sizes=\"auto, (max-width: 715px) 100vw, 715px\" \/><\/a><\/figure>\n\n\n\n<p>\u4e3b\u8981\u6ce8\u610f\u4fee\u6539DDR\u7684Base Address\uff0c\u7531\u4e8eBootloader\u5728\u52a0\u8f7d\u7528\u6237\u7a0b\u5e8f\u7684\u65f6\u5019\u6211\u4eec\u4e0d\u5e0c\u671b\u5176\u5c06\u81ea\u5df1\u7834\u574f\uff0c\u6240\u4ee5\u653e\u5728\u5185\u5b58\u4e2d\u9ad8\u4f4d\u7684\u4f4d\u7f6e\u3002\u5982\u679c\u63d0\u793a\u7a7a\u95f4\u4e0d\u8db3\u7684\u8bdd\uff0c\u53ef\u4ee5\u8003\u8651\u964d\u4f4e\u4e00\u70b9\u57fa\u5730\u5740\u6216\u8005\u51cf\u5c0f\u4e00\u70b9\u5806\u6808\u7a7a\u95f4\u3002<\/p>\n\n\n\n<p>\u7f16\u8bd1\u751f\u6210elf\u6587\u4ef6\u540e\uff0c\u8fd8\u4e0d\u80fd\u76f4\u63a5\u62ff\u6765\u4f7f\u7528\uff0c\u9700\u8981\u5c06\u5176\u8f6c\u6362\u4e3a\u5185\u5b58\u6620\u50cf\uff0c\u624d\u80fd\u5199\u5165flash\u3002<\/p>\n\n\n\n<p>\u5728SDK\u7684Xilinx-&gt;Launch Shell\u4e2d\u6253\u5f00\u547d\u4ee4\u884c\uff0c\u8fdb\u5165\u5305\u542b\u7f16\u8bd1\u597delf\u6587\u4ef6\u7684\u76ee\u5f55\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u751f\u6210\u5185\u5b58\u6620\u50cf\u6587\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"atomic\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">data2mem -bd FILNAME.elf -d -o m FILNAME.mem<\/pre>\n\n\n\n<p>\u7528UltraEdit\u6253\u5f00\u6587\u4ef6\uff0c\u53ef\u4ee5\u770b\u5230\u5404\u4e2a\u4e0d\u540c\u90e8\u5206\u7684\u5185\u5b58\u6570\u636e\u5df2\u7ecf\u5168\u90e8\u88ab\u5bfc\u51fa\u6765\u4e86\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-07.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1047\" height=\"522\" src=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-07.png\" alt=\"\" class=\"wp-image-306\" srcset=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-07.png 1047w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-07-300x150.png 300w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-07-768x383.png 768w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-07-1024x511.png 1024w\" sizes=\"auto, (max-width: 1047px) 100vw, 1047px\" \/><\/a><\/figure>\n\n\n\n<p>\u5c060x3FFFE000\u540e\u9762\u8fd9\u4e00\u6bb5\u6570\u636e\u590d\u5236\u51fa\u6765(\u5176\u4f59\u533a\u6bb5\u90e8\u5206\u4e3a\u4e2d\u65ad\u548c\u590d\u4f4d\u8df3\u8f6c\uff0c\u53ef\u4ee5\u5220\u6389)\uff0c\u8f6c\u6362\u6210\u4e8c\u8fdb\u5236\u6d41\u6587\u4ef6\uff0c\u8fd9\u91cc\u6211\u81ea\u5df1\u7f16\u5199\u4e86\u4e00\u4e2a\u7b80\u964b\u7684\u5c0f\u5de5\u5177\u6765\u5b8c\u6210\u8fd9\u4e2a\u64cd\u4f5c(\u53ef\u6267\u884c\u7a0b\u5e8f\u548c\u6e90\u7801\u89c1\u4e0b\u9762\u7684\u538b\u7f29\u5305)\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/mem2bit.zip\">mem2bit.zip<\/a><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"atomic\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">mem2bit -i FILNAME -o FILNAME<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-06.png\"><img loading=\"lazy\" decoding=\"async\" width=\"787\" height=\"116\" src=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-06.png\" alt=\"\" class=\"wp-image-305\" srcset=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-06.png 787w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-06-300x44.png 300w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-06-768x113.png 768w\" sizes=\"auto, (max-width: 787px) 100vw, 787px\" \/><\/a><\/figure>\n\n\n\n<p>\u8fd9\u6837\u4fbf\u751f\u6210\u4e86SREC Bootloader\u7684\u5185\u5b58\u6620\u50cf\u6587\u4ef6\u3002<\/p>\n\n\n\n<p>\u4f46\u662f\u5149\u662f\u8fd9\u6837\u4e5f\u662f\u4e0d\u591f\u7684\uff0c\u8fd8\u9700\u8981\u4e00\u6bb5\u7a0b\u5e8f\u5c06\u5176\u590d\u5236\u8fdb\u5165\u5185\u5b58\u4e2d\uff0c\u5426\u5219\u5176\u5bf9data\u6bb5\u6570\u636e\u7684\u5199\u5165\u64cd\u4f5c\u4f1a\u5bfc\u81f4\u7a0b\u5e8f\u51fa\u9519\u3002<\/p>\n\n\n\n<p>\u6240\u4ee5\u9700\u8981\u81ea\u5df1\u7f16\u5199\u4e00\u6bb5\u7a0b\u5e8f\u6765\u5b8c\u6210\u8fd9\u4e2a\u64cd\u4f5c\u3002\u6253\u5f00\u8bb0\u4e8b\u672c\u7f16\u5199\u5e76\u4fdd\u5b58\u4ee5\u4e0b\u8fd9\u6bb5\u6c47\u7f16\u4ee3\u7801\uff0c\u5e76\u66f4\u6539\u5176\u4e2d\u7684\u5730\u5740\u91cf\u9002\u914d\u81ea\u5df1\u7684\u7cfb\u7edf\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"asm\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">.global _start\n _start:\naddi r1, r0, 0x00001FF0    #r1 is flash data size\naddi r2, r0, 0x61900000    #r2 is flash pointer\naddi r3, r0, 0x3FFFE000    #r3 is mem pointer\naddi r4, r0, -4*5          #r4 is loop back instruction counter\nlwi r5, r2, 0              #load a 32-bit(4byte) data from flash\nswi r5, r3, 0              #store the data to DDR memory\naddi r2, r2, 4             #increase flash pointer by 4\naddi r3, r3, 4             #increase memory pointer by 4\naddi r1, r1, -4            #decrease flash data counter\nbne r1, r4                 #check if flash data is all copied\nbrai 0x3FFFE000            #jump to srec bootloader place<\/pre>\n\n\n\n<p>\u7ee7\u7eed\u5728Shell\u4e2d\u8f93\u5165\u547d\u4ee4\u5c06\u5176\u8f6c\u6210\u5185\u5b58\u6620\u50cf\u6587\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"atomic\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">mb-as FILNAME -o FILNAME.o -mlittle-endian\nmb-ld FILNAME.o -Ttext 0x0 -o FILNAME.elf -oformat elf32-microblaze\ndata2mem -bd FILNAME.elf -d -o m FILNAME.mem\nmem2bit -i FILNAME -o FILNAME<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-04.png\"><img loading=\"lazy\" decoding=\"async\" width=\"726\" height=\"165\" src=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-04.png\" alt=\"\" class=\"wp-image-303\" srcset=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-04.png 726w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-04-300x68.png 300w\" sizes=\"auto, (max-width: 726px) 100vw, 726px\" \/><\/a><\/figure>\n\n\n\n<p>\u5230\u6b64\u4e3a\u6b62\u6211\u5206\u522b\u5f97\u5230\u4e86\u4e24\u4e2aboot\u6587\u4ef6\uff0c\u5206\u522b\u662f\u81ea\u5df1\u7f16\u5199\u7684boot0.boot\uff0c\u53e6\u4e00\u4e2a\u662fSRECBoootloader\u7684boot.boot<\/p>\n\n\n\n<p>\u63a5\u4e0b\u6765\u4f7f\u7528SDK\u4e2d\u7684flash\u5de5\u5177\u5c06\u5176\u70e7\u5199\u8fdb\u76f8\u5e94\u7684\u4f4d\u7f6e\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-02.png\"><img loading=\"lazy\" decoding=\"async\" width=\"555\" height=\"444\" src=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-02.png\" alt=\"\" class=\"wp-image-301\" srcset=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-02.png 555w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-02-300x240.png 300w\" sizes=\"auto, (max-width: 555px) 100vw, 555px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-03.png\"><img loading=\"lazy\" decoding=\"async\" width=\"555\" height=\"444\" src=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-03.png\" alt=\"\" class=\"wp-image-302\" srcset=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-03.png 555w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-03-300x240.png 300w\" sizes=\"auto, (max-width: 555px) 100vw, 555px\" \/><\/a><\/figure>\n\n\n\n<p>\u8fd9\u6837\u6574\u4e2abootloader\u90e8\u5206\u5c31\u505a\u597d\u4e86\uff0c\u63a5\u4e0b\u6765\u5c06\u5e94\u7528\u7a0b\u5e8f\u70e7\u5199\u8fdb0x61A00000\u4e2d\u53bb\u4fbf\u53ef\u4ee5\u542f\u52a8\u4e86\u3002\u5f53\u7136\u5728\u7f16\u8bd1\u5e94\u7528\u7a0b\u5e8f\u524d\u8981\u6ce8\u610f\u4fee\u6539\u7a0b\u5e8f\u7684\u590d\u4f4d\u548c\u4e2d\u65ad\u70b9\uff0c\u7531\u4e8e\u6700\u5f00\u59cb\u8bbe\u7f6e\u4e86\u590d\u4f4d\u5730\u5740\uff0c\u6240\u4ee5xilinx\u5de5\u5177\u4f1a\u81ea\u52a8\u751f\u6210\u5728flash\u4e2d\u7684\u590d\u4f4d\u70b9\uff0c\u8fd9\u91cc\u8981\u6ce8\u610f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-01.png\"><img loading=\"lazy\" decoding=\"async\" width=\"324\" height=\"309\" src=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-01.png\" alt=\"\" class=\"wp-image-300\" srcset=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-01.png 324w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-01-300x286.png 300w\" sizes=\"auto, (max-width: 324px) 100vw, 324px\" \/><\/a><\/figure>\n\n\n\n<p>\u5c06\u7a0b\u5e8f\u7f16\u8bd1\u597d\u4e86\u4e4b\u540e\u5199\u5165flash\u76f8\u5e94\u4f4d\u7f6e\uff0c\u9700\u8981\u8bbe\u7f6e\u4e3aSREC\u53ef\u52a0\u8f7d\u683c\u5f0f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-00.png\"><img loading=\"lazy\" decoding=\"async\" width=\"577\" height=\"444\" src=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-00.png\" alt=\"\" class=\"wp-image-299\" srcset=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-00.png 577w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-00-300x231.png 300w\" sizes=\"auto, (max-width: 577px) 100vw, 577px\" \/><\/a><\/figure>\n\n\n\n<p>\u63a5\u4e0b\u6765\u5c06FPGA\u914d\u7f6e\u6587\u4ef6\u5199\u5165flash\uff0c\u4fbf\u53ef\u4ee5\u5b9e\u73b0\u4e0a\u7535\u81ea\u542f\u4e86\u3002\u6548\u679c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-15.png\"><img loading=\"lazy\" decoding=\"async\" width=\"482\" height=\"558\" src=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-15.png\" alt=\"\" class=\"wp-image-319\" srcset=\"https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-15.png 482w, https:\/\/www.tiferking.cn\/wp-content\/uploads\/2018\/12\/MiroBlaze-15-259x300.png 259w\" sizes=\"auto, (max-width: 482px) 100vw, 482px\" \/><\/a><\/figure>\n\n\n\n<p>\u81f3\u6b64MicroBlaze\u4e0d\u4f7f\u7528\u7247\u4e0aRAM\u81ea\u542f\u52a8\u4fbf\u505a\u597d\u4e86\u3002<\/p>\n\n\n\n<p>\u8865\u5145\uff1a\u5728\u5199\u5b8c\u6587\u7ae0\u540e\uff0c\u5f00\u53d1\u7684\u8fc7\u7a0b\u4e2d\u53c8\u78b0\u5230\u95ee\u9898\u3002\u662f\u7531\u4e8eMicroBlaze\u7684\u4e2d\u65ad\u3001\u5f02\u5e38\u7684\u5730\u5740\u6ca1\u6709\u627e\u5230\u5355\u72ec\u66f4\u6539\u7684\u65b9\u6cd5\uff0c\u5728\u624b\u518c\u4e2d\u5b83\u4eec\u662f\u4ee5\u590d\u4f4d\u5730\u5740\u4e3a\u57fa\u7840\u52a0\u7684\uff08\u8fd9\u4e00\u70b9\u5c31\u548cNios II\u6709\u70b9\u5dee\u8ddd\u4e86\uff0c\u7075\u6d3b\u6027\u660e\u663e\u4e0d\u5982Nios II\uff09\uff0c\u6240\u4ee5\u5728\u505aboot0\u7684\u65f6\u5019\uff0c\u9700\u8981\u5c06\u4e2d\u65ad\u5f02\u5e38\u7b49\u8fdb\u884c\u91cd\u5b9a\u5411\u3002\u6240\u4ee5\u5c06\u6c47\u7f16\u90e8\u5206\u7684\u4ee3\u7801\u66f4\u6539\u4e3a\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"asm\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">.section .vectors.reset,\"ax\"\n.global _start\n_start:\nbrai _main                 #reset jump\n\n.section .vectors.sw_exception,\"ax\"\n_vectors_usrvec:\nbrai 0x00000008            #user vector jump\n\n.section .vectors.interrupt,\"ax\"\n_vectors_int:\nbrai 0x00000010            #interrupt jump\n\n.section .vectors.break,\"ax\"\n_vectors_break:\nbrai 0x00000018            #break jump\n\n.section .vectors.hw_exception,\"ax\"\n_vectors_exception:\nbrai 0x00000020            #hardware exception jump\n\n.section .text\n_main:\naddi r1, r0, 0x00001FF0    #r1 is flash data size\naddi r2, r0, 0x61900000    #r2 is flash pointer\naddi r3, r0, 0x3FFFE000    #r3 is mem pointer\naddi r4, r0, -4*5          #r4 is loop back instruction counter\nlwi r5, r2, 0              #load a 32-bit(4byte) data from flash\nswi r5, r3, 0              #store the data to DDR memory\naddi r2, r2, 4             #increase flash pointer by 4\naddi r3, r3, 4             #increase memory pointer by 4\naddi r1, r1, -4            #decrease flash data counter\nbne r1, r4                 #check if flash data is all copied\nbrai 0x3FFFE000            #jump to srec bootloader place\n\ufeff<\/pre>\n\n\n\n<p>\u540c\u65f6\u5728\u94fe\u63a5\u65f6\u5e94\u8be5\u4f7f\u7528-T\u53c2\u6570\u52a0\u4e0a\u94fe\u63a5\u811a\u672c\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ENTRY(_start)\n\nSECTIONS\n{\n.vectors.reset 0x61800000 : {\n   *(.vectors.reset)\n} \n\n.vectors.sw_exception 0x61800008 : {\n   *(.vectors.sw_exception)\n} \n\n.vectors.interrupt 0x61800010 : {\n   *(.vectors.interrupt)\n} \n\n.vectors.break 0x61800018 : {\n  *(.vectors.break)\n}\n\n.vectors.hw_exception 0x61800020 : {\n  *(.vectors.hw_exception)\n}\n\n.text 0x61800050 : {\n\t*(.text)\n}\n}\n\ufeff<\/pre>\n\n\n\n<p>\u5176\u4f59\u6b65\u9aa4\u5747\u4e0e\u539f\u6587\u76f8\u540c\u3002<\/p>\n\n\n\n<p>(\u5b8c)<\/p>\n\n\n\n<p>\u9644\uff1amem2bit\u6e90\u7801:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ mem2bit.cpp : \u5b9a\u4e49\u63a7\u5236\u53f0\u5e94\u7528\u7a0b\u5e8f\u7684\u5165\u53e3\u70b9\u3002\n\/\/\n\n#include \n#include \n\n\nint main(int argc, char *argv[])\n{\n\tchar *infile_name, *outfile_name;\n\tbool flag_infile, flag_outfile;\n\tstd::fstream infile;\n\tstd::fstream outfile;\n\tint byte_buf;\n\n\tflag_infile = false;\n\tflag_outfile = false;\n\tfor (size_t i = 0; i &lt; argc; i++)\n\t{\n\t\tif (strcmp(argv[i], \"-i\") == 0)\n\t\t{\n\t\t\tinfile_name = argv[i + 1];\n\t\t\tflag_infile = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (strcmp(argv[i], \"-o\") == 0)\n\t\t{\n\t\t\toutfile_name = argv[i + 1];\n\t\t\tflag_outfile = true;\n\t\t\tcontinue;\n\t\t}\n\t}\n\tif (!(flag_infile &amp; flag_outfile))\n\t{\n\t\tstd::cout &lt;&lt; \"Useage: mem2bit -i  -o \\n\";\n\t\treturn 1;\n\t}\n\tinfile.open(infile_name, std::ios::in);\n\tif (!infile.is_open())\n\t{\n\t\tstd::cout &lt; &lt; \"Open\" &lt;&lt; infile_name &lt;&lt; \"Error!\\n\";\n\t\treturn 1;\n\t}\n\toutfile.open(outfile_name, std::ios::out | std::ios::binary);\n\tif (!infile.is_open())\n\t{\n\t\tinfile.close();\n\t\tstd::cout &lt;&lt; \"Open\" &lt;&lt; outfile_name &lt;&lt; \"Error!\\n\";\n\t\treturn 1;\n\t}\n\twhile (!infile.eof())\n\t{\n\t\tinfile >> std::hex >> byte_buf;\n\t\toutfile.write((char *)&amp;byte_buf, 1);\n\t}\n\tstd::cout &lt; &lt; \"Generate done!\\n\";\n\tinfile.close();\n\toutfile.close();\n\n    return 0;\n}\n\ufeff<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u5728\u5b66Xilinx\u516c\u53f8\u7684\u5f00\u53d1\u6d41\u7a0b\uff0c\u6b63\u5de7\u5b66\u5230\u4e86MicroBlaze\u5904\u7406\u5668\uff0c\u7531\u4e8e\u4f7f\u7528\u7684\u8fd9\u6b3eVC707\u5f00\u53d1\u677f\u6ca1\u6709\u50cf [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":319,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-297","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fpga"],"_links":{"self":[{"href":"https:\/\/www.tiferking.cn\/index.php\/wp-json\/wp\/v2\/posts\/297","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tiferking.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tiferking.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tiferking.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tiferking.cn\/index.php\/wp-json\/wp\/v2\/comments?post=297"}],"version-history":[{"count":12,"href":"https:\/\/www.tiferking.cn\/index.php\/wp-json\/wp\/v2\/posts\/297\/revisions"}],"predecessor-version":[{"id":482,"href":"https:\/\/www.tiferking.cn\/index.php\/wp-json\/wp\/v2\/posts\/297\/revisions\/482"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tiferking.cn\/index.php\/wp-json\/wp\/v2\/media\/319"}],"wp:attachment":[{"href":"https:\/\/www.tiferking.cn\/index.php\/wp-json\/wp\/v2\/media?parent=297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tiferking.cn\/index.php\/wp-json\/wp\/v2\/categories?post=297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tiferking.cn\/index.php\/wp-json\/wp\/v2\/tags?post=297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}