Code and Bugs

Coding things

VHDL Makefile

leave a comment »

Here is a short example for the Makefile I’m currently using to compile and test my VHDL project:

.PHONY: all clean testbench
 
VCDFILE = tmp
STOPTIME = 42ns
DEBUG = --vcd=$(VCDFILE) --stop-time=$(STOPTIME)
CLEANUP = rm -f $(VCDFILE)
OBJS = clock.o
TARGET =
 
all:
        make test
 
clean:
        ghdl --clean
 
testbench:
        ghdl -m $(TARGET)
        ghdl -r $(TARGET) $(DEBUG)
        gtkwave $(VCDFILE)
        $(CLEANUP)

Which is used in a terminal (providing you have gtkwave and ghdl installed) as follows:

$ make testbench TARGET=Chien_tb

Hoping to be useful, I’ll retire. I’ll be back in a few weeks with more details.

Written by Mithrandir

November 17, 2009 at 10:53 pm

Posted in Open Source

Tagged with , ,

Verilog and VHDL on Linux (Ubuntu)

with 5 comments

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.

Read the rest of this entry »

Written by Mithrandir

October 18, 2009 at 8:02 pm

Uniformity

leave a comment »

Suppose we have to make a quiz. The questions have different degrees of difficulty and come from several different chapters. We have the following problem:How can we ensure that we select the questions uniformly from both domains?

Read the rest of this entry »

Written by Mithrandir

September 21, 2009 at 7:13 am

Haskell and Ubuntu

leave a comment »

For a normal user, wanting a haskell compiler only for some school courses, a simple apt-get command in Ubuntu is enough.  This is not true for someone wanting to really develop something good in Haskell. If he wants to use Ubuntu, then he will get into some problems. I hope that this article will solve some of them.

Read the rest of this entry »

Written by Mithrandir

September 7, 2009 at 10:25 am

Posted in Questions of a Beginner

Tagged with

Looking for the lost harmony

leave a comment »

In fact, this is only a successful attempt at trying the Harmony Search for a toy problem.

Read the rest of this entry »

Written by Mithrandir

September 3, 2009 at 9:35 am

Posted in Questions of a Beginner

Tagged with

Books about Functional Programming

leave a comment »

The last semester at college taught me programming paradigms. Since then, I have always thinked twice before deciding to write a piece of code in C or Haskell.

Read the rest of this entry »

Written by Mithrandir

September 3, 2009 at 6:00 am

Posted in Questions of a Beginner

Tagged with ,

Ending the Monkey Typewriter Problem

leave a comment »

In this post I will show the last results concerning this problem while also showing that there is a way to stop any Monte Carlo simulation from doing useless runs.

Read the rest of this entry »

Written by Mithrandir

August 16, 2009 at 6:59 pm

Posted in Monte Carlo complexity

Tagged with ,

Going Back to the Monkey Typewriter Problem

leave a comment »

I began this blog with two articles on the Monkey Typewriter Theorem and, in the last one, I’ve said that there should be a possibility to stop the Monte Carlo simulation at exactly the needed point (when the required precision has been attained).

Read the rest of this entry »

Written by Mithrandir

August 5, 2009 at 6:56 am

Quick and Small Haskell Question

leave a comment »

Which of the following is better to use?

Read the rest of this entry »

Written by Mithrandir

July 30, 2009 at 3:22 pm

Posted in Questions of a Beginner

Tagged with

Haskell or C?

with 2 comments

I got bored one day and was looking for something to test my coding skills by trying to solve a difficult problem on a difficult contest. Luckily, reddit provided me with this contest which was exactly what I was looking for. Read the rest of this entry »

Written by Mithrandir

July 10, 2009 at 11:55 am

Posted in Contests

Tagged with ,