8
votes

I've been having some issues with some VHDL code I wrote (see my other question for details if you're curious: VHDL integer'image Returns "0"). I need some way to see what is happening to my variables. Everything I read seems to indicate that I should be able to use the 'report' statement to see some output, but nothing I've read tells me where I would see this output.

So my question is this:

I'm writing VHDL code and programming an Altera DE2 FPGA board... Can I use the report statement to get some output, and if so, how? Currently I'm using Altera's Quartus II software. I tried to install ModelSim, but the student edition does not seem to work on Windows 7 (I can't even get an installer to show up... running the setup just leaves a dangling process).

Thanks!

3

3 Answers

10
votes

The report statement prints its output to the console of your simulator. If you work with Altera, you probably want to the ModelSim version that they ship.

a := 5;
report "The value of 'a' is " & integer'image(a);

People also use wave traces to debug their code. But you also need your simulator for that.

You'll need to find a way to get ModelSim installed on your Windows 7.

6
votes

Both Philippe and Martin have provided excellent answers to your question, but I want to emphasize an important aspect of what VHDL is. VHDL is a tool that serves two quite different purposes.

On one side it is an behavioral modeling language for describing concurrent systems. Your model is compiled into an executable and runs on your computer. This is what we refer to as a simulator. It let's you inspect the model during various states of the execution and makes it easy to debug your design before you go to the next step: Implementation.

VHDL is also used as a meta-language for describing a hardware architecture, known as RTL. This description is translated into a list of primitives supported by your architecture (synthesis), and then placed and routed into a physical device.

It's important to understand the difference between these two uses to take full advantage of the language. Happy coding!

1
votes

REPORT prints to the console of the simulator.

Modelsim in GUI mode has a console window. If console mode, it's erm, just a console anyway!

GHDL is also console mode only, so it'll come up in your terminal/CMD window when you run the simulation.

What REPORT can't do is print messages out from the synthesized code.