Verilog and VHDL on Linux (Ubuntu)
by Mithrandir
For those interested in programming electronic components there is always the possibility to use Xilinx if you are on Windows. Of course, there is a Xilinx port for Linux but it is buggy application and a very large download. This article aims to give an alternative to this application. One that will need only a few KB of download from an apt-get source.
Of course, we are speaking about Icarus Verilog (iverilog), GHDL and GtkWave.
After installing each of them (command line, download, whatever), you can start desgning. Suppose we have the following source:
module bser(en, clk, in, out, done);
input en, clk;
input [7:0]in;
output out, done;
reg [2:0]cst;
reg out, done;
initial
begin
done = 0;
cst = 3'b0;
out = 0;
end
always @(posedge en)
begin
done = 0;
cst = 3'b0;
out = 0;
end
always @(posedge clk)
if (en)
begin
out = in[cst];
cst = cst + 1;
if (cst == 8)
begin
done = 1;
cst = 0;
end
end
endmodule
We need to test our source manually, so we will write a benchmark file (consult the documentation for the syntax) in which we will introduce two lines for dumping information about variables:
module bser_tb;
reg en, clk;
reg [7:0]in;
bser g(en, clk, in, out, done);
initial
begin
en = 0; in=8'b00010111; clk=0;
$dumpfile("bser_tb");
$dumpvars;
#10000 $finish;
end
always
begin
#1 clk = ~clk;
end
initial
begin
#2 en=1;
end
endmodule
Now, we will compile the source, run it and then use gtkwave to see the results. All of this is very repetitive, so a Makefile was needed:
test_bser:
iverilog bser.v bser_tb.v
./a.out
gtkwave bser_tb
rm -f a.out bser_tb
This is what we will obtain after a few milliseconds:
That’s all.

Icarus rulz. În el am implementat un procesor beta – proiect la CN.
Asa e, icarus e super tare. Pt cine nu vrea sa lucreze in mod text, exista si plugin de Eclipse.
Much simpler and beautiful than the bloated Xilinx, thank you. :)
Hai sa nu exageram. Icarus nici macar nu se compara cu Xilins. Pai in Icarus ai Schematic sau State Diagram? Poti sa programezi o placuta direct cu Icarus ?
I always was adept of simple solutions and not bloated applications. Tell me how many features in xilinx do you use and how much would it take for you to find other tools doing that?
You say that I cannot build State Diagrams in Icarus. Well, I can _program_ them instead of basing my effort on a software which is still buggy at some points. Schematic? Forgive me but I _do_ think that Schematic is good only for understanding what code does, not for programming.
[...] Remix 9.10 for Linux – Ubuntu with electronics packages included by default! – Softpedia Verilog and VHDL on Linux (Ubuntu) | Code and Bugs Hope this is useful. Do tell me if you have more info.. Even i love learning Tejaswini :) [...]
thanks guy.
amazing.