/[ascend]/trunk/tcltk/interface/SimsProc.h
ViewVC logotype

Contents of /trunk/tcltk/interface/SimsProc.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2065 - (show annotations) (download) (as text)
Tue Jul 7 00:17:03 2009 UTC (13 years, 4 months ago) by jpye
File MIME type: text/x-chdr
File size: 8582 byte(s)
Cleaned up SimsProc.h (removing old <!-- comments -->).
Fixed up some svn:ignore flags.
1 /* ASCEND modelling environment
2 Copyright (C) 1997, 2009 Carnegie Mellon University
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
7 any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA.
18 *//** @file
19 * Simulation procedures.
20 * <pre>
21 * To include this header, you must include the following:
22 * #include "tcl.h"
23 * #include "utilities/ascConfig.h"
24 * #include "compiler/compiler.h"
25 * #include "compiler/instance_enum.h"
26 * #include "interface/SimsProc.h"
27 * </pre>
28 *//*
29 * by Kirk Abbott and Ben Allan
30 * Created: 1/94
31 * Version: $Revision: 1.12 $
32 * Version control file: $RCSfile: SimsProc.h,v $
33 * Date last modified: $Date: 2003/08/23 18:43:08 $
34 * Last modified by: $Author: ballan $
35 */
36
37 #ifndef ASCTK_SIMSPROC_H
38 #define ASCTK_SIMSPROC_H
39
40 extern int Asc_SimsQueryCmd(ClientData cdata, Tcl_Interp *interp,
41 int argc, CONST84 char *argv[]);
42 /**<
43 * Simulation name utility.
44 * -# sims getcurrent --
45 * Returns the name of the current simualation.
46 * If the simulation is not found then, returns "1" or ""; else it
47 * returns the name of the simulation.
48 * -# sims setcurrent simname --
49 * Searches for the simulation that matches the specified name. If found
50 * sets the current simulation and returns "0". Otherwise it returns "1".
51 *
52 * Registered as : \"sims arg ?args?\";
53 */
54
55 extern int Asc_SimsUniqueNameCmd(ClientData dummy, Tcl_Interp *interp,
56 int argc, CONST84 char *argv[]);
57 /**<
58 * Returns 1 if name is not a simulation instance or if called with
59 * wrong number of args. Returns 0 if simulation name exists.<br><br>
60 *
61 * Registered as : unique \"name\";
62 */
63
64 extern int Asc_SimsCreateInstanceCmd(ClientData cdata, Tcl_Interp *interp,
65 int argc, CONST84 char *argv[]);
66 /**<
67 * A blatant ripoff of Tom Epperly's CreateInstance.
68 * Creates a simulation instance and adds to the global simlist.
69 * Returns 0 if failed, 1 if ok;<br><br>
70 *
71 * Registered as : screate \"simname\" \"type\".
72 */
73
74 extern int Asc_SimsResumeInstantiateCmd(ClientData cdata, Tcl_Interp *interp,
75 int argc, CONST84 char *argv[]);
76 /**<
77 * Returns "0" if sim not found, 1 if found.
78 *
79 * Registered as : sresume \"simname\";
80 */
81
82 extern int Asc_BrowResumeInstantiateCmd(ClientData cdata, Tcl_Interp *interp,
83 int argc, CONST84 char *argv[]);
84 /**<
85 * Browser callback to resume compilation.
86 * Assumes instance to be dealt with is in g_root. Returns "".<br><br>
87 *
88 * Registered as : bresume;
89 */
90
91 extern int Asc_SimsCopyInstanceCmd(ClientData cdata, Tcl_Interp *interp,
92 int argc, CONST84 char *argv[]);
93 /**<
94 * Will attempt to take the given qualified id id and 'copy' it.
95 * It will destroy the information immediately after. This is some
96 * experimental code.<br><br>
97 *
98 * Registered as : __sims_copy qlfdid;
99 */
100
101 extern int Asc_SimsProtoTypeInstanceCmd(ClientData cdata, Tcl_Interp *interp,
102 int argc, CONST84 char *argv[]);
103 /**<
104 * Will attempt to take the given qualified id id and prototype it.
105 * It will add the instance to the prototype library. It will copy<br><br>
106 *
107 * Registered as : __sims_proto qlfdid;
108 */
109
110 extern int Asc_SimsSaveInstanceCmd(ClientData cdata, Tcl_Interp *interp,
111 int argc, CONST84 char *argv[]);
112 /**<
113 * Will attemptlt to take the given qualified id and 'save' it to
114 * the specified file. This is still experimental code but hopefully
115 * not for long. The details of the save format may be found in
116 * instance_io.[ch]; If all goes well there will be a matching function
117 * called SimsRestoreInstanceCmd();
118 *
119 * Registered as : __sims_saveinst qlfdid file
120 */
121
122 extern int Asc_SimsUpdateInstanceCmd(ClientData cdata, Tcl_Interp *interp,
123 int argc, CONST84 char *argv[]);
124 /**<
125 * Will attempt to take the given qualified id and 'update' it
126 * using the information found in the file 'file', or using the given
127 * type information. At the moment it reads the instructions from a
128 * file. The primitives used may be found in compiler/instantiate.c
129 *
130 * Registered as : __sims_update qlfdid <file,type>;
131 */
132
133 extern int Asc_SimsDestroySimulationCmd(ClientData cdata, Tcl_Interp *interp,
134 int argc, CONST84 char *argv[]);
135 /**<
136 * Returns 1 if successful, returns 0 if not.
137 *
138 * Registered as : sdestroy \"simname\";
139 */
140
141 extern int Asc_BrowShowPendings(ClientData cdata, Tcl_Interp *interp,
142 int argc, CONST84 char *argv[]);
143 /**<
144 * Returns the number of pending statements.
145 * Call is:
146 * - "bnumpendings simulation sim_name" -- checks given sim_name.
147 * - "bnumpendings instance current" -- checks current instance.
148 * - "bnumpendings instance search" -- checks search instance.
149 * Will return > 1 if there are any pending statements.
150 * Returns a BIG number if no instance.
151 * For more details, use BrowWritePendings.
152 *
153 * Registered as : \"bnumpendings\" ?simulation?instance? ?sim?search?current?
154 */
155
156 extern int Asc_BrowWritePendingsSTDOUT(ClientData cdata, Tcl_Interp *interp,
157 int argc, CONST84 char *argv[]);
158 /**<
159 * Writes to stdout the list of pending statements for the given
160 * simulation. Will return an error if the simulation does not exist or
161 * the sim->root instance is NULL.
162 *
163 * Registered as: \"bwritependings\" simname.
164 */
165
166 extern int Asc_SimListPending(ClientData cdata, Tcl_Interp *interp,
167 int argc, CONST84 char *argv[]);
168 /**<
169 * Will print all the unassigned constants and undefined structures and
170 * unexecuted statements in a simulation. simname is the name of an
171 * instance in the global simulation list.
172 * Examples:
173 * - simlistpendings tf
174 * writes to stdout the pending messages of simulation tf
175 * - simlistpendings tf /tmp/asctfpend1374.1
176 * writes to scratch file /tmp/asctfpend1374. the pending messages of
177 * simulation tf.
178 *
179 * Registered as: simlistpending simname [optional filename]";
180 */
181
182 STDHLF_H(Asc_SimBinTokenSetOptions);
183 extern int Asc_SimBinTokenSetOptions(ClientData, Tcl_Interp*, int, CONST84 char**);
184 /** Registered as */
185 #define Asc_SimBinTokenSetOptionsHN "sim_BinTokenSetOptions"
186 /** Usage */
187 #define Asc_SimBinTokenSetOptionsHU \
188 Asc_SimBinTokenSetOptionsHN " <src obj lib build delete" \
189 " maxrels verbose housekeep>"
190 /** Short help text */
191 #define Asc_SimBinTokenSetOptionsHS \
192 "Defines the next set of file names and other misc to build/load with"
193 /** Long help text part 1 */
194 #define Asc_SimBinTokenSetOptionsHL "\
195 * Specifies full path names for source, object, and shared object files\n\
196 * to be used in the next compilation of binary token relations.\n\
197 * Names must be consistent and the name of the shared object must\n\
198 * be unique, e.g. where N is a number changing between instantiations:\n\
199 * /tmp/fooN.c /tmp/fooN.o /tmp/fooN.so <build command> /bin/rm 0 1 1000.\n\
200 * verbose is a code generation option 1 makes more readable code which\n\
201 * may be slower for cc to digest. housekeep if 1 causes intermediate\n\
202 * files to be aggressively deleted. maxrels is the most equations to\n\
203 * be allowed in one generated file. If more are needed, binary will not\n\
204 * be generated. If maxrels = 0, we ignore C generation completely.\n"
205 /** Long help text part 2 */
206 #define Asc_SimBinTokenSetOptionsHL2 "\
207 * Bugs: needs to have additional arguments for coping with F77, Java, etc.\n\
208 * Note: This function is called indirectly from sim_create, because\n\
209 * we need consistently updated version values and don't trust the tcl\n\
210 * programmer to remember that. Tinkering, if needed, should be done via\n\
211 * Sim_SetupBinTokenCC in LibraryProc.tcl\n\
212 "
213
214 #endif /* ASCTK_SIMSPROC_H */
215

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