In the Simulation Run Time, the Object Data are passed around within SansGUI, within the simulator, and in-between SansGUI and the simulator. SansGUI uses Object Data Types to store model data.
All SansGUI object data are stored as arrays. Even when there is only an atomic value, it is in an array of one element with the offset 0. Please pay special attention to whether your programming environment supports 0-based (C) or 1-based (Fortran) array indices.
SG_TYPE_NULL: This data type is used when the data is not entered or cannot be inferred from the attribute definition.
SG_TYPE_INT: An array of integer numbers. Each integer is represented by an int in C or an INTEGER in Fortran.
SG_TYPE_FLT: An array of single precision floating point numbers. Each single precision floating point number is represented by a float in C or a REAL*4 in Fortran.
SG_TYPE_DBL: An array of double precision floating point numbers. Each double precision floating point number is represented by a double in C or a REAL*8 in Fortran.
SG_TYPE_CHAR: An array of characters, terminated with a NULL character (ASCII code 0). Normally, the size of the character array is set when the user types in a character string. It can, however, be changed programmatically during the resize operations before loading or initializing data.
SG_TYPE_STR: An array of character strings. The sizes of the strings are determined as soon as the user enters the data. Unlike SG_TYPE_CHAR, they cannot be modified during simulation run-time.
SG_TYPE_REF: An array of object references. The storage of this type is the same as that of SG_TYPE_STR.
SG_TYPE_URL: An array of URL/File path with the enclosing brackets removed. The storage of this type is the same as that of SG_TYPE_STR.
SG_TYPE_DATE: An array of date values. Each data value is represented by five (5) consecutive integers representing day, month, year, day of week, and day of year.
Offset |
Field |
Value |
0 |
day |
1 - 31, depending on the month |
1 |
month |
1 - 12, from January to December |
2 |
year |
100 - 9999 representing the year |
3 |
day of week |
0 - 6 for Sunday through Saturday |
4 |
day of year |
1 - 365, or 366 if leap year |
SG_TYPE_TIME: An array of time values. Each data value is represented by four (3) consecutive integers representing hour, minute, and second in 24 hour format.
Offset |
Field |
Value |
0 |
Hour |
0 - 23, in 24 hour format |
1 |
Minute |
0 - 59 |
2 |
Second |
0 - 59 |
SG_TYPE_QUAL: An array of quality values. Each quality is represented by a 32-bit integer with the high 16 bits for the rank and low 16 bits for the confidence factor in thousandth. Suppose the quality integer is Q, the rank is R and the confidence factor is C:
R = Q / 65536
C = (Q % 65536) / 1000.0 where % is the modulo operation.
SG_TYPE_LINK: A array of link information served as the header (the 1st attribute) of each link in a model. This type of data is assigned by SansGUI and is not converted from a GUI control data type. There is always one link information element in the array. The link information element is represented by four integers which are assigned with values according to the two parts at both ends of the link. When a part is evaluated during a simulation run, we call the SansGUI Data Object associated with it self. The other parts being connected via direct links are called adjacent parts. The link information of SG_TYPE_LINK is always located in the first field of all link data objects. The four integers in the link information field are:
Offset |
Field |
Description |
0 |
Direction |
The direction of the link, from the self part point of view |
1 |
Local Port |
The port number used for the link in the self part |
2 |
Remote Port |
The port number used for the link in the adjacent part |
3 |
Adjacent Part |
The index of the linked adjacent part in the entire adjacent parts array |
The SansGUI predefined macros for the first integer Direction field are:
Macro |
Description |
SG_LINK_ERR |
The values in the link information array are invalid |
SG_LINK_NO |
No direction is indicated |
SG_LINK_IN |
The link goes into the self part, an input connection |
SG_LINK_OUT |
The link goes out of the self part, an output connection |
Because the self part can be from either of the two end parts at different times during a simulation run, the link information in a link may be changed accordingly. These values are assigned by SansGUI automatically and shall be treated as constants by all the simulator and user overriding functions.
SansGUI Modeling and Simulation Environment Version 1.2
Copyright © 2000-2003 ProtoDesign, Inc. All rights reserved.