Friday, December 18, 2009

verilog in linux


if you dont want to switch to windows just for verilog, then here are some steps
i have used icarus verilog with gtkwave for waveforms
1] install icarus verilog
sudo apt-get install icarus

2]the compiler is installed. its just that easy

3 install another software so that you can see the waveforms
sudo apt-get install gtkwave

4] write a program for verilog. well,with a module and a testbench on it. i use gvim for that.
as an example, i have used decoder4x1
gvim decoder4x1.v

5]don't forget to write these lines in your testbench so that you can view the output waveforms
$dumpfile("check.vcd");
$dumpvars(0,decoder_tb);


where, check.vcd is the output waveform file
decoder_tb is the testbench name

6] once you have written and saved, you need to compile it. for that
iverilog decoder4x1.v -o decoder
then, decoder becomes the object file

7]run the object file
vvp decoder
you get something like in the picture shown
see that the file check.vcd is also opened for output

8] watch your waveform
gtkwave check.vcd

9] just insert your objects and watch the waveforms

well, it may seem long, but its really efficient and easy. just you need to get into the groove
though, today i finally found the link for modelsim in linux. will let you know once i am able to use it.

0 comments: