Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Icarus Simulation and View Waveforms with GTKWave simple tutorial

Status
Not open for further replies.

blooz

Advanced Member level 2
Joined
Dec 29, 2010
Messages
560
Helped
121
Reputation
242
Reaction score
116
Trophy points
1,343
Location
India
Activity points
4,985
First you need to download the Free Waveform viewer GTKwave
h**p://gtkwave.sourceforge.net/

then Generate a VCD file


Files

//Testbench

//Save as countertb.v
////////////////////////////////
`timescale 1ns/1ns


module countertb();

reg clk;
reg reset;

wire [3:0] q;

counter instance0(.clk(clk),.q(q),.reset(reset));

initial
begin
clk=1'b0;
reset=1'b1;
#10 reset=1'b0;
#1600 ;
$finish;
end

initial
begin
forever #20 clk=~clk;
end

initial
begin
$monitor("time=>%tns q=>%b",$time,q);
$dumpfile(counter_wave.vcd);
$dumpvars();
end

endmodule



//Save As counter.v
///////////////////////////


// 4 bit Counter


module counter(clk,q,reset);
input clk;
input reset;
output reg [3:0] q;
initial
begin
q=4'b0000;
end

always@( posedge clk)
begin
if (reset==1'b1)
q=4'b0000;
else
q=q+1;

end

endmodule



step

1.Compile and simulate in Icarus verilog

iverilog -o result counter.v countertb.v

vvp result

2.Simulation results are visible and a VCD file will be produced ,we have named it as
counter_wave.vcd


3.run
gtkwave counter_wave.vcd

then a graphical window will be shown

screen shots are given in the pictures section
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top