windows XP下 iverilog+GTKWave使用(一)

本文介绍了一种小巧的Verilog仿真与综合工具组合——iverilog与GTKWave。通过该组合可以在Windows环境下轻松进行Verilog代码的编译与波形查看。文章详细展示了iverilog的安装过程及基本使用方法,并提供了简单的示例代码。

感谢网络上的高手,以及官网的资料!

最近又操起了verilog,以前安装过quartus-II和modelsim,装起来很大,现在就是想想能否有一个免费的小巧的综合工具以及波形查看工具,一搜,还真有!iverilog+GTKWave是一个不错的选择,之前在Linux下安装过,现在为了完成作业,看看有没有windows版本的,一查,真有,而且是一个exe文件包含了两个软件(Muzaffer Kal's compilation of GTKWave for Win32 is included in the latest releases.),不错!感谢网上的程序高手!iverilog-0.9.5_setup.exe [6.84MB] 看!只有6.84M哦,装了之后也就25M终于可以不用费尽周折安装QuartusII和modelsim,还要破解!麻烦!这样可以学学linux的知识,以后做嵌入式也有好处!


Icarus Verilog的简介
Icarus Verilog is a Verilog simulation and synthesis tool. It operates as a compiler, compiling source code written in Verilog (IEEE-1364) into some target format. For batch simulation, the compiler can generate an intermediate form called vvp assembly. This intermediate form is executed by the ``vvp'' command. For synthesis, the compiler generates netlists in the desired format.

GTKWave的简介
GTKWave is a fully featured GTK+ v1.2 based wave viewer for Unix and Win32 which reads LXT files as well as standard Verilog VCD/EVCD files and allows their viewing. You can grab version 1.3.11 here .

If you have difficulty in downloading the GTKWave tarball properly, get it from here and rename the file so it doesn't have the ".bin" extension.

The Win32 version is now available (and has been for quite some time) on The Win32 GTKWave Homepage , thanks to Udi Finkelstein . A ready-to-run all libraries included Pentium-Pro optimized version of the binary may be found locally here. Ports to other platforms which GTK supports should be trivial.

gtkwave是一个基于GTK+波形查看器,可以支持LXT, LXT2, VZT, GHW文件以及标准Verilog VCD/EVC文件。


于是和我就在windows下开始使用这连个软件了。
打开终端,就是开始->运行->cmd
G:\Program>iverilog
iverilog: no source files.

Usage: iverilog [-ESvV] [-B base] [-c cmdfile|-f cmdfile]
                [-g1995|-g2001|-g2005] [-g<feature>]
                [-D macro[=defn]] [-I includedir] [-M depfile] [-m module]
                [-N file] [-o filename] [-p flag=value]
                [-s topmodule] [-t target] [-T min|typ|max]
                [-W class] [-y dir] [-Y suf] source_file(s)

See the man page for details.
安装完之后就如上面的所显示的,输入gtkwave,就会自动启动gtkwave这个软件的。
接下来就要来小试牛刀了!

verilog版helloword

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

用这个command-line:
>iverilog -o hello hello.v
就可以生成hello的一个文件,类似gcc哦!
之后
>vvp hello
Hello, World

这样就可以打印出Hello, World!哈哈,有点感觉!


未完待续。。。

在 Linux 系统上安装 Icarus Verilog(`iverilog`)和 GTKWave 工具,可以按照以下步骤进行操作,以便进行 Verilog 代码的仿真和波形查看。 ### 安装 Icarus Verilog Icarus Verilog 是个开源的 Verilog 硬件描述语言仿真器,支持大多数 Linux 发行版。可以通过包管理器安装,也可以从源码编译安装。 #### 使用包管理器安装(推荐) 在基于 Debian 的系统(如 Ubuntu)上,使用 `apt` 命令安装: ```bash sudo apt update sudo apt install iverilog ``` 安装完成后,可以通过以下命令验证是否安装成功: ```bash iverilog -v ``` 该命令将显示 Icarus Verilog 的版本信息,表明安装成功 [^3]。 ### 安装 GTKWave GTKWave个用于查看 Verilog 仿真生成的 `.vcd`(Value Change Dump)文件的开源波形查看器,通常与 Icarus Verilog 配合使用。 #### 使用包管理器安装 在基于 Debian 的系统上,同样可以使用 `apt` 安装 GTKWave: ```bash sudo apt install gtkwave ``` 安装完成后,可以通过以下命令启动 GTKWave: ```bash gtkwave ``` 该命令将打开 GTKWave 的图形界面,可以用于打开 `.vcd` 文件进行波形查看 [^3]。 ### 配置与使用 安装完成后,可以使用 Icarus Verilog 编译并运行 Verilog 代码,并生成 `.vcd` 文件用于 GTKWave 查看波形。 #### 示例:Verilog 代码仿真与波形查看 1. **编写 Verilog 代码** 创建个名为 `counter.v` 的文件,内容如下: ```verilog module counter ( input clk, input reset, output reg [3:0] count ); always @(posedge clk or posedge reset) begin if (reset) count <= 4'b0; else count <= count + 1; end endmodule ``` 2. **编写测试平台(Testbench)** 创建个名为 `tb_counter.v` 的测试平台文件: ```verilog module tb_counter; reg clk; reg reset; wire [3:0] count; counter uut ( .clk(clk), .reset(reset), .count(count) ); initial begin $dumpfile("counter.vcd"); $dumpvars(0, tb_counter); clk = 0; reset = 1; #10 reset = 0; #100 $finish; end always #5 clk = ~clk; endmodule ``` 3. **编译并运行仿真** ```bash iverilog -o counter_sim counter.v tb_counter.v ./counter_sim ``` 上述命令将生成个名为 `counter.vcd` 的波形文件 [^3]。 4. **使用 GTKWave 查看波形** ```bash gtkwave counter.vcd ``` 此时 GTKWave 将打开并显示仿真过程中信号的变化情况 [^3]。 ---
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值