Hi,
if you use Modelsim, there's the "modelsim_util" package with functions
for that purpose. You can use it like this:
library modelsim_lib;
use modelsim_lib.util.all;
-- entity, architecture, signal declarations skipped
-----------------------------------------------------------------------------
-- spy process
-----------------------------------------------------------------------------
sig_spy : process is
begin
init_signal_spy("/DUT/submodule1/submodule2/interesting_sig",
"tb_sig", 1);
wait;
end process sig_spy;
Here, you connect a signal from somewhere inside your DUT to another
signal in your test bench and can then use it there for whatever you need.
Also, in VHDL2008 hierarchical references are supported, so you can do
stuff like this (taken from the Modelsim documentation):
REPORT "Test Pin = " & integer'image(<<SIGNAL .tb.dut.i0.tp : natural>>)
SEVERITY note;
The test bench has to be compiled as VHDL2008, obviously (by calling the
compiler with a corresponding option).
This is part of the VHDL2008 standard, so should work with every
simulator that supports it. But at the moment not every tool vendor has
implemented all of VHDL2008, so this specific feature might not be
supported by your simulator.
Greetings,
Sean