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

From: Michael (Mac) McNamara <mcnamara_at_.....>
Date: Fri Jun 22 2007 - 13:46:46 PDT
 My responses are tagged as mac [#] > below.

-----Original Message-----
From: Steven Sharp [mailto:sharp] 
Sent: Friday, June 22, 2007 12:47 PM
To: Arturo.Salz@synopsys.com; shalom.bresticker@intel.com;
jonathan.bromley@doulos.com; sv-bc@eda-stds.org; sv-ec@eda-stds.org; Michael
(Mac) McNamara
Subject: RE: [sv-bc] RE: [sv-ec] Formatting strings using %b ???

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

mac [1] > Agreed.  In this case it is ideal to detect & diagnose at compile
time when possible.  If not possible, then next best is to issue a warning
at simulation time, and continue simulation.  Worst (in my opinion) is when
some corner case occurs at, like, cycle 1,000,000 of simulation, which
triggers a diagnostic $display, which has bogus arguments to a format
character, and as a result the tool core dumps, or issues an error message
and stops simulation.  I would much rather get a warning & get the rest of
my simulation!!!


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

mac [2] > Now that you remind me, I believe VCS did that as well.


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

mac [3] > see mac [1] above - I am OK with the $rtoi answer as well.  I am
also OK with detect & diagnose at compile time.  I argue against ignoring at
compile time and hence becomes an error which causes simulation to exit at
run time.


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

mac [4] > again, see mac[1] above.

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 13:47:19 2007

This archive was generated by hypermail 2.1.8 : Fri Jun 22 2007 - 13:47:37 PDT