Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Conditional Check on Vectors

Reply
Thread Tools

Conditional Check on Vectors

 
 
Analog Guy
Guest
Posts: n/a
 
      10-06-2004
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.


 
Reply With Quote
 
 
 
 
Brian Drummond
Guest
Posts: n/a
 
      10-06-2004
On Tue, 5 Oct 2004 22:32:46 -0400, "Analog Guy" <(E-Mail Removed)>
wrote:

>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.


An alternative approach would be to weakly drive the I/O bus from your
testbench (i.e. with 'H' then 'L' instead of '1' then '0') and see what
you get. Tri-stated elements will be resolved to the weak drive signal,
others will not.

This approach would also work in hardware, while testing for 'Z'
obviously will not!

- Brian
 
Reply With Quote
 
 
 
 
Analog Guy
Guest
Posts: n/a
 
      10-06-2004
"Analog Guy" <(E-Mail Removed)> wrote in message news:<eLI8d.11180$(E-Mail Removed) >...
> 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).
 
Reply With Quote
 
Paul Uiterlinden
Guest
Posts: n/a
 
      10-07-2004
Analog Guy wrote:

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

>
> 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).


You might see this warning, but it is not caused by the IF statement, as
it does not contain any arithmetic operand.

To get the line number in the warning message, put the following in your
modelsim.ini file (one line):

AssertionFormatWarning = "** %S: %R\n Time: %T Iteration: %D%I File:
%F Line: %L\n\n"

It's probably already there, commented out.

As for your original question: the test should work, but you must be
sure that there are no other drivers overriding the Z value of any bit.

Paul.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
c++ primer statement about vectors containing vectors pauldepstein@att.net C++ 3 03-26-2008 06:22 PM
Check difference between two vectors shapper ASP .Net 1 02-15-2008 04:38 PM
Ruby, SWIG and C++: how to properly wrap vector of vectors of doubles (2D vectors)? Ruby 0 09-14-2005 05:47 PM
? ELSE Conditional Comment / Using Conditional Comments Inside Other Tags To Comment Out Attributes Alec S. HTML 10 04-16-2005 02:21 AM
Comparison of Bit Vectors in a Conditional Signal Assignment Statement Anand P Paralkar VHDL 2 08-04-2003 08:40 PM



Advertisments