📄 ifsim.h
字号:
* * Note to simulators: you are passing an array of pointers to * these structures, so you may in fact make this the first component * in a larger, more complex structure which includes other data * which you need, but which is not needed in the common * front end interface. * */typedef struct sIFdevice { char *name; /* name of this type of device */ char *description; /* description of this type of device */ int *terms; /* number of terminals on this device */ int *numNames; /* number of names in termNames */ char **termNames; /* pointer to array of pointers to names */ /* array contains 'terms' pointers */ int *numInstanceParms; /* number of instance parameter descriptors */ IFparm *instanceParms; /* array of instance parameter descriptors */ int *numModelParms; /* number of model parameter descriptors */ IFparm *modelParms; /* array of model parameter descriptors */ int flags; /* DEV_ */} IFdevice;/* * Structure: IFanalysis * * This structure contains all the information available to the * front end about a particular analysis type. The simulator will * present the front end with an array of pointers to these structures * which it will use to determine legal analysis types and parameters. * * Note to simulators: As for IFdevice above, you pass an array of pointers * to these, so you can make this structure a prefix to a larger structure * which you use internally. * */typedef struct sIFanalysis { char *name; /* name of this analysis type */ char *description; /* description of this type of analysis */ int numParms; /* number of analysis parameter descriptors */ IFparm *analysisParms; /* array of analysis parameter descriptors */} IFanalysis;/* * Structure: IFsimulator * * This is what we have been leading up to all along. * This structure describes a simulator to the front end, and is * returned from the SIMinit command to the front end. * This is where all those neat structures we described in the first * few hundred lines of this file come from. * */typedef struct sIFsimulator { char *simulator; /* the simulator's name */ char *description; /* description of this simulator */ char *version; /* version or revision level of simulator*/#ifdef __STDC__ int ((*newCircuit)(GENERIC **)); /* create new circuit */ int ((*deleteCircuit)(GENERIC *)); /* destroy old circuit's data structures*/ int ((*newNode)(GENERIC *,GENERIC**,IFuid)); /* create new node */ int ((*groundNode)(GENERIC*,GENERIC**,IFuid)); /* create ground node */ int ((*bindNode)(GENERIC *,GENERIC*,int,GENERIC*)); /* bind a node to a terminal */ int ((*findNode)(GENERIC *,GENERIC**,IFuid)); /* find a node by name */ int ((*instToNode)(GENERIC *,GENERIC *,int,GENERIC **,IFuid *)); /* find the node attached to a terminal */ int ((*setNodeParm)(GENERIC*,GENERIC*,int,IFvalue*,IFvalue*)); /* set a parameter on a node */ int ((*askNodeQuest)(GENERIC*,GENERIC*,int,IFvalue*,IFvalue*)); /* ask a question about a node */ int ((*deleteNode)(GENERIC*,GENERIC*)); /* delete a node from the circuit */ int ((*newInstance)(GENERIC*,GENERIC*,GENERIC**,IFuid)); /* create new instance */ int ((*setInstanceParm)(GENERIC*,GENERIC*,int,IFvalue*,IFvalue*)); /* set a parameter on an instance */ int ((*askInstanceQuest)(GENERIC*,GENERIC*,int,IFvalue*,IFvalue*)); /* ask a question about an instance */ int ((*findInstance)(GENERIC*,int*,GENERIC**,IFuid,GENERIC*,IFuid)); /* find a specific instance */ int ((*deleteInstance)(GENERIC*,GENERIC*)); /* delete an instance from the circuit */ int ((*newModel)(GENERIC*,int,GENERIC**,IFuid)); /* create new model */ int ((*setModelParm)(GENERIC*,GENERIC*,int,IFvalue*,IFvalue*)); /* set a parameter on a model */ int ((*askModelQuest)(GENERIC*,GENERIC*,int,IFvalue*,IFvalue*)); /* ask a questions about a model */ int ((*findModel)(GENERIC*,int*,GENERIC**,IFuid)); /* find a specific model */ int ((*deleteModel)(GENERIC*,GENERIC*)); /* delete a model from the circuit*/ int ((*newTask)(GENERIC*,GENERIC**,IFuid)); /* create a new task */ int ((*newAnalysis)(GENERIC*,int,IFuid,GENERIC**,GENERIC*)); /* create new analysis within a task */ int ((*setAnalysisParm)(GENERIC*,GENERIC*,int,IFvalue*,IFvalue*)); /* set a parameter on an analysis */ int ((*askAnalysisQuest)(GENERIC*,GENERIC*,int,IFvalue*,IFvalue*)); /* ask a question about an analysis */ int ((*findAnalysis)(GENERIC*,int*,GENERIC**,IFuid,GENERIC*,IFuid)); /* find a specific analysis */ int ((*findTask)(GENERIC*,GENERIC**,IFuid)); /* find a specific task */ int ((*deleteTask)(GENERIC*,GENERIC*)); /* delete a task */ int ((*doAnalyses)(GENERIC*,int,GENERIC*)); char *((*nonconvErr)(GENERIC*,char *)); /* return nonconvergence error */#else int ((*newCircuit)()); /* create new circuit */ int ((*deleteCircuit)()); /* destroy old circuit's data structures */ int ((*newNode)()); /* create new node */ int ((*groundNode)()); /* create ground node */ int ((*bindNode)()); /* bind a node to a terminal */ int ((*findNode)()); /* find a node by name */ int ((*instToNode)()); /* find the node attached to a terminal */ int ((*setNodeParm)()); /* set a parameter on a node */ int ((*askNodeQuest)()); /* ask a question about a node */ int ((*deleteNode)()); /* delete a node from the circuit */ int ((*newInstance)()); /* create new instance */ int ((*setInstanceParm)()); /* set a parameter on an instance */ int ((*askInstanceQuest)()); /* ask a question about an instance */ int ((*findInstance)()); /* find a specific instance */ int ((*deleteInstance)()); /* delete an instance from the circuit */ int ((*newModel)()); /* create new model */ int ((*setModelParm)()); /* set a parameter on a model */ int ((*askModelQuest)()); /* ask a questions about a model */ int ((*findModel)()); /* find a specific model */ int ((*deleteModel)()); /* delete a model from the circuit*/ int ((*newTask)()); /* create a new task */ int ((*newAnalysis)()); /* create new analysis within a task */ int ((*setAnalysisParm)()); /* set a parameter on an analysis */ int ((*askAnalysisQuest)()); /* ask a question about an analysis */ int ((*findAnalysis)()); /* find a specific analysis */ int ((*findTask)()); /* find a specific task */ int ((*deleteTask)()); /* delete a task */ int ((*doAnalyses)()); /* run a specified task */ char *((*nonconvErr)()); /* return nonconvergence error */#endif /* STDC */ int numDevices; /* number of device types supported */ IFdevice **devices; /* array of device type descriptors */ int numAnalyses; /* number of analysis types supported */ IFanalysis **analyses; /* array of analysis type descriptors */ int numNodeParms; /* number of node parameters supported */ IFparm *nodeParms; /* array of node parameter descriptors */ int numSpecSigs; /* number of special signals legal in parse trees */ char **specSigs; /* names of special signals legal in parse trees */} IFsimulator;/* * Structure: IFfrontEnd * * This structure provides the simulator with all the information * it needs about the front end. This is the entire set of * front end and back end related routines the simulator * should know about. * */typedef struct sIFfrontEnd {#ifdef __STDC__ int ((*IFnewUid)(GENERIC*,IFuid*,IFuid,char*,int,GENERIC**)); /* create a new UID in the circuit */ int ((*IFdelUid)(GENERIC*,IFuid,int)); /* create a new UID in the circuit */ int ((*IFpauseTest)(void)); /* should we stop now? */ double ((*IFseconds)(void)); /* what time is it? */ int ((*IFerror)(int,char*,IFuid*)); /* output an error or warning message */ int ((*OUTpBeginPlot)(GENERIC*,GENERIC*,IFuid,IFuid,int, int,IFuid*,int,GENERIC**)); /* start pointwise output plot */ int ((*OUTpData)(GENERIC*,IFvalue*,IFvalue*)); /* data for pointwise plot */ int ((*OUTwBeginPlot)(GENERIC*,GENERIC*,IFuid,IFuid,int, int,IFuid*,int,GENERIC**)); /* start windowed output plot */ int ((*OUTwReference)(GENERIC*,IFvalue*,GENERIC**)); /* independent vector for windowed plot */ int ((*OUTwData)(GENERIC*,int,IFvalue*,GENERIC*)); /* data for windowed plot */ int ((*OUTwEnd)(GENERIC*)); /* signal end of windows */ int ((*OUTendPlot)(GENERIC*)); /* end of plot */ int ((*OUTbeginDomain)(GENERIC*,IFuid,int,IFvalue*)); /* start nested domain */ int ((*OUTendDomain)(GENERIC*)); /* end nested domain */ int ((*OUTattributes)(GENERIC *,IFuid*,int,IFvalue*)); /* specify output attributes of node */#else /* not STDC */ int ((*IFnewUid)()); /* create a new UID in the circuit */ int ((*IFdelUid)()); /* create a new UID in the circuit */ int ((*IFpauseTest)()); /* should we stop now? */ double ((*IFseconds)()); /* what time is it? */ int ((*IFerror)()); /* output an error or warning message */ int ((*OUTpBeginPlot)()); /* start pointwise output plot */ int ((*OUTpData)()); /* data for pointwise plot */ int ((*OUTwBeginPlot)()); /* start windowed output plot */ int ((*OUTwReference)()); /* independent vector for windowed plot */ int ((*OUTwData)()); /* data for windowed plot */ int ((*OUTwEnd)()); /* signal end of windows */ int ((*OUTendPlot)()); /* end of plot */ int ((*OUTbeginDomain)()); /* start nested domain */ int ((*OUTendDomain)()); /* end nested domain */ int ((*OUTattributes)()); /* specify output attributes of node */#endif /* STDC */} IFfrontEnd;/* flags for the first argument to IFerror */#define ERR_WARNING 0x1#define ERR_FATAL 0x2#define ERR_PANIC 0x4#define ERR_INFO 0x8 /* valid values for the second argument to doAnalyses */ /* continue the analysis from where we left off */#define RESUME 0 /* start everything over from the beginning of this task*/#define RESTART 1 /* abandon the current analysis and go on the the next in the task*/#define SKIPTONEXT 2#define OUT_SCALE_LIN 1#define OUT_SCALE_LOG 2#endif /*IFSIMULATOR*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -