RE: [sv-bc] RE: [sv-ec] Formatting strings using %b ???

From: Steven Sharp <sharp_at_.....>
Date: Fri Jun 22 2007 - 12:46:54 PDT
>From: "Michael (Mac) McNamara" <mcnamara@cadence.com>

>I would submit that the most user friendly is to convert the offending item
>into something that can be displayed.

Unless it is so far from something that can be displayed that it is
probably a user error.  Accepting nonsense means that the user has to
wait until they have finished simulating to find out that they made a
typo in a format, and now have to start over.


>So a %v of a non-scalar takes the least significant bit, and displays that;

Since we display strength format for every bit in the vector, that would
be a step backward for us.


>if it is a two state variable, displays St1 or St0;

Sure.  If you allow integral expressions other than nets, then it makes
sense to treat them all the same way.


>  a %v of a real converts
>the real to a 1 if it is non zero, and 0 if it is zero.

Here I think you have gone too far.  You seem to be basing this on
having to convert everything to a scalar and trying to find a way to
do that with a real.  Since we accept vectors, I see no reason for
converting to a scalar.  It makes equal sense to use $realtobits or
$rtoi on the real and print that value as a vector.  Since there is
no single obvious answer, and none of the choices make much sense, I
think this should remain illegal.


>Similarly a %g, %e or %f of a non real displays the closest real value; so
>%g of 123 yields 123.0

Yes, we have had to allow this illegality also, since other tools were
allowing it.  Here it is obvious what the reasonable behavior is.


>This is what we did with VCS way back when; I am not sure if that is still
>the case, or if with new data types and format characters this concept is
>still practical to extend to every format from every type of argument.

I don't think it makes sense to extend every format to every type.  If
it isn't clear what the user wants, it is better to stop them and get
them to specify it clearly.  It saves them time compared to guessing
wrong.

Steven Sharp
sharp@cadence.com


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri Jun 22 12:47:15 2007

This archive was generated by hypermail 2.1.8 : Fri Jun 22 2007 - 12:47:35 PDT