Monitoring inout signal transactions

V

valtih1978

entity SPY is
port (A : inout Std_Logic);
end SPY;

architecture ARCH of SPY is
begin

process begin
report time'image(now) & ": a = " & std_logic'image(a);
wait on a'transaction;
end process;

end architecture;


architecture TB is
signal A: std_logic;
begin
SPY_I: entity SPY(a)
process begin
wait for 1 fs;
a <= 'Z'; wait for 1 ps;
a <= '1'; wait for 5 ns;
a <= '0'; wait for 20 ns;
end process

I do not drive the signal from the Spy, so output must be (U, Z, 1, 0).
Right? Yet, simulator tells 'a = U' all four times!

I observed this hacking the Zero-Ohm model. Ben Cohen temporarly assigns
a and b to Z there. I do not understand why but that is a solution to
get the normal output (U,Z,1,0). Another is to change port type inout ->
in. Is is supposed VHDL behaviour? IMO, it is strange furthermore
because I consider normal, architecture-declared signals, as inout
because you can read and write them but no problem happens when the
monitoring process is located within the same architecture that drives
the signal rather than in a separate entity.
 
G

Guest

valtih1978 said:
entity SPY is
port (A : inout Std_Logic);
end SPY;

architecture ARCH of SPY is
begin

process begin
report time'image(now) & ": a = " & std_logic'image(a);
wait on a'transaction;
end process;

end architecture;


architecture TB is
signal A: std_logic;
begin
SPY_I: entity SPY(a)
process begin
wait for 1 fs;
a <= 'Z'; wait for 1 ps;
a <= '1'; wait for 5 ns;
a <= '0'; wait for 20 ns;
end process

I do not drive the signal from the Spy, so output must be (U, Z, 1, 0).
Right? Yet, simulator tells 'a = U' all four times!

Signal A in the Testbench TB has multiple sources[1]: spy's inout port
and the driver from the process in the testbench. The inout source from
spy is initialized with 'U' by default. That 'U' overdrives the other
assignments like usual.

If you initialize the inout port using 'Z', spy will report the values
assigned by the testbench process.

....
port (A: inout std_logic := 'Z');
....

[1]: LRM(93) 4.3.1.2 line 183

Enrik
 

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

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top