/[ascend]/trunk/base/generic/compiler/instance_types.h
ViewVC logotype

Annotation of /trunk/base/generic/compiler/instance_types.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 33 - (hide annotations) (download) (as text)
Sun Dec 26 20:06:01 2004 UTC (20 years, 11 months ago) by ben.allan
File MIME type: text/x-chdr
File size: 26707 byte(s)
First pass at doxygenation -- mechanically putting in ** and where
most likely needed **< using sed. Lots of cleanup needed to
be really useful, including grouping data types and their
member methods into class-like documentation.
1 ben.allan 33 /**<
2 aw0a 1 * Real Ascend Instance Types
3     * by Tom Epperly
4     * Version: $Revision: 1.29 $
5     * Version control file: $RCSfile: instance_types.h,v $
6     * Date last modified: $Date: 1998/02/05 16:36:22 $
7     * Last modified by: $Author: ballan $
8     *
9     * This file is part of the Ascend Language Interpreter.
10     *
11     * Copyright (C) 1990, 1993, 1994 Thomas Guthrie Epperly
12     * Copyright (C) 1996 Benjamin Andrew Allan
13     *
14     * The Ascend Language Interpreter is free software; you can redistribute
15     * it and/or modify it under the terms of the GNU General Public License as
16     * published by the Free Software Foundation; either version 2 of the
17     * License, or (at your option) any later version.
18     *
19     * The Ascend Language Interpreter is distributed in hope that it will be
20     * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
21     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22     * General Public License for more details.
23     *
24     * You should have received a copy of the GNU General Public License
25     * along with the program; if not, write to the Free Software Foundation,
26     * Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check the file named
27     * COPYING.
28     *
29     * Fields not to be accessed by any client program
30     * except by the read-only functions in headers.
31     * The write functions in atomvalue.h are also reasonable for
32     * clients to use.
33     * Clients should never have to include much beyond instance_enum.h.
34     */
35    
36     #ifndef __INSTANCE_TYPES_H_SEEN__
37     #define __INSTANCE_TYPES_H_SEEN__
38    
39    
40 ben.allan 33 /**<
41 aw0a 1 * All of the following structures should be a multiple of *8*;
42     * being a multiple of 4 is not sufficient. Pad if necessary.
43     * RealInstance
44     * IntegerInstance
45     * BooleanInstance
46     * SymbolInstance
47     * SetInstance
48     * and in fact any new instances that will be atom children.
49     * Remember that these get *packed* in together and the order of
50     * packing is not predictable in any way. If each is a multiple
51     * of 8, then everybody will be properly aligned.
52     * *AtomInstance and *Rel*Instance also need to be 8 byte
53     * aligned so that we
54     * start children in an 8 byte.
55     *
56     * This has to hold for both 4 and 8 byte ptr/long machines.
57     */
58    
59     #if SIZEOF_VOID_P == 8
60     #define LONGCHILDREN 1
61     #else
62     #define LONGCHILDREN 0
63     #endif
64 ben.allan 33 /**< if LONGCHILDREN, then pointers are 8 bytes */
65 aw0a 1
66 ben.allan 33 /**< at present, I don't believe the following define is needed */
67     /**< # if defined(_HPUX_SOURCE) || defined(_SGI_SOURCE) */
68     /**< # define ALIGNSTUPID 1 */
69     /**< # endif */
70     /**< if ALIGNSTUPID, then 4 byte ptrs must fall on 8 byte boundaries */
71     /**< any architecture with such a restrict should be summarily torched */
72 aw0a 1
73    
74 ben.allan 33 /**< FUNDAMENTAL INSTANCES */
75 aw0a 1
76 ben.allan 33 /**< this aligns to 8 bytes with 4 or 8 byte pointers. size 32/40 */
77 aw0a 1 struct RealInstance {
78 ben.allan 33 enum inst_t t; /**< must always be first */
79     unsigned assigned; /**< the number of times it has been assigned */
80 aw0a 1 struct Instance *parent_offset;
81     CONST dim_type *dimen;
82     double value;
83 ben.allan 33 unsigned depth; /**< the depth of the assignment */
84     int padding; /**< required for either type of pointer */
85 aw0a 1 };
86    
87 ben.allan 33 /**< this aligns to 8 bytes with 4 or 8 byte pointers. size 24/32 */
88 aw0a 1 struct IntegerInstance {
89 ben.allan 33 enum inst_t t; /**< must always be first */
90     unsigned assigned; /**< the number of times it has been assigned */
91 aw0a 1 struct Instance *parent_offset;
92     long value;
93 ben.allan 33 unsigned depth; /**< the depth of the last assignment */
94     int padding; /**< required for either type of pointer */
95 aw0a 1 };
96    
97 ben.allan 33 /**< size 24/24 */
98 aw0a 1 struct BooleanInstance {
99     enum inst_t t;
100 ben.allan 33 unsigned assigned; /**< the number of times it has been assigned */
101 aw0a 1 struct Instance *parent_offset;
102 ben.allan 33 unsigned value; /**< 0 false, 1 true */
103     unsigned depth; /**< the depth of the last assignment */
104 aw0a 1 #if (LONGCHILDREN == 0)
105     int padding;
106     #endif
107     };
108    
109 ben.allan 33 /**< this aligns to 8 bytes with 4 or 8 byte pointers. size 16/24 */
110 aw0a 1 struct SetInstance {
111     enum inst_t t;
112 ben.allan 33 unsigned int_set; /**< 0 indicates string set, 1 indicates an */
113     /**< integer set */
114 aw0a 1 struct Instance *parent_offset;
115 ben.allan 33 struct set_t *list; /**< list of enumerated values, NULL */
116     /**< indicates that it has not been assigned */
117     /**<
118 aw0a 1 * if HP_sUX 9/10 or SGI is stupid enough to misalign this structure,
119     * we will have to pad it with an int on both sides of *list
120     */
121     };
122    
123 ben.allan 33 /**< this aligns to 8 bytes with 4 or 8 byte pointers. size 16/24 */
124 aw0a 1 struct SymbolInstance {
125     enum inst_t t;
126 ben.allan 33 unsigned assigned; /**< the number of times it has been assigned */
127 aw0a 1 struct Instance *parent_offset;
128 ben.allan 33 symchar *value; /**< NULL indicates unassigned */
129 aw0a 1 };
130    
131    
132 ben.allan 33 /**< TRUE ATOM INSTANCES */
133     /**< the first one is a dummy of some importance. All the atomic
134 aw0a 1 * variable types should be conformable to this structure. It
135     * is not by itself a structure that should ever exist.
136     */
137     struct CommonAtomInstance {
138     enum inst_t t;
139     VOIDPTR interface_ptr;
140 ben.allan 33 struct gl_list_t *parents; /**< link to parents */
141     struct Instance *alike_ptr; /**< circular linked list of clique members */
142     struct TypeDescription *desc; /**< list of children pointers */
143     unsigned long visited; /**< visited counter */
144     unsigned long tmp_num; /**< used when an instance tree is being copied*/
145     unsigned int anon_flags; /**< anonymous field to be manipulated */
146 aw0a 1 };
147    
148 ben.allan 33 /**<
149 aw0a 1 * The RealAtomInstance should be reimplemented with a number of
150     * supported attributes (bounds, nominal, several boolean flags)
151     * and then an explicit pointer to the child space since children
152     * are expected to be rare. Making this pointer explicit will allow
153     * the real atoms (of which there are a lot) to be pooled and save
154     * a fair amount of memory on large problems.
155     */
156 ben.allan 33 /**< aligns to 8 byte boundaries on 4 or 8 byte machines. size 56/96 */
157 aw0a 1 struct RealAtomInstance {
158     enum inst_t t;
159     VOIDPTR interface_ptr;
160 ben.allan 33 struct gl_list_t *parents; /**< link to parents */
161     struct Instance *alike_ptr; /**< circular linked list of clique members */
162     struct TypeDescription *desc; /**< list of children pointers */
163     unsigned long visited; /**< visited counter */
164     unsigned long tmp_num; /**< used when an instance tree is being copied*/
165     unsigned int anon_flags; /**< anonymous field to be manipulated */
166     /**< above should match with CommonAtomInstance */
167     /**< atom value part */
168     double value; /**< value of real variable */
169     CONST dim_type *dimen; /**< dimensions */
170     struct gl_list_t *relations; /**< relations where this real appears */
171     unsigned int assigned; /**< the number of times it has been assigned */
172     unsigned int depth; /**< the depth of the last assignment */
173     /**<
174 aw0a 1 * An even number of child pointers are packed here, the last of which
175     * may not be valid because the number of children may be odd.
176     * This extra should be eliminated for LONG pointer machines.
177     */
178 ben.allan 33 /**< After the child pointers comes the data space for the actual
179 aw0a 1 * children.
180     */
181     };
182    
183 ben.allan 33 /**< future work. needs parser and interpretter support. Not yet used. */
184 aw0a 1 struct SolverAtomInstance {
185     enum inst_t t;
186     VOIDPTR interface_ptr;
187 ben.allan 33 struct gl_list_t *parents; /**< link to parents */
188     struct Instance *alike_ptr; /**< circular linked list of clique members */
189     struct TypeDescription *desc; /**< list of slow children pointers, by name */
190     unsigned long visited; /**< visited counter */
191     unsigned long tmp_num; /**< used when an instance tree is being copied*/
192     /**< above should match with CommonAtomInstance */
193     /**< atom value part */
194     struct gl_list_t *relations; /**< relations where this real appears */
195     double value; /**< value of variable */
196     /**< fast children, all sharing dimens */
197     double nominal; /**< value of variable scaling */
198     double lower; /**< value of variable lower bound */
199     double upper; /**< value of variable upper bound */
200     CONST dim_type *dimen; /**< dimensions */
201     struct Instance **carray; /**< array of pointers to slow children.
202 aw0a 1 Keep slow children in pools by type.
203     This should be NULL most of the time. */
204 ben.allan 33 unsigned int flags; /**< boolean flags of the variable, both
205 aw0a 1 internal and external. must be at least
206     32 bit int */
207 ben.allan 33 unsigned int depth; /**< the depth of the last assignment */
208     /**<
209 aw0a 1 * An even number of child pointers are packed here, the last of which
210     * may not be real because the number of children may be odd.
211     * This extra should be eliminated for LONG pointer machines.
212     */
213 ben.allan 33 /**< After the child pointers comes the data space for the actual
214 aw0a 1 * children.
215     */
216     };
217 ben.allan 33 /**<
218 aw0a 1 * Bit field definition for boolean attributes. room to grow.
219     * Define all these fields so that a default value of (0,OFF,FALSE)
220     * is the appropriate setting for 'typical' uses of ASCEND.
221     */
222 ben.allan 33 /**< internal flags (compiler use) for solveratominstances: */
223     #define SOL_ASSIGNED 0x1 /**< atom value ever assigned */
224     /**< external flags (user interface/solver use) for solveratominstances: */
225     #define SOL_FIXED 0x2 /**< variable fixed for solvers */
226     #define SOL_INACTIVELB 0x4 /**< lower bound to be ignored in solving */
227     #define SOL_INACTIVEUB 0x8 /**< upper bound to be ignored in solving */
228     #define SOL_ODESTATE 0x10 /**< variable state for ivp solver */
229     #define SOL_ODEOBSERVE 0x20 /**< variable recording for ivp */
230     #define SOL_ISZERO 0x40 /**< semicontinuous set 0 for sciconic */
231     #define SOL_INTEGER 0x80 /**< integer variable */
232     #define SOL_RELAXEDINT 0x100 /**< integer variable treat as relaxed */
233     #define SOL_INTERVAL 0x200 /**< interval real variable */
234     #define SOL_COMPLEX 0x400 /**< complex variable. lower -> imaginary part
235 aw0a 1 upper -> magnitude bound. ASCEND -> pot */
236 ben.allan 33 #define SOL_DOMAIN 0x800 /**< continuous variable defines domain */
237     #define SOL_ODEINDEP 0x1000 /**< independent variable in ODE/BVP */
238     #define SOL_NODOF 0x2000 /**< user doesn't want to see var in DOF */
239     #define SOL_PARAMETRIC 0x4000 /**< whatever that means to a solver */
240     #define SOL_INTENSIVE 0x8000 /**< physics/che intensive property variable */
241     #define SOL_NONBASIC 0x10000 /**< in DOF of optimization problem */
242     /**< 2,4,8-0000 reserved for future */
243     /**< external flags (solver/interface tool use) for solveratominstances: */
244     #define SOL_TIGHTLB 0x100000 /**< value at or near lower */
245     #define SOL_TIGHTUB 0x200000 /**< value at or near upper */
246     #define SOL_NOELIG 0x400000 /**< variable not eligible to be fixed in DOF */
247     /**< note that the above bit positions need to be settled on still. */
248 aw0a 1
249 ben.allan 33 /**< aligns to 8 on 4 and 8 byte compilers with compiler pad after t, depth */
250 aw0a 1 struct IntegerAtomInstance {
251     enum inst_t t;
252     VOIDPTR interface_ptr;
253 ben.allan 33 struct gl_list_t *parents; /**< link to parents */
254 aw0a 1 struct Instance *alike_ptr;
255 ben.allan 33 struct TypeDescription *desc; /**< usefull type description information */
256 aw0a 1 unsigned long visited;
257 ben.allan 33 unsigned long tmp_num; /**< used when an instance tree is being copied*/
258     unsigned int anon_flags; /**< anonymous field to be manipulated */
259     /**< above should match with CommonAtomInstance */
260     /**< atom value part */
261     unsigned int assigned; /**< the number of times it has been assigned */
262     struct gl_list_t *whens; /**< link to whens on which it appears */
263     unsigned int depth; /**< the depth of the last assignment */
264     long value; /**< integer value */
265     /**<
266 aw0a 1 * An even number of child pointers are packed here, the last of which
267     * may not be real because the number of children may be odd.
268     * This extra should be eliminated for LONG pointer machines.
269     */
270 ben.allan 33 /**< After the child pointers comes the data space for the actual
271 aw0a 1 * children.
272     */
273     };
274    
275 ben.allan 33 /**< this structure aligns (with compiler generated pad after t and flags
276 aw0a 1 * on 4 or 8 byte ptr machines.
277     */
278     struct BooleanAtomInstance {
279     enum inst_t t;
280     VOIDPTR interface_ptr;
281 ben.allan 33 struct gl_list_t *parents; /**< link to parent instances */
282 aw0a 1 struct Instance *alike_ptr;
283 ben.allan 33 struct TypeDescription *desc; /**< description of name,children, and size */
284 aw0a 1 unsigned long visited;
285 ben.allan 33 unsigned long tmp_num; /**< used when an instance tree is being copied*/
286     unsigned int anon_flags; /**< anonymous field to be manipulated */
287     /**< above should match with CommonAtomInstance */
288     /**< atom value part */
289     struct gl_list_t *logrelations; /**< logrelations where this boolean appears */
290     struct gl_list_t *whens; /**< whens where this boolean appears*/
291     unsigned assigned; /**< the number of times it has been assigned */
292     unsigned depth; /**< the depth of the assignment */
293     unsigned value; /**< 0 false, 1 true */
294     int padding; /**< so that children have a square address */
295     /**<
296 aw0a 1 * An even number of child pointers are packed here, the last of which
297     * may not be real because the number of children may be odd.
298     * This extra should be eliminated for LONG pointer machines.
299     */
300 ben.allan 33 /**< After the child pointers comes the data space for the actual
301 aw0a 1 * children.
302     */
303     };
304    
305 ben.allan 33 /**< this aligns to 8 on 4 or 8 byte compilers with compiler pad after t */
306 aw0a 1 struct SetAtomInstance {
307 ben.allan 33 enum inst_t t; /**< type */
308 aw0a 1 VOIDPTR interface_ptr;
309 ben.allan 33 struct gl_list_t *parents; /**< link to parents instances */
310 aw0a 1 struct Instance *alike_ptr;
311 ben.allan 33 struct TypeDescription *desc; /**< description of name,children, and size */
312 aw0a 1 unsigned long visited;
313 ben.allan 33 unsigned long tmp_num; /**< used when an instance tree is being copied*/
314     unsigned int anon_flags; /**< anonymous field to be manipulated */
315     /**< above should match with CommonAtomInstance */
316     /**< atom value part */
317     unsigned int_set; /**< 0 indicates string set, 1 indicates */
318     struct set_t *list; /**< list of enumerated values NULL indicates */
319     /**< that is has not been assigned */
320     /**< integer set */
321     /**<
322 aw0a 1 * An even number of child pointers are packed here, the last of which
323     * may not be real because the number of children may be odd.
324     * This extra should be eliminated for LONG pointer machines.
325     */
326 ben.allan 33 /**< After the child pointers comes the data space for the actual
327 aw0a 1 * children.
328     */
329     };
330    
331 ben.allan 33 /**< this aligns to 8 on 4 or 8 byte compilers with compiler pad after t, flags*/
332 aw0a 1 struct SymbolAtomInstance {
333 ben.allan 33 enum inst_t t; /**< type */
334 aw0a 1 VOIDPTR interface_ptr;
335 ben.allan 33 struct gl_list_t *parents; /**< link to parent instances */
336     struct Instance *alike_ptr; /**< ALIKE clique link */
337     struct TypeDescription *desc; /**< description of name, children, and size */
338 aw0a 1 unsigned long visited;
339 ben.allan 33 unsigned long tmp_num; /**< used when an instance is being copied */
340     unsigned int anon_flags; /**< anonymous field to be manipulated */
341     /**< above should match with CommonAtomInstance */
342     struct gl_list_t *whens; /**< link to whens on which it appears */
343     /**< atom value part */
344     symchar *value; /**< NULL indicates unassigned */
345     /**<
346 aw0a 1 * An even number of child pointers are packed here, the last of which
347     * may not be real because the number of children may be odd.
348     * This extra should be eliminated for LONG pointer machines.
349     */
350 ben.allan 33 /**< After the child pointers comes the data space for the actual
351 aw0a 1 * children.
352     */
353     };
354    
355 ben.allan 33 /**< CONSTANT INSTANCES */
356     /**< The first one is a dummy of some importance. All the Constant
357 aw0a 1 * types should be conformable to this structure. It
358     * is not by itself a structure that should ever exist.
359     */
360     struct CommonConstantInstance {
361     enum inst_t t;
362     unsigned int vflag;
363 ben.allan 33 unsigned long visited; /**< visited counter */
364     unsigned long tmp_num; /**< used when an instance tree is being copied*/
365 aw0a 1 VOIDPTR interface_ptr;
366 ben.allan 33 unsigned int anon_flags; /**< anonymous field to be manipulated */
367     /**< vflag is 32 bits with particular meanings: */
368     #define ci_ASSIGNED 0x1 /**< instance assigned yet? */
369     #define ci_BVAL 0x2 /**< boolean const instance value, reserved */
370     /**< other binary flags constants need to be added here. */
371 aw0a 1 };
372    
373 ben.allan 33 /**< RealConstantInstance should probably be pooled, but isn't yet */
374 aw0a 1 struct RealConstantInstance {
375     enum inst_t t;
376 ben.allan 33 unsigned vflag; /**< assigned? */
377     unsigned long visited; /**< visited counter */
378     unsigned long tmp_num; /**< used when an instance tree is being copied*/
379 aw0a 1 VOIDPTR interface_ptr;
380 ben.allan 33 unsigned int anon_flags; /**< anonymous field to be manipulated */
381     /**< above should match with CommonConstantInstance */
382 aw0a 1 double value;
383 ben.allan 33 struct gl_list_t *parents; /**< link to parents */
384     struct Instance *alike_ptr; /**< circular linked list of clique members?*/
385     struct TypeDescription *desc; /**< description of name, size */
386 aw0a 1 CONST dim_type *dimen;
387     };
388    
389     struct IntegerConstantInstance {
390     enum inst_t t;
391 ben.allan 33 unsigned vflag; /**< assigned? */
392     unsigned long visited; /**< visited counter */
393     unsigned long tmp_num; /**< used when an instance tree is being copied*/
394 aw0a 1 VOIDPTR interface_ptr;
395 ben.allan 33 unsigned int anon_flags; /**< anonymous field to be manipulated */
396     /**< above should match with CommonConstantInstance */
397 aw0a 1 long value;
398 ben.allan 33 struct gl_list_t *parents; /**< link to parents */
399     struct gl_list_t *whens; /**< whens where this integer appears*/
400     struct Instance *alike_ptr; /**< circular linked list of clique members?*/
401     struct TypeDescription *desc; /**< description of name, size */
402 aw0a 1 };
403    
404     struct BooleanConstantInstance {
405     enum inst_t t;
406 ben.allan 33 unsigned vflag; /**< assigned? */
407     unsigned long visited; /**< visited counter */
408     unsigned long tmp_num; /**< used when an instance tree is being copied*/
409 aw0a 1 VOIDPTR interface_ptr;
410 ben.allan 33 /**< above should match with CommonConstantInstance */
411     unsigned int anon_flags; /**< anonymous field to be manipulated */
412     struct gl_list_t *parents; /**< link to parents */
413     struct gl_list_t *whens; /**< whens where this boolean appears*/
414     struct Instance *alike_ptr; /**< circular linked list of clique members?*/
415     struct TypeDescription *desc; /**< description of name, size */
416 aw0a 1 };
417    
418     struct SymbolConstantInstance {
419     enum inst_t t;
420 ben.allan 33 unsigned vflag; /**< assigned */
421     unsigned long visited; /**< visited counter */
422     unsigned long tmp_num; /**< used when an instance tree is being copied*/
423 aw0a 1 VOIDPTR interface_ptr;
424 ben.allan 33 unsigned int anon_flags; /**< anonymous field to be manipulated */
425     /**< above should match with CommonConstantInstance */
426     struct gl_list_t *parents; /**< link to parents */
427     struct gl_list_t *whens; /**< whens where this symbol appears*/
428     struct Instance *alike_ptr; /**< circular linked list of clique members?*/
429     struct TypeDescription *desc; /**< description of name, size */
430 aw0a 1 symchar *value;
431     };
432    
433 ben.allan 33 /**< RelationInstance should probably be pooled, as RealAtomInstance,
434 aw0a 1 * but isn't yet for the same reasons.
435     */
436 ben.allan 33 /**< aligns on 4 or 8 byte ptr machines. size 48/88 */
437 aw0a 1 struct RelationInstance {
438     enum inst_t t;
439 ben.allan 33 /**< on long pointer machines, we expect C compiler to pad 4 bytes here */
440 aw0a 1 VOIDPTR interface_ptr;
441 ben.allan 33 struct Instance *parent[2]; /**< relations can have only two parents and */
442     /**< normally they only have one. They have */
443     /**< two only during an ARE_THE_SAME */
444     struct TypeDescription *desc; /**< holds the child list stuff */
445 aw0a 1 unsigned long visited;
446 ben.allan 33 unsigned long tmp_num; /**< used when an instance tree is being copied*/
447     unsigned int anon_flags; /**< anonymous field to be manipulated */
448     enum Expr_enum type; /**< what kind of the 5 possible types of reln */
449     /**< type should be down in union RelationUnion*/
450     struct relation *ptr; /**< pointer to an instance relation */
451     struct gl_list_t *whens; /**< link to whens on which the rel appears */
452     struct gl_list_t *logrels; /**< link to satified's on which rel appears */
453     /**< So child insts start packing on 8byte address after child ptrs, of
454 aw0a 1 * which there are (currently, 2/97) always an even number.
455     */
456 ben.allan 33 /**< Not required anymore:
457 aw0a 1 *
458     * #if (LONGCHILDREN == 0)
459     * int padding;
460     * #endif
461     *
462     * Not valid anymore:
463     *
464     * An even number of child pointers are packed here, the last of which
465     * may not be real because the number of children may be odd.
466     * This extra should be eliminated for LONG pointer machines.
467     */
468    
469 ben.allan 33 /**< After the child pointers comes the data space for the actual
470 aw0a 1 * children.
471     */
472     };
473    
474    
475 ben.allan 33 /**< this aligns to 8 bytes with 4 or 8 byte pointers. size 48/88 */
476 aw0a 1 struct LogRelInstance {
477     enum inst_t t;
478 ben.allan 33 /**< on long pointer machines, we expect C compiler to pad 4 bytes here */
479 aw0a 1 VOIDPTR interface_ptr;
480 ben.allan 33 struct Instance *parent[2]; /**< log relations can have only two parents */
481     /**< and normally they only have one.They have */
482     /**< two only during an ARE_THE_SAME */
483     struct TypeDescription *desc; /**< holds the child list stuff */
484 aw0a 1 unsigned long visited;
485 ben.allan 33 unsigned long tmp_num; /**< used when an instance tree is being copied*/
486     struct logrelation *ptr; /**< pointer to an instance logical relation */
487     struct gl_list_t *whens; /**< link to whens on which the logrel appears */
488     struct gl_list_t *logrels; /**< link to satified's on which lrel appears */
489     unsigned int anon_flags; /**< anonymous field to be manipulated */
490 aw0a 1 int padding;
491 ben.allan 33 /**< so child insts start packing on 8byte address after child ptrs */
492     /**<
493 aw0a 1 * All logrelations are the same type/size, because we require
494     * exactly 1 refinement of the base definition.
495     */
496 ben.allan 33 /**< After the child pointers comes the data space for the actual
497 aw0a 1 * children. This space must start on an 8 byte address.
498     */
499     };
500    
501 ben.allan 33 /**< Never, ever, allocate either one of these types. it's a dummy for the
502 aw0a 1 * instantiator.
503     */
504     struct PendInstance {
505     enum inst_t t;
506     VOIDPTR p;
507     };
508    
509    
510 ben.allan 33 /**< COMPOUND INSTANCES */
511     /**< Note: All the compound instance structs, except ArrayChild,
512 aw0a 1 * and Automatic should have
513     enum inst_t t;
514     VOIDPTR pending_entry;
515     * as the first two lines to match PendInstance above.
516     * Relations of any type are NOT compound, other errors in
517     * this file not withstanding.
518     */
519 ben.allan 33 /**< this structure doesn't have to align on 4 byte ptr machines. size 48/88 */
520 aw0a 1 struct ModelInstance {
521     enum inst_t t;
522 ben.allan 33 VOIDPTR pending_entry; /**< hold a word only pending.c can touch */
523 aw0a 1 VOIDPTR interface_ptr;
524 ben.allan 33 struct gl_list_t *parents; /**< link to parent instances */
525     struct gl_list_t *whens; /**< link to whens on which the model appears */
526 aw0a 1 struct TypeDescription *desc;
527     struct Instance *alike_ptr;
528 ben.allan 33 struct BitList *executed; /**< bit list to keep track of which */
529     /**< statements have been executed */
530 aw0a 1 unsigned long visited;
531 ben.allan 33 unsigned long tmp_num; /**< used when an instance tree is being copied*/
532     unsigned int anon_flags; /**< anonymous field to be manipulated */
533 aw0a 1 #if (LONGCHILDREN == 1)
534 ben.allan 33 int padding; /**< so ptrs start packing on 8byte address */
535 aw0a 1 #endif
536 ben.allan 33 /**< The child pointers of model instances are packed here, but each is
537 aw0a 1 * different and there may not even be children. They are not
538     * accessible through the struct, but only through InstanceChild.
539     *
540     */
541     };
542    
543 ben.allan 33 /**< This struct not in use anywhere yet, pending more semantics */
544 aw0a 1 struct AutomaticInstance {
545     enum inst_t t;
546 ben.allan 33 /**< this object never pending since it has no statements */
547 aw0a 1 VOIDPTR interface_ptr;
548 ben.allan 33 struct Instance *sim_parent; /**< exactly one of these */
549     struct TypeDescription *desc; /**< UNIVERSAL and made at startup */
550 aw0a 1 unsigned long visited;
551 ben.allan 33 unsigned long tmp_num; /**< used when an instance tree is being copied*/
552     unsigned int anon_flags; /**< anonymous field to be manipulated */
553 aw0a 1
554 ben.allan 33 struct gl_list_t *children; /**< unique unsorted list of child insts */
555 aw0a 1
556 ben.allan 33 /**< struct hashtable *childdata;
557 aw0a 1 * hash lookup of children.
558     */
559 ben.allan 33 /**< note that in table there may be multiple names for a child that
560 aw0a 1 * occurs once in childdata.
561     */
562 ben.allan 33 /**< HANDS OFF! --Ben */
563 aw0a 1 };
564    
565 ben.allan 33 /**< First try of a WhenInstance needs to migrate toward the relations */
566     /**< would be nice to have a commoneqninstance type (CE_INST)
567 aw0a 1 * for rel,log,when.
568     */
569 ben.allan 33 /**< doesn't align as never has children. */
570 aw0a 1 struct WhenInstance {
571     enum inst_t t;
572     VOIDPTR interface_ptr;
573 ben.allan 33 struct Instance *parent[2]; /**< relations can have only two parents and */
574     /**< normally they only have one. They have */
575     /**< two only during an ARE_THE_SAME */
576     struct gl_list_t *whens; /**< used in case of nested whens */
577     struct gl_list_t *cases; /**< list of cases */
578     struct gl_list_t *bvar ; /**< list of references to boolean variables */
579     struct TypeDescription *desc; /**< holds the child list stuff */
580 aw0a 1 unsigned long visited;
581 ben.allan 33 unsigned long tmp_num; /**< used when an instance tree is being copied*/
582     unsigned int anon_flags; /**< anonymous field to be manipulated */
583 aw0a 1 };
584    
585 ben.allan 33 /**< are pooled, and therefore must align, but does so on its own */
586 aw0a 1 struct ArrayChild {
587 ben.allan 33 /**< this object never pending, but member inst may be */
588 aw0a 1 struct Instance *inst;
589     union {
590     symchar *str;
591     long index;
592     } name;
593     };
594    
595 ben.allan 33 /**< never has packed children. see gllist instead. */
596 aw0a 1 struct ArrayInstance {
597     enum inst_t t;
598 ben.allan 33 VOIDPTR pending_entry; /**< hold a word only pending.c can touch */
599 aw0a 1 VOIDPTR interface_ptr;
600 ben.allan 33 struct TypeDescription *desc; /**< holds the child list stuff */
601     struct gl_list_t *parents; /**< link to parent instances */
602     struct gl_list_t *children; /**< link to children */
603     unsigned long indirected; /**< number of times of indirected */
604 aw0a 1 unsigned long visited;
605 ben.allan 33 unsigned long tmp_num; /**< used when an instance tree is being copied*/
606     unsigned int anon_flags; /**< anonymous field to be manipulated */
607 aw0a 1 };
608    
609 ben.allan 33 /**< CONTAINER INSTANCE for interfaces. never pending. */
610     /**< no packed children, so never need align */
611     struct SimulationInstance { /**< these have *no* parents, yet */
612 aw0a 1 enum inst_t t;
613     VOIDPTR interface_ptr;
614 ben.allan 33 struct TypeDescription *desc; /**< copy of the typedesc of its lone child */
615     symchar *name; /**< name of its lone child */
616     struct Instance **extvars; /**< external variables handles hack */
617     unsigned long tmp_num; /**< used when an instance tree is being copied*/
618     unsigned int anon_flags; /**< anonymous field to be manipulated */
619     /**< add other interesting stuff here */
620 aw0a 1 };
621    
622 ben.allan 33 /**< dummy instance for unselected children of models */
623     /**< no alignment issue */
624 aw0a 1 struct GlobalDummyInstance {
625     enum inst_t t;
626 ben.allan 33 /**< never pending */
627 aw0a 1 VOIDPTR interface_ptr;
628 ben.allan 33 /**< no link to parent instances */
629     /**< when instances should ignore dummy completely */
630 aw0a 1 struct TypeDescription *desc;
631 ben.allan 33 /**< all dummies are alike -- and the same */
632     /**< dummy has not statements */
633 aw0a 1 unsigned long visited;
634 ben.allan 33 unsigned long ref_count; /**< mainly for debugging purposes */
635     unsigned long tmp_num; /**< used when an instance tree is being copied*/
636     /**< but CopyDummy==dummy always */
637     unsigned int anon_flags; /**< anonymous field to be manipulated */
638     /**< why make life hell for the unsuspecting client? */
639     /**<
640 aw0a 1 * In particular, the DUMMY_INST doesn't look like any category
641     * (EQN,Compound,Atom,Constant) because a single statically allocated
642     * instance of it stands in for all UNSELECTED_INSTANCEs that are
643     * not compiled.
644     * (This has nothing to do with the DummyIndexType.)
645     */
646     };
647    
648 ben.allan 33 #endif /**< __INSTANCE_TYPES_H_SEEN__ */

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22