attribute signal name in procedure

Joined
Aug 6, 2012
Messages
7
Reaction score
0
Hi !
My question was asked before (2005):
Can I access a std_logic signal attribute that is the signals name as a
string?
The answer given by @Jonathan Bromley was to try the following:
library ieee;
use ieee.std_logic_1164.all;
use std.textio.all;

entity name_attrib is end;

architecture A of name_attrib is
signal SIG: std_logic;
procedure P (signal S: in std_logic) is begin
write(output, "simple_name = " & S'simple_name & CR & LF);
write(output, "path_name = " & S'path_name & CR & LF);
write(output, "instance_name = " & S'instance_name & CR & LF);
end;
begin
process begin
P(SIG);
wait;
end process;
end;
The problem is that I tried that and I got:
# simple_name = s
# path_name = :name_attrib:p[std_logic]:s
# instance_name = :name_attrib(a):p[std_logic]:s

I was expecting # simple_name = SIG.
What did I miss?

I used ModelSim Altera Starter edition 6.5
Thanks.
 
Joined
Aug 6, 2012
Messages
7
Reaction score
0
The aim of all this for me is to write a procedure that checks if a signal value is equal to a given expected value and print a message starting with the name of signal:
proc_check(signal signal_in, constant value_expected)
example proc_check(test,'0') ---> test: ok

any idea?
should that be possible?
 
Joined
Aug 6, 2012
Messages
7
Reaction score
0
that's why:
my procedure must have signal name of type string as an additional input :(
proc_check(test, "test checking", '0') for example :(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top