SOGO論壇
  登入   註冊   找回密碼
查看: 961|回覆: 0
列印 上一主題 下一主題

[技術文章] Icarus Verilog 編譯器 [複製連結]

Rank: 11Rank: 11Rank: 11Rank: 11

熱心參予論壇活動及用心回覆主題勳章 數位硬體勳章

狀態︰ 離線
跳轉到指定樓層
1
發表於 2012-7-15 10:36:56 |只看該作者 |倒序瀏覽
1.Icarus Verilog for Windows — http://bleyer.org/icarus/
◦iverilog : 編譯
◦vvp : 執行
◦iverilog-vpi : Verilog 與 C 的連結方法
■參考:http://iverilog.wikia.com/wiki/Using_VPI
2.Icarus Verilog — http://iverilog.icarus.com/
◦相關套件:http://ivi.sourceforge.net/screenshots.html (波形模擬繪圖)
程式範例
  module main;

  initial
    begin
      $display("Hello, World");
      $finish ;
    end

  endmodule
執行結果
D:\ccc101>cd icarus

D:\ccc101\icarus>iverilog -o hello hello.v

D:\ccc101\icarus>vvp hello
Hello, World
原始說明
By a text editor (or copy hello.vl from the Icarus Verilog examples directory) arrange for this program to be in a text file, "hello.vl". Next, compile this program with a command like this:

% iverilog -o hello hello.vl

The results of this compile are placed into the file "hello", as the "-o" flag tells the compiler where to place the compiled result. Next, execute the compiled program like so:

% vvp hello
Hello, World

在 Windows 中安裝
The easiest way to install under Windows is to get a precompiled installer for the version you wish to install. Icarus Verilog is distributed for Windows users as a self-installing .exe. Just execute the installer and follow the instructions. During the install, take note of the directory where the program is installed: for example,

C:\iverilog is a good place to install.

Once the binary is installed, you need to add the bin directory to your execution path. The executables you need are in C:\iverilog\bin, where the "C:\iverilog" part is actually the root of where you installed the package. The programs are in the bin subdirectory. Put this directory in your PATH environment variable, and the above commands become accessible to you at the command line prompt, or even in batch files.

範例二
D:\ccc101\icarus\samples>iverilog -o sqrt sqrt.vl

D:\ccc101\icarus\samples>vvp sqrt
                   0 main.acc = 0000000000000000
                 225 main.acc = 0000000000000100
                 235 main.acc = 0000000000000110
sqrt(        63) -->     7
                 245 main.acc = 0000000000000111
範例三
D:\ccc101\icarus\samples>iverilog -o ifsr16 ifsr16.v
ifsr16.v: No such file or directory
No top level modules, and no -s option.

D:\ccc101\icarus\samples>iverilog -o lfsr16 lfsr16.v

D:\ccc101\icarus\samples>vvp lfsr16
VCD info: dumpfile lfsr16.vcd opened for output.
xxxxx
10000
00001
00011
00111
01111
11110
11101
11010
10101
01011
10110
01100
11001
10010
00100
01000
10000
00001
00011
00111
01111
11110
11101
11010
10101
01011
10110
01100
11001
10010
00100
01000
10000
參考文獻
1.Icarus Verilog
http://iverilog.icarus.com/
2.Icarus Verilog for Windows
http://bleyer.org/icarus/
3.GPL EDA
http://www.gpleda.org/
喜歡嗎?分享這篇文章給親朋好友︰
               感謝作者     

請注意︰利用多帳號發表自問自答的業配文置入性行銷廣告者,將直接禁訪或刪除帳號及全部文章!
您需要登錄後才可以回覆 登入 | 註冊


本論壇為非營利自由討論平台,所有個人言論不代表本站立場。文章內容如有涉及侵權,請通知管理人員,將立即刪除相關文章資料。侵權申訴或移除要求:abuse@oursogo.com

GMT+8, 2024-5-30 23:38

© 2004-2024 SOGO論壇 OURSOGO.COM
回頂部