{"id":1209,"date":"2012-06-14T16:03:14","date_gmt":"2012-06-14T08:03:14","guid":{"rendered":"http:\/\/learn-house.idv.tw\/?p=1209"},"modified":"2012-06-14T23:57:45","modified_gmt":"2012-06-14T15:57:45","slug":"%e5%a6%82%e4%bd%95%e6%af%94%e8%bc%83windows%e8%88%87liunx%e4%b8%8b%e6%89%80%e7%94%a2%e7%94%9f%e7%9a%84%e6%96%87%e5%ad%97%e6%aa%94-soc-nc-verilog-vcs-ultraedit","status":"publish","type":"post","link":"https:\/\/learn-house.idv.tw\/?p=1209","title":{"rendered":"[\u8f49\u8f09]\u5982\u4f55\u6bd4\u8f03Windows\u8207Liunx\u4e0b\u6240\u7522\u751f\u7684\u6587\u5b57\u6a94? (SOC) (NC-Verilog) (VCS) (UltraEdit)"},"content":{"rendered":"<div id=\"cnblogs_post_body\">\n<p><strong>Abstract<\/strong><br \/>\n\u70ba\u4e86\u9a57\u8b49RTL\u7684\u7d50\u679c\u662f\u5426\u8207\u539f\u672c\u7528C\u6216\u8005Matlab\u6240\u63cf\u8ff0\u7684\u6f14\u7b97\u6cd5\u7b49\u6548\uff0c\u6211\u5011\u5e38\u6703\u5c07Verilog\u8207C\u6216\u8005Matlab\u7684\u7d50\u679cdump\u5230\u6587\u5b57\u6a94\uff0c\u7136\u5f8c\u7528UltraEdit\u6bd4\u8f03\uff0c\u70ba\u4ec0\u9ebc\u660e\u660e\u7528UltraEdit\u770b\u8d77\u4f86\u4e00\u6a23\uff0c\u4f46\u4f7f\u7528UltraCompare\u6bd4\u8f03\u537b\u4e0d\u540c\u5462?<\/p>\n<p><strong>Introduction<br \/>\n\u4f7f\u7528\u74b0\u5883\uff1aVisual Studio 2010 + NC-Verilog 5.4 + UltraEdit 13.10a+2<\/strong><\/p>\n<p>\u672c\u6587\u5c07\u8a0e\u8ad6\u4ee5\u4e0b\u4e3b\u984c\uff1a<\/p>\n<p>1.Windows\u8207Linux\u6587\u5b57\u6a94\u683c\u5f0f\u7684\u5dee\u7570<\/p>\n<p>2.\u70ba\u4ec0\u9ebc\u7528UltraEdit\u958b\u555fLinux\u7684\u6587\u5b57\u6a94\u8207Notepad\u958b\u555f\u7d50\u679c\u4e0d\u4e00\u6a23?<\/p>\n<p>3.\u5982\u4f55\u4f7f\u7528UltraCompare\u6bd4\u8f03Windows\u8207Linux\u4e0b\u6240\u7522\u751f\u7684\u6587\u5b57\u6a94?<\/p>\n<p>4.Conclusion<\/p>\n<p><strong>Windows\u8207Linux\u6587\u5b57\u6a94\u683c\u5f0f\u7684\u5dee\u7570<\/strong><\/p>\n<p><!--more-->\u5728\u6b64\u6211\u5011\u505a\u4e00\u500b\u5c0f\u5c0f\u7684\u5be6\u9a57\uff0c\u540c\u6642\u7528Visual Studio 2010\u7684C\u8a9e\u8a00\u8207NC-Verilog (DOS\u7248\uff0c\u4f46\u56e0\u70ba\u662f\u7531Linux\u7248\u79fb\u690d\uff0c\u6240\u4ee5\u6240\u7522\u751f\u7684\u6587\u5b57\u6a94\u4e00\u6a23\u662fLinux\u683c\u5f0f)\u7522\u751f\u76f8\u540c\u5167\u5bb9\u7684\u6587\u5b57\u6a94\uff0c\u8a66\u8457\u6bd4\u8f03\u5176\u7d50\u679c\u7684\u5dee\u7570\u3002<\/p>\n<p><strong>simple_text.c \/ C<\/strong><\/p>\n<div>\n<div><a title=\"\u590d\u5236\u4ee3\u7801\"><img decoding=\"async\" src=\"http:\/\/common.cnblogs.com\/images\/copycode.gif\" alt=\"\u590d\u5236\u4ee3\u7801\" \/><\/a><\/div>\n<pre>\r\n<div> 1 \/* \r\n 2 (C) OOMusou 2011 http:\/\/oomusou.cnblogs.com\r\n 3 \r\n 4 Filename    : simple_text.c\r\n 5 Compiler    : Visual C++ 10.0\r\n 6 Description : simple text\r\n 7 Release     : Jun.15,2011 1.0\r\n 8 \u00a0*\/\r\n 9 \r\n10 #include &lt;stdio.h&gt;\r\n11 \r\n12 \u00a0int main() {\r\n13   FILE *fp;\r\n14   int i;\r\n15 \r\n16   fp = fopen(\"simple_text.txt\", \"w\");\r\n17   for(i = 0; i &lt; 2; i++)\r\n18     fprintf(fp, \"%1d\\n\", i);\r\n19 \r\n20   fclose(fp);\r\n21 }<\/div><\/pre>\n<div><a title=\"\u590d\u5236\u4ee3\u7801\"><img decoding=\"async\" src=\"http:\/\/common.cnblogs.com\/images\/copycode.gif\" alt=\"\u590d\u5236\u4ee3\u7801\" \/><\/a><\/div>\n<\/div>\n<p><strong>\u57f7\u884c\u7d50\u679c<\/strong><\/p>\n<div>\n<pre>\r\n<div>0\r\n1<\/div><\/pre>\n<\/div>\n<p><strong>simple_text.v \/ Verilog<\/strong><\/p>\n<div>\n<div><a title=\"\u590d\u5236\u4ee3\u7801\"><img decoding=\"async\" src=\"http:\/\/common.cnblogs.com\/images\/copycode.gif\" alt=\"\u590d\u5236\u4ee3\u7801\" \/><\/a><\/div>\n<pre>\r\n<div> 1 \/* \r\n 2 (C) OOMusou 2011 http:\/\/oomusou.cnblogs.com\r\n 3 \r\n 4 Filename    : simple_text.v\r\n 5 Simulator   : NC-Verilog 5.4\r\n 6 Description : simple text\r\n 7 Release     : Jun.15,2011 1.0\r\n 8 \u00a0*\/\r\n 9 \r\n10 \u00a0module simple_text_tb;\r\n11 \r\n12 integer fp;\r\n13 integer i;\r\n14 \r\n15 initial begin\r\n16   fp = $fopen(\"simple_text.txt\");\r\n17   \r\n18   for(i = 0; i &lt; 2; i = i + 1)\r\n19     $fwrite(fp, \"%1d\\n\", i);\r\n20     \r\n21   $fclose(fp);\r\n22 end\r\n23 \r\n24 endmodule<\/div><\/pre>\n<div><a title=\"\u590d\u5236\u4ee3\u7801\"><img decoding=\"async\" src=\"http:\/\/common.cnblogs.com\/images\/copycode.gif\" alt=\"\u590d\u5236\u4ee3\u7801\" \/><\/a><\/div>\n<\/div>\n<p><strong>\u57f7\u884c\u7d50\u679c<\/strong><\/p>\n<div>\n<pre>\r\n<div>0\r\n1<\/div><\/pre>\n<\/div>\n<p>\u7406\u8ad6\u4e0a\uff0c\u9019\u5169\u500b\u6587\u5b57\u6a94\u61c9\u8a72\u5b8c\u5168\u76f8\u540c\uff0c\u5728Windows\u4e0b\u7528Notepad\u53bb\u958b\u555fC\u6240\u7522\u751f\u7684\u6587\u5b57\u6a94\uff0c\u8207\u5728Linux\u7528Gedit\u53bb\u958b\u555fVerilog\u6240\u7522\u751f\u7684\u6587\u5b57\u6a94\uff0c\u770b\u8d77\u4f86\u662f\u5b8c\u5168\u4e00\u6a23\u7684\u3002<\/p>\n<p>\u4f46\u82e5\u7528UltraEdit\u4f7f\u7528Hex Edit (\u7de8\u8f2f \u2013&gt; \u5341\u516d\u9032\u4f4d\u529f\u80fd \u2013&gt; \u5341\u516d\u9032\u4f4d\u7de8\u8f2f) \u6703\u767c\u73fe\u5169\u8005\u7684\u4e0d\u540c\uff1a<\/p>\n<p><strong>\u4f7f\u7528UltraEdit\u53bb\u958b\u555fC\u6240\u7522\u751f\u7684\u6587\u5b57\u6a94<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"text00\" src=\"http:\/\/images.cnblogs.com\/cnblogs_com\/oomusou\/201106\/20110616071338631.gif\" border=\"0\" alt=\"text00\" width=\"585\" height=\"438\" \/><\/p>\n<p><strong>\u4f7f\u7528UltraEdit\u53bb\u958b\u555fVerilog\u6240\u7522\u751f\u7684\u6587\u5b57\u6a94<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"text01\" src=\"http:\/\/images.cnblogs.com\/cnblogs_com\/oomusou\/201106\/20110616071338141.gif\" border=\"0\" alt=\"text01\" width=\"585\" height=\"438\" \/><\/p>\n<p>\u6bd4\u8f03\u5169\u8005\u7684\u5dee\u7570\uff0cUltraEdit\u6703\u5728\u4e0b\u65b9\u5f88\u8070\u660e\u5730\u544a\u8a34\u4f60\u9019\u662fDOS\u9084\u662fUNIX\u4e0b\u7684\u6587\u5b57\u6a94\uff0c\u9664\u4e86\u6587\u5b57\u6a94\u672c\u8eab\u7684\u5167\u5bb9\u5916(0\u7684ACSII\u8868\u793a\u6cd516\u9032\u4f4d\u503c\u70ba0x30\uff0c1\u70ba0x31)\uff0c\u5269\u4e0b\u5169\u8005\u7684\u5dee\u7570\u5c31\u5728\u63db\u884c\u65b9\u5f0f\u7684\u4e0d\u540c\u3002<\/p>\n<p><strong>Windows\u4f7f\u7528\u7684\u63db\u884c\u7b26\u865f\u70ba0x0D\u82070x0A\uff0c\u4e5f\u5c31\u662f\u4f7f\u7528\u4e86CR(carriage return)\u8207LF(new line feed)\u70ba\u63db\u884c\u7b26\u865f\u3002<\/strong><\/p>\n<p><strong>Linux\u4f7f\u7528\u7684\u63db\u884c\u7b26\u865f\u70ba0x0A\uff0c\u4e5f\u5c31\u662f\u53ea\u7528\u4e86LF(new line feed)\u70ba\u63db\u884c\u7b26\u865f\u3002<\/strong><\/p>\n<p>\u9019\u5c31\u9020\u6210\u4e86\u4e00\u500b\u5f88\u6709\u8da3\u7684\u73fe\u8c61\uff0c\u82e5\u4f7f\u7528Windows\u7684Notepad\u53bb\u958b\u555fLinux\u7684\u6587\u5b57\u6a94\uff0c\u6703\u767c\u73fe\u7121\u6cd5\u63db\u884c\uff0c(\u56e0\u70ba\u6c92\u6709CR)\uff0c\u800c\u5728Linux \u7684Gedit\u53bb\u958b\u555fWindows\u4e0b\u7684\u6587\u5b57\u6a94\u537b\u6b63\u5e38\uff0c(\u56e0\u70ba\u6709LF)\uff0c\u4f46\u82e5\u7528UltraCompare\u53bb\u6bd4\u5c0d2\u500b\u6587\u5b57\u6a94\uff0c\u537b\u53c8\u662f\u4e0d\u540c\uff0c\u56e0\u70ba UltraCompare\u662f\u7528binary\u7684\u65b9\u5f0f\u53bb\u6bd4\u8f03\uff0c\u4e5f\u5c31\u662f\u76f4\u63a5\u53bb\u6bd4\u5c0d2\u7684\u6a94\u6848\u6bcf\u500bbyte\u7684\u503c\u662f\u5426\u4e00\u6a23\uff0c\u800c\u4e0d\u662f\u53bb\u6bd4\u8f03\u5167\u5bb9\u3002<\/p>\n<p><strong>\u70ba\u4ec0\u9ebc\u7528UltraEdit\u958b\u555fLinux\u7684\u6587\u5b57\u6a94\u8207Notepad\u958b\u555f\u7d50\u679c\u4e0d\u4e00\u6a23?<\/strong><\/p>\n<p>\u6216\u8a31\u4f60\u6703\u8aaa\uff0c\u300e\u6211\u7528UltraEdit\u958b\u555f\u4e86Linux\u7684\u6587\u5b57\u6a94\u4e00\u8f29\u5b50\uff0c\u986f\u793a\u90fd\u5f88\u6b63\u5e38\u554a\uff0c\u5f9e\u4f86\u90fd\u6c92\u6709\u7121\u6cd5\u63db\u884c\u7684\u554f\u984c!!\u300f<\/p>\n<p>\u6211\u5011\u4f86\u770b\u4e00\u4e0bUltraEdit\u7684\u8a2d\u5b9a\uff1a<\/p>\n<p>\u9032\u968e\u2013&gt; \u7d44\u614b \u2013&gt; \u6a94\u6848\u8655\u7406 \u2013&gt; DOS \/ UNIX \/ MAC \u8655\u7406<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"text02\" src=\"http:\/\/images.cnblogs.com\/cnblogs_com\/oomusou\/201106\/201106160732597800.gif\" border=\"0\" alt=\"text02\" width=\"640\" height=\"334\" \/><\/p>\n<p>\u9019\u662fUltraEdit\u7684\u9810\u8a2d\u503c\uff0cDetect file type and prompt to change\uff0c\u9019\u4e5f\u662f\u70ba\u4ec0\u9ebc\u7576\u4f60\u7528UltraEdit\u53bb\u958b\u555fLinux\u7684\u6587\u5b57\u6a94\u6642\uff0c\u90fd\u6703\u51fa\u4e0b\u985e\u4f3c\u4ee5\u4e0b\u7684\u8996\u7a97<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"text03\" src=\"http:\/\/images.cnblogs.com\/cnblogs_com\/oomusou\/201106\/201106160732593962.gif\" border=\"0\" alt=\"text03\" width=\"640\" height=\"126\" \/><\/p>\n<p>\u4e0d\u904e\u4e0d\u8ad6\u4f60\u6309\u4e0b\u300e\u662f\u300f\u6216\u8005\u300e\u5426\u300f\uff0c\u986f\u793a\u7684\u7d50\u679c\u90fd\u4e00\u6a23\uff0c\u56e0\u70baOnly recognize DOS terminated lines  (CR\/LF) as new lines for  editing\u9810\u8a2d\u662f\u6c92\u6709\u52fe\u9078\u7684\uff0c\u4e5f\u5c31\u662f\u5118\u7ba1\u4f60\u662fLinux\u7684\u6587\u5b57\u6a94\uff0c\u6700\u5f8cUltraEdit\u9084\u662f\u6703\u7528Windows\u7684\u6587\u5b57\u6a94\u65b9\u5f0f\u986f\u793a\u3002<\/p>\n<p>\u5efa\u8b70\u6539\u6210\u5982\u4e0b\u7684\u8a2d\u5b9a\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"text04\" src=\"http:\/\/images.cnblogs.com\/cnblogs_com\/oomusou\/201106\/201106160733004028.gif\" border=\"0\" alt=\"text04\" width=\"640\" height=\"334\" \/><\/p>\n<p>\u5c07UNIX\/MAC file detection\/conversion\u8a2d\u5b9a\u6210none\uff0c\u5982\u6b64\u5c07\u4f86\u958b\u555fLinux\u6587\u5b57\u6a94\u5c31\u4e0d\u6703\u51fa\u73fe\u63d0\u793a\u8996\u7a97\u3002<\/p>\n<p>\u52fe\u9078Only recognize DOS terminated lines (CR\/LF) as new lines for editing\uff0c\u5982\u6b64UltraEdit\u7684\u986f\u793a\u5c31\u6703\u8207Notepad\u4e00\u81f4\uff0c\u5982\u6b64\u4e00\u770b\u5230\u5167\u5bb9\u4e0d\u5c0d\u5c31\u77e5\u9053\u662fLinux\u7684\u6587\u5b57\u6a94\u3002<\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528UltraCompare\u6bd4\u8f03Windows\u8207Linux\u4e0b\u6240\u7522\u751f\u7684\u6587\u5b57\u6a94?<\/strong><\/p>\n<p><strong>Step 1\uff1a\u5c07Linux\u6587\u5b57\u6a94\u63db\u884c\u65b9\u5f0f\u8f49\u6210DOS<\/strong><\/p>\n<p><strong>\u6a94\u6848 \u2013&gt; \u8f49\u63db \u2013&gt; UNIX\/MAC\u5230DOS<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"text05\" src=\"http:\/\/images.cnblogs.com\/cnblogs_com\/oomusou\/201106\/201106160749249335.jpg\" border=\"0\" alt=\"text05\" width=\"794\" height=\"671\" \/><\/p>\n<p>\u8f49\u63db\u5f8c\u8b8a\u6210DOS\u683c\u5f0f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"text06\" src=\"http:\/\/images.cnblogs.com\/cnblogs_com\/oomusou\/201106\/201106160749253894.gif\" border=\"0\" alt=\"text06\" width=\"585\" height=\"438\" \/><\/p>\n<p>\u5b58\u6a94\u3002<\/p>\n<p><strong>Step 2\uff1a\u4f7f\u7528UltraCompare\u53bb\u6bd4\u8f03\u6a94\u6848 (\u7565)<\/strong><\/p>\n<p><strong> <\/strong><\/p>\n<p><strong>\u5b8c\u6574\u7a0b\u5f0f\u78bc\u4e0b\u8f09<\/strong><br \/>\n<a href=\"http:\/\/files.cnblogs.com\/oomusou3\/simple_text_c.7z\">simple_text_c.7z<\/a> (\u7531C\u7522\u751fWindows\u7684\u6587\u5b57\u6a94)<br \/>\n<a href=\"http:\/\/files.cnblogs.com\/oomusou3\/simple_text_verilog.7z\">simple_text_verilog.7z<\/a> (\u7531Verilog\u7522\u751fLinux\u7684\u6587\u5b57\u6a94)<\/p>\n<p><strong>Conclusion<br \/>\n<\/strong>\u9019\u662f\u4e00\u500bRTL\u9a57\u8b49\u5e38\u9047\u5230\u7684\u5c0f\u8b70\u984c\uff0c\u7531\u65bc\u5c0dWindows\u8207Linux\u6587\u5b57\u6a94\u683c\u5f0f\u7684\u4e0d\u4e86\u89e3\uff0c\u52a0\u4e0aUltraEdit\u7684\u8a2d\u5b9a\u7e41\u96dc\uff0c\u5e38\u5e38\u660e\u77e5\u9053\u7d50\u679c\u662f\u5c0d\u7684\uff0c\u4f46\u56e0\u70ba\u8a2d\u5b9a\u4e0d\u5c0d\uff0c\u9020\u6210\u4f7f\u7528UltaCompare\u6bd4\u5c0d\u6642\u7d50\u679c\u662f\u932f\u8aa4\u7684\uff0c\u7279\u6b64\u8a18\u4e4b\u3002<\/p>\n<p>\u53e6\u5916\u9084\u53ef\u5f97\u77e5\uff0c\u76f8\u540c\u5167\u5bb9\u7684\u6587\u5b57\u6a94\uff0cWindows\u7684\u6587\u5b57\u6a94\u6703\u8207Linux\u7684\u6587\u5b57\u6a94\u7684\u6a94\u6848size\u4e0d\u540c\uff0c\u4e5f\u662f\u56e0\u70baWindows\u4f7f\u7528CR\u8207LF\u63db\u884c\uff0c\u97002\u500bbyte\uff0cLinux\u50c5\u9700LF\u63db\u884c\uff0c\u53ea\u97001\u500bbyte\uff0c\u56faLinux\u6587\u5b57\u6a94\u6a94\u6848size\u8f03\u5c0f\u3002<\/p>\n<p>\u8cc7\u6599\u4f86\u6e90\uff1ahttp:\/\/www.cnblogs.com\/oomusou\/archive\/2011\/06\/15\/windows_unix_text.html<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Abstract \u70ba\u4e86\u9a57\u8b49RTL\u7684\u7d50\u679c\u662f\u5426\u8207\u539f\u672c\u7528C\u6216\u8005Matlab\u6240\u63cf\u8ff0\u7684\u6f14\u7b97\u6cd5\u7b49\u6548\uff0c\u6211\u5011\u5e38\u6703\u5c07Verilo [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-1209","post","type-post","status-publish","format-standard","hentry","category-12"],"_links":{"self":[{"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/1209"}],"collection":[{"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1209"}],"version-history":[{"count":0,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/1209\/revisions"}],"wp:attachment":[{"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}