0
0
VHDLprogramming~5 mins

Report statement for debug output in VHDL

Choose your learning style9 modes available
Introduction

The report statement helps you see messages while your VHDL code runs. It is useful to check what is happening inside your design.

You want to check if a signal changes as expected during simulation.
You want to print a message when a certain condition happens in your code.
You want to debug your design by showing values or status at specific points.
You want to know if a process or block of code is running.
You want to display warnings or errors during simulation.
Syntax
VHDL
report "message" [severity level];

The message must be inside double quotes.

The severity level is optional and can be note, warning, error, or failure. Default is note.

Examples
Simple message with default severity note.
VHDL
report "Starting simulation";
Message with warning severity to highlight a potential issue.
VHDL
report "Value out of range" severity warning;
Message with failure severity to indicate a serious error.
VHDL
report "Critical failure" severity failure;
Sample Program

This simple VHDL program uses report statements to show messages during simulation. It prints when the simulation starts, a warning message after 10 ns, and a note when finished.

VHDL
library ieee;
use ieee.std_logic_1164.all;

entity debug_example is
end debug_example;

architecture behavior of debug_example is
begin
  process
  begin
    report "Simulation started";
    wait for 10 ns;
    report "Checking signal value" severity warning;
    wait for 10 ns;
    report "Simulation finished" severity note;
    wait;
  end process;
end behavior;
OutputSuccess
Important Notes

Report messages appear in the simulator console or log during simulation.

Use severity levels to help identify the importance of messages.

Report statements do not affect hardware behavior; they are only for simulation debugging.

Summary

The report statement prints messages during simulation to help debug.

You can add severity levels like note, warning, error, or failure.

Use report to check your design's behavior step-by-step.