Initial version of donated sources by Avertec, 3.4p5.
[tas-yagle.git] / distrib / sources / api / tcl / avt_API.h
1 #include "avt_API_types.h"
2
3 /*
4 MAN avt_Config
5 CATEG tcl+config
6 DESCRIPTION
7 Main way to configure the tool. Affects a value to one of the variables listed in the Configuration Variables section
8 ARGS
9 var % Configuration variable to be set
10 val % New value
11 EXAMPLE % {avt_Config tasGenerateConeFile yes}
12 */
13 void avt_config (char *var, char *val);
14 void avt_Config (char *var, char *val);
15
16 /*
17 MAN avt_GetConfig
18 CATEG tcl+config
19 DESCRIPTION
20 returns the configurated value for configuration variable {var}
21 ARGS
22 var % Configuration variable to be set
23 EXAMPLE % {set cone_cfg [avt_GetConfig tasGenerateConeFile]}
24 */
25 char *avt_GetConfig (char *var);
26
27 // --------------
28 /*
29 MAN avt_SetBlackBoxes
30 CATEG tcl+files
31 DESCRIPTION
32 Allows the user to blackbox subcircuits. Blackboxed subcircuits will not be analyzed. Instead, the tool will let a hole. Whether this hole should
33 be filled up or not by a timing description depends on configuration variables {tasIgnoreBlackbox} and {tasTreatBlackboxHierarchically}.
34 If a blackbox name is prefixed with "unused:", no hole will be created but instead all transistors in the blackbox will be marked as unused. Those blackboxes can still be retreived with GNS if the recognition rule uses the same transistor names as in the blackbox.
35 This command is equivalent to and overrides the creation of a {BLACKBOX} file.
36 ARGS
37 list % List of subcircuits to be blackboxed. All intended blackboxed subcircuits should present as only one {avt_SetBlackBoxes} command is allowed.
38 EXAMPLE % {avt_SetBlackBoxes [list "sense_amp"]}
39 */
40 void avt_SetBlackBoxes(List *list);
41
42 // --------------
43 /*
44 MAN avt_LoadBehavior
45 CATEG tcl+files
46 DESCRIPTION
47 Loads behavioral descriptions and construct internal representation according to the file format
48 ARGS
49 filename % File to be loaded
50 format % Available formats are {vhdl} and {verilog}
51 EXAMPLE % {avt_LoadFile model.v verilog}
52 */
53 BehavioralFigure *avt_LoadBehavior(char *filename, char *format);
54
55 // --------------
56 /*
57 MAN avt_DriveBehavior
58 CATEG tcl+files
59 DESCRIPTION
60 Drives a behavioral description according to the file format from the given internal representation
61 ARGS
62 befig % Behavior to be driven
63 format % Available formats are {vhdl} and {verilog}
64 EXAMPLE % {avt_DriveBehavior $befig output.v verilog}
65 */
66 void avt_DriveBehavior(BehavioralFigure *befig, char *format);
67
68 // --------------
69 /*
70 MAN avt_LoadFile
71 CATEG tcl+files
72 DESCRIPTION
73 Loads files and construct internal representation according to the file format
74 ARGS
75 filename % File to be loaded
76 format % Available formats are {spice}, {tlf4}, {tlf3}, {lib}, {verilog}, {vhdl}, {spf}, {dspf}, {inf}, {spef} and {ttv}
77 EXAMPLE % {avt_LoadFile design.hsp spice}
78 */
79 void avt_LoadFile(char *filename, char *format);
80
81 // --------------
82 /*
83 MAN avt_EncryptSpice
84 CATEG tcl+files
85 DESCRIPTION
86 Encrypts all sections of a Spice file (netlist or technology file) which are encapsulated by the {.protect} and {.unprotect} spice cards.
87 ARGS
88 inputname % File to be encrypted
89 outputname % Destination for encrypted output
90 EXAMPLE % {avt_EncryptSpice techno.hsp techno.hsp.enc}
91 */
92 void avt_EncryptSpice(char *inputname, char *outputname);
93
94 // --------------
95 /*
96 MAN avt_GetNetlist
97 CATEG tcl+lofig
98 DESCRIPTION
99 Retrieves a netlist from memory and returns its pointer
100 ARGS
101 name % Name of the netlist to get in the program's memory
102 EXAMPLE % {set netlist [avt_GetNetlist "my_design"]}
103 */
104 Netlist *avt_GetNetlist(char *name);
105
106 // --------------
107 /*
108 MAN avt_FlattenNetlist
109 CATEG tcl+lofig
110 DESCRIPTION
111 Flattens a netlist to a given level.
112 ARGS
113 lf % Pointer on the netlist to be flattened
114 level % Hierarchical level (coming from top-level) the nelist will be flattened to. Available levels are {trs}, {catal} or {bbox} (transistor, catalog or blackbox). If none of those levels are used, {level} will be considered an instance name, to which the netlist will be flattened.
115 EXAMPLE % {avt_FlattenNetlist $netlist trs}
116 */
117 void avt_FlattenNetlist(Netlist *lf, char *level);
118
119 // --------------
120 /*
121 MAN avt_DriveNetlist
122 CATEG tcl+lofig
123 DESCRIPTION
124 Saves the netlist on disk according to the given format
125 ARGS
126 lf % Pointer on the netlist to be saved
127 filename % Name of the file to be created
128 format % Available formats are {spice}, {verilog}, {vhdl} and {spef}
129 EXAMPLE % {avt_DriveNetlist $netlist design.spi spice}
130 */
131 void avt_DriveNetlist(Netlist *lf, char *filename, char *format);
132
133 // --------------
134 /*
135 MAN avt_DisplayNetlistHierarchy
136 CATEG tcl+lofig
137 DESCRIPTION
138 Displays hierarchy information of a given netlist, and other info such as number of transistors
139 ARGS
140 f % Pointer on the file where to save information, for standard output set {stdout}
141 netlistname % Pointer on the netlist
142 maxdepth % Maximum hierarchical depth coming from top level; can be set to 0 for infinite depth
143 EXAMPLE % {avt_DisplayNetlistHierarchy stdout "my_design" 3}
144 */
145 void avt_DisplayNetlistHierarchy(FILE *f, char *netlistname, int maxdepth);
146
147 // --------------
148 /*
149 MAN avt_DisplayResistivePath
150 CATEG tcl+lofig
151 DESCRIPTION
152 Displays one resistive path between two connectors at the interface of a netlist.
153 ARGS
154 f % Pointer on the file where to save information, for standard output set {stdout}
155 lf % Pointer on the netlist
156 connector1 % first connector name
157 connector2 % second connector name
158 EXAMPLE % {avt_DisplayResistivePath stdout [avt_GetNetlist "mynetlistname"] vdd_0 vdd_1}
159 */
160 void avt_DisplayResistivePath(FILE *f, Netlist *lf, char *connector1, char *connector2);
161
162 // --------------
163 /*
164 MAN avt_RemoveResistances
165 CATEG tcl+lofig
166 DESCRIPTION
167 Removes all resistances on signals matching a regular expression
168 ARGS
169 lf % Pointer on the netlist where to remove resistances
170 nameregex % Regular expression to be matched, for all signals use {*}
171 EXAMPLE % {avt_RemoveResistances $netlist "cpu.*.sig3*"}
172
173 */
174 void avt_RemoveResistances(Netlist *lf, char *nameregex);
175
176 // --------------
177 /*
178 MAN avt_RemoveCapacitances
179 CATEG tcl+lofig
180 DESCRIPTION
181 Removes all capacitances on signals matching a regular expression
182 ARGS
183 lf % Pointer on the netlist where to remove capacitances
184 nameregx % Regular expression to be matched, for all signals use {*}
185 EXAMPLE % {avt_RemoveCapacitances $netlist "cpu.*.sig3*"}
186 */
187 void avt_RemoveCapacitances(Netlist *lf, char *nameregex);
188
189 // --------------
190 /*
191 MAN avt_StartWatch
192 CATEG tcl+system
193 DESCRIPTION
194 Starts a timer; if the timer already exixts it'll be reset to 0.
195 ARGS
196 name % Timer name
197 EXAMPLE % {avt_StartWatch "CPU_TIME"}
198 */
199
200
201
202 void avt_StartWatch(char *name);
203
204 // --------------
205 /*
206 MAN avt_StopWatch
207 CATEG tcl+system
208 DESCRIPTION
209 Stops a timer; the timer must be started for the function to work
210 ARGS
211 name % Name of the timer to stop
212 EXAMPLE % {avt_StopWatch "CPU_TIME"}
213 */
214 void avt_StopWatch(char *name);
215
216 // --------------
217 /*
218 MAN avt_PrintWatch
219 CATEG tcl+system
220 DESCRIPTION
221 Returns a string with the value of a timer; the timer must have been started
222 ARGS
223 name % Name of the timer to print
224 EXAMPLE % {avt_PrintWatch "CPU_TIME"}
225 */
226 char *avt_PrintWatch(char *name);
227
228 // --------------
229 /*
230 MAN avt_GetMemoryUsage
231 CATEG tcl+system
232 DESCRIPTION
233 Returns an integer with the memory usage of the program in bytes
234 ARGS
235 EXAMPLE % {set memory [avt_GetMemoryUsage]}
236 */
237 unsigned long avt_GetMemoryUsage();
238
239 /*
240 MAN avt_SetCatalog
241 CATEG tcl+files
242 DESCRIPTION
243 Sets the leaves when flattening a netlist to catal level; equivalent to create a CATAL file
244 ARGS
245 argv % List of subcircuits that will be used as leaves
246 EXAMPLE % {avt_SetCatalog [list "nand2" "inv" ]}
247 */
248 void avt_SetCatalog(List *argv);
249
250 /*
251 MAN avt_GetCatalog
252 CATEG tcl+files
253 DESCRIPTION
254 Returns the current list of cells set as leaves for a catal-level flatten
255 ARGS
256 EXAMPLE % {set catal [avt_GetCatalog]}
257 */
258 StringList *avt_GetCatalog();
259
260 void avt_SetSEED(int val);
261 void avt_AddRC(Netlist *lofig, int maxwire, double minc, double maxc, double minr, double maxr);
262 void avt_AddCC(Netlist *lofig, double minc, double maxc);
263 void avt_RemoveNetlist(char *name);
264 void avt_ViewNetlist(char *name);
265 void avt_ViewSignal(char *name, char *signal);
266 List* avt_SigList(char *name);
267 List* avt_PinList(char *name);
268 void avt_DriveSignalInfo( Netlist *lf, char *nameregex, char *filename );
269 void *_NULL_();
270 int avt_CodeName(char *name);
271
272 /*
273 MAN avt_CheckTechno
274 CATEG tcl+files
275 DESCRIPTION
276 Runs a set of benchs to findout possible technology errors
277 ARGS
278 label % A prefix label for the output result files
279 tn % NMOS transistor characteristics. It's a space separated string with coming first the NMOS transistor name followed by the parameters. Authorized parameters are: l, w, delvt0, mulu0, sa, sb, sd, nf, nrs, nrd, sc, sca, scb, scc.
280 tp % same as {tn} for PMOS transistor.
281 EXAMPLE % avt_CheckTechno check1 "nmos l=0.4u w=0.8u" "pmos l=0.4u w=1.6u"
282
283 */
284 void avt_CheckTechno(char *label, char *tn, char *tp);
285
286 int avt_BuildID();
287
288 /*
289 MAN avt_RegexIsMatching
290 CATEG tcl+system
291 DESCRIPTION
292 Returs 1 if {nametocheck} matches the regular expression {template}, 0 otherwise.
293 ARGS
294 nametocheck % name to check.
295 template % regular expression to use.
296 EXAMPLE % {set match [avt_RegexIsMatching tatoo5 *too*]}
297
298 */
299 int avt_RegexIsMatching(char *nametocheck, char *template);
300
301 /*
302 MAN avt_SetMainSeed
303 CATEG tcl+montecarlo
304 DESCRIPTION
305 Sets the main seed to use when evaluating random mathematical function with monte-carlo runs enabled. The main seed is used for anything but model parameters in a ".mcparam" spice section concerning transistor model alterations. This function goal is to enable the reproducibility of past results.
306 ARGS
307 value % seed value.
308 EXAMPLE % {avt_SetMainSeed 123456}
309
310 */
311 void avt_SetMainSeed(unsigned int value);
312
313 /*
314 MAN avt_GetMainSeed
315 CATEG tcl+montecarlo
316 DESCRIPTION
317 Returns the main seed used to evaluate random mathematical function with monte-carlo runs enabled. The main seed is used for anything but model parameters in a ".mcparam" spice section concerning transistor model alterations. This function goal is to enable the reproducibility of past results.\$This function must be called after HiTas execution.
318 ARGS
319 EXAMPLE % {puts [avt_GetMainSeed]}
320
321 */
322 unsigned int avt_GetMainSeed();
323
324 /*
325 MAN avt_SetGlobalSeed
326 CATEG tcl+montecarlo
327 DESCRIPTION
328 Sets the seed to use when evaluating random mathematical function with monte-carlo runs enabled. Global seed is used only for parameters in a ".mcparam" spice section concerning transistor model alterations. This function goal is to enable the reproducibility of past results.
329 ARGS
330 value % seed value.
331 EXAMPLE % {avt_SetGlobalSeed 654321}
332
333 */
334 void avt_SetGlobalSeed(unsigned int value);
335
336 /*
337 MAN avt_GetGlobalSeed
338 CATEG tcl+montecarlo
339 DESCRIPTION
340 Returns the main seed used to evaluate random mathematical function with monte-carlo runs enabled. Global seed is used only for parameters in a ".mcparam" spice section concerning transistor model alterations. This function goal is to enable the reproducibility of past results.\$This function must be called after HiTas execution.
341 ARGS
342 EXAMPLE % {puts [avt_GetGlobalSeed]}
343
344 */
345 unsigned int avt_GetGlobalSeed();
346
347 void avt_banner (char *tool, char *comment, char *date);