0
0
VhdlHow-ToBeginner · 4 min read

How to Use Report Statement in VHDL for Debugging

In VHDL, use the report statement to display messages during simulation for debugging or status updates. The syntax is report <message> severity <level>; where severity can be note, warning, error, or failure. This helps you track signal values or program flow while simulating your design.
📐

Syntax

The report statement syntax in VHDL is:

report <message> severity <level>;

Here:

  • <message> is a string to display.
  • severity is optional and can be note, warning, error, or failure.
  • If severity is omitted, it defaults to note.

This statement prints the message during simulation and helps identify issues or track progress.

vhdl
report "This is a message" severity warning;
💻

Example

This example shows how to use report inside a process to print a message when a signal changes.

vhdl
library ieee;
use ieee.std_logic_1164.all;

entity report_example is
    port(
        clk : in std_logic;
        reset : in std_logic;
        signal_in : in std_logic
    );
end entity report_example;

architecture behavior of report_example is
begin
    process(clk)
    begin
        if rising_edge(clk) then
            if reset = '1' then
                report "Reset is active" severity note;
            else
                if signal_in = '1' then
                    report "Signal is high" severity warning;
                else
                    report "Signal is low" severity note;
                end if;
            end if;
        end if;
    end process;
end architecture behavior;
Output
During simulation, messages like: "Note: Reset is active" "Warning: Signal is high" "Note: Signal is low" will appear in the simulator console depending on signal values.
⚠️

Common Pitfalls

Common mistakes when using report include:

  • Omitting the severity keyword and expecting an error (it's optional and defaults to note).
  • Using report outside a process or architecture body (it must be inside a process, procedure, or architecture).
  • Expecting report to stop simulation (only failure severity can stop simulation).
  • Using complex expressions directly in the message without converting to string.

Example of wrong and right usage:

vhdl
process
begin
    -- Wrong: missing severity but with semicolon is okay
    report "Message without severity";

    -- Wrong: report outside process (illegal)
    -- report "Outside process" severity error;

    -- Right:
    report "Proper message" severity note;
    wait;
end process;
📊

Quick Reference

KeywordDescription
reportStarts the message statement
"message"Text string to display
severityOptional keyword to specify message level
noteInformational message (default)
warningIndicates a warning condition
errorIndicates an error, simulation continues
failureIndicates a failure, simulation stops

Key Takeaways

Use the report statement to print messages during simulation for debugging.
Severity levels control the importance and effect of the message.
Report statements must be inside processes or architectures.
Omitting severity defaults to note, which does not stop simulation.
Use report to track signal changes or important events in your design.