[ibis-macro] Re: Definition of integer?

  • From: "Mike LaBonte (milabont)" <milabont@xxxxxxxxx>
  • To: <wkatz@xxxxxxxxxx>, <Arpad_Muranyi@xxxxxxxxxx>, "IBIS-ATM" <ibis-macro@xxxxxxxxxxxxx>
  • Date: Wed, 10 Feb 2010 15:31:24 -0600

Clearly, exponential notation was not going to be assignable to integer
types in most parsers, out of the box. My assumption was that they would
appear only in .ami files and would be translated to non-exponential
format, or directly into binary integers, on read. Our own parser needs
to handle them, and also to verify that the values fall within some
practical integer range, say -2^63 to 2^63.

No tool outside of .ami parsers should ever see exponential format for
integers, but I don't think we need to use Float unless someone thinks
we have a need for really big integers.

Mike

-----Original Message-----
From: ibis-macro-bounce@xxxxxxxxxxxxx
[mailto:ibis-macro-bounce@xxxxxxxxxxxxx] On Behalf Of Walter Katz
Sent: Wednesday, February 10, 2010 4:08 PM
To: Arpad_Muranyi@xxxxxxxxxx; IBIS-ATM
Subject: [ibis-macro] Re: Definition of integer?

Arpad,

You have confirmed what I have seen in different compilers, and
different simulators, and different platforms. That is why I want to
allow Type Float for this. Since this is an Info parameter, there is no
issue on how it gets passed to the DLL. Since it is specified by the
model maker there is no issue on how it gets interpreted by the EDA
tool. Please node that the value
4 is a legal Float number with value 4. If the DLL writer says 1.e5,
then it really doesn't matter if the EDA tool ignores the first 100000,
100001, or
99999 bits. And if the model maker thinks there is an important
difference between 100000, 100001, or 99999, then he should say Integer
and set its value to 100000

So simply allowing Float makes everything very easy, gives the IC Vendor
all the flexibility he needs.

I am big on the EASY buttons these days.

Walter

Walter Katz
303.449-2308
Mobile 720.333-1107
wkatz@xxxxxxxxxx
www.sisoft.com

-----Original Message-----
From: ibis-macro-bounce@xxxxxxxxxxxxx
[mailto:ibis-macro-bounce@xxxxxxxxxxxxx]On Behalf Of Muranyi, Arpad
Sent: Tuesday, February 09, 2010 11:03 PM
To: IBIS-ATM
Subject: [ibis-macro] Definition of integer?

Hello everyone,

After our ATM teleconference I got curious about the definition of the
integer type in VHDL-AMS and ran a few tests to find out what it will
do.  I declared the following integer signals with initial values
assigned to them to see which of these will generate an
error:

  signal Test_1 : integer := 150;
  signal Test_2 : integer := 15e+1;
  signal Test_3 : integer := 1.5e+2;
  signal Test_4 : integer := 0.15e+3;
  signal Test_5 : integer := 150e-1;
  signal Test_6 : integer := 150e-2;
  signal Test_7 : integer := 150e-3;

Based on math, except for the last two lines, the above should all
resolve to an integer, and be accepted without error.  However, I got
the following error messages:

  signal Test_3 : integer := 1.5e+2;
  [Error] Type check error: expression is not of type
STD.STANDARD.INTEGER

  signal Test_4 : integer := 0.15e+3;
  [Error] Type check error: expression is not of type
STD.STANDARD.INTEGER

  signal Test_5 : integer := 150e-1;
  [Error] An integer expression cannot be raised to a negative power

  signal Test_6 : integer := 150e-2;
  [Error] An integer expression cannot be raised to a negative power

  signal Test_7 : integer := 150e-3;
  [Error] An integer expression cannot be raised to a negative power


Then I redid the same experiment in C++ with these lines:

  int Test_1 = 150;
  int Test_2 = 15e+1;
  int Test_3 = 1.5e+2;
  int Test_4 = 0.15e+3;
  int Test_5 = 150e-1;
  int Test_6 = 150e-2;
  int Test_7 = 150e-3;

Visual studio gave me these warnings on all but the first line:

IntTest.cpp(1033) : warning C4244: 'initializing' : conversion from
'double' to 'int', possible loss of data

It seems that this may be related to how the number is stored or
manipulated in the CPU more than what it evaluates to according to math,
but I am not sure what the determining factors or rules are, especially
since the compilers of these two languages gave me different answers...

What shall be our definition for integer float in IBIS-AMI?  Part of me
says that we should try what C would do, since our AMI interface is
based on C, but then we also say that any language can be used for
writing AMI models as long as the DLL interface matches what we defined
in the specification.  What if different languages have different
definitions for integer/float?

Thanks,

Arpad
=====================================================================
---------------------------------------------------------------------
IBIS Macro website  :  http://www.eda.org/pub/ibis/macromodel_wip/
IBIS Macro reflector:  //www.freelists.org/list/ibis-macro
To unsubscribe send an email:
  To: ibis-macro-request@xxxxxxxxxxxxx
  Subject: unsubscribe

---------------------------------------------------------------------
IBIS Macro website  :  http://www.eda.org/pub/ibis/macromodel_wip/
IBIS Macro reflector:  //www.freelists.org/list/ibis-macro
To unsubscribe send an email:
  To: ibis-macro-request@xxxxxxxxxxxxx
  Subject: unsubscribe

---------------------------------------------------------------------
IBIS Macro website  :  http://www.eda.org/pub/ibis/macromodel_wip/
IBIS Macro reflector:  //www.freelists.org/list/ibis-macro
To unsubscribe send an email:
  To: ibis-macro-request@xxxxxxxxxxxxx
  Subject: unsubscribe

Other related posts: