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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

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