Conditional Check on Vectors

A

Analog Guy

Guest
As part of my testbench, I want to verify that unused I/O are tri-stated (as
per design). Some of the
unused I/O are vectors, specified as STD_LOGIC_VECTOR with various sizes.

I want to do a PROCEDURE call, to evaluate the given output vectors, which
may be of varying
sizes.

I tried the following with no success: IF (test = (OTHERS => 'Z')) THEN,
where test is STD_LOGIC_VECTOR.

Per my search of the newsgroup, I tried: IF (test = (test'RANGE => 'Z'))
THEN

Although this compiled without any errors, it doesn't actually work in my
testbench simulation.
If test is specified as STD_LOGIC_VECTOR(2 DOWNTO 0), I observe the
following results:

Vector PASS/FAIL
------ --------------
"ZZZ" PASS
"111" FAIL
"Z11" PASS ????????
"1Z1" PASS ?????????
etc.

How are these vectors passing this conditional statement? Can I not check
the whole vector at once, or do I have
to check element by element?

I'd appreciate any insight.
 
"Analog Guy" <analog_guy@hotmail.com> wrote in message news:<eLI8d.11180$HO1.696103@news20.bellglobal.com>...
As part of my testbench, I want to verify that unused I/O are tri-stated (as
per design). Some of the
unused I/O are vectors, specified as STD_LOGIC_VECTOR with various sizes.

I want to do a PROCEDURE call, to evaluate the given output vectors, which
may be of varying
sizes.

I tried the following with no success: IF (test = (OTHERS => 'Z')) THEN,
where test is STD_LOGIC_VECTOR.

Per my search of the newsgroup, I tried: IF (test = (test'RANGE => 'Z'))
THEN

Although this compiled without any errors, it doesn't actually work in my
testbench simulation.
If test is specified as STD_LOGIC_VECTOR(2 DOWNTO 0), I observe the
following results:

Vector PASS/FAIL
------ --------------
"ZZZ" PASS
"111" FAIL
"Z11" PASS ????????
"1Z1" PASS ?????????
etc.

How are these vectors passing this conditional statement? Can I not check
the whole vector at once, or do I have
to check element by element?

I'd appreciate any insight.

The actual warning message from ModelSim is:

# ** Warning: There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic
operand, the result will be 'X'(es).
 

Welcome to EDABoard.com

Sponsor

Back
Top