Jspice3
tfsetp.c
Go to the documentation of this file.
1 /***************************************************************************
2 JSPICE3 adaptation of Spice3f2 - Copyright (c) Stephen R. Whiteley 1992
3 Copyright 1990 Regents of the University of California. All rights reserved.
4 Authors: 1985 Thomas L. Quarles
5  1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include <stdio.h>
10 #include "cktdefs.h"
11 #include "tfdefs.h"
12 #include "jobdefs.h"
13 #include "iferrmsg.h"
14 #include "util.h"
15 #include "cktext.h"
16 
17 
18 /* ARGSUSED */
19 int
20 TFsetParm(cktp,anal,which,value)
21 
22 GENERIC *cktp;
23 GENERIC *anal;
24 int which;
25 IFvalue *value;
26 {
27  TFAN *job = (TFAN *) anal;
28 
29  switch (which) {
30 
31  case TF_OUTPOS:
32  job->TFoutPos = (CKTnode *)value->nValue;
33  job->TFoutIsV = TRUE;
34  job->TFoutIsI = FALSE;
35  break;
36 
37  case TF_OUTNEG:
38  job->TFoutNeg = (CKTnode *)value->nValue;
39  job->TFoutIsV = TRUE;
40  job->TFoutIsI = FALSE;
41  break;
42 
43  case TF_OUTNAME:
44  job->TFoutName = value->sValue;
45  break;
46 
47  case TF_OUTSRC:
48  job->TFoutSrc = value->uValue;
49  job->TFoutIsV = FALSE;
50  job->TFoutIsI = TRUE;
51  break;
52 
53  case TF_INSRC:
54  job->TFinSrc = value->uValue;
55  break;
56 
57  default:
58  if (ACsetp(&job->AC,which,value) == OK)
59  return (OK);
60  if (DCTsetp(&job->DC,which,value) == OK)
61  return (OK);
62  return (E_BADPARM);
63  }
64  return (OK);
65 }
66 
67 
68 static IFparm TFparms[] = {
69  { "outpos", TF_OUTPOS, IFP|IF_NODE, "Positive output node" },
70  { "outneg", TF_OUTNEG, IFP|IF_NODE, "Negative output node" },
71  { "outname", TF_OUTNAME, IFP|IF_STRING, "Name of output variable"},
72  { "outsrc", TF_OUTSRC, IFP|IF_INSTANCE, "Output source" },
73  { "insrc", TF_INSRC, IFP|IF_INSTANCE, "Input source" },
74  { "start", AC_START, IFP|IF_REAL, "starting frequency" },
75  { "stop", AC_STOP, IFP|IF_REAL, "ending frequency" },
76  { "numsteps", AC_STEPS, IFP|IF_INTEGER, "number of frequencies"},
77  { "dec", AC_DEC, IFP|IF_FLAG, "step by decades" },
78  { "oct", AC_OCT, IFP|IF_FLAG, "step by octaves" },
79  { "lin", AC_LIN, IFP|IF_FLAG, "step linearly" },
80  { "name1", DC_NAME1, IFP|IF_INSTANCE, "name of source to step" },
81  { "start1", DC_START1, IFP|IF_REAL, "starting voltage/current"},
82  { "stop1", DC_STOP1, IFP|IF_REAL, "ending voltage/current" },
83  { "step1", DC_STEP1, IFP|IF_REAL, "voltage/current step" },
84  { "name2", DC_NAME2, IFP|IF_INSTANCE, "name of source to step" },
85  { "start2", DC_START2, IFP|IF_REAL, "starting voltage/current"},
86  { "stop2", DC_STOP2, IFP|IF_REAL, "ending voltage/current" },
87  { "step2", DC_STEP2, IFP|IF_REAL, "voltage/current step" }
88 };
89 
91  {
92  "TF",
93  "transfer function analysis",
94 
95  sizeof(TFparms)/sizeof(IFparm),
96  TFparms
97  },
98  sizeof(TFAN),
99  NODOMAIN,
100  TFparse,
101  TFsetParm,
102  TFaskQuest,
103  TFan
104 };
CKTnode * TFoutPos
Definition: tfdefs.h:19
#define AC_STOP
Definition: analysis.h:56
Definition: tfdefs.h:15
#define FALSE
Definition: mfb.h:23
unsigned int TFoutIsI
Definition: tfdefs.h:28
static IFparm TFparms[]
Definition: tfsetp.c:68
#define TF_OUTNEG
Definition: tfdefs.h:36
#define AC_START
Definition: analysis.h:55
#define DC_STOP1
Definition: analysis.h:19
#define NODOMAIN
Definition: jobdefs.h:32
struct sACprms AC
Definition: tfdefs.h:31
#define DC_START1
Definition: analysis.h:18
#define AC_OCT
Definition: analysis.h:53
#define E_BADPARM
Definition: iferrmsg.h:26
#define TRUE
Definition: util.h:27
#define IF_INSTANCE
Definition: ifsim.h:112
#define TF_OUTNAME
Definition: tfdefs.h:39
IFuid TFoutSrc
Definition: tfdefs.h:21
#define AC_LIN
Definition: analysis.h:54
char * TFoutName
Definition: tfdefs.h:26
#define DC_NAME2
Definition: analysis.h:21
#define OK
Definition: iferrmsg.h:17
#define TF_OUTPOS
Definition: tfdefs.h:35
#define AC_STEPS
Definition: analysis.h:57
#define TF_INSRC
Definition: tfdefs.h:38
int TFparse()
#define IFP
Definition: analysis.h:10
#define DC_STEP1
Definition: analysis.h:20
struct sDCTprms DC
Definition: tfdefs.h:32
IFnode nValue
Definition: ifsim.h:237
int ACsetp()
#define IF_INTEGER
Definition: ifsim.h:107
int TFaskQuest()
int TFan()
CKTnode * TFoutNeg
Definition: tfdefs.h:20
#define DC_NAME1
Definition: analysis.h:17
Definition: ifsim.h:54
#define IF_REAL
Definition: ifsim.h:108
#define IF_FLAG
Definition: ifsim.h:106
#define AC_DEC
Definition: analysis.h:52
#define TF_OUTSRC
Definition: tfdefs.h:37
IFuid TFinSrc
Definition: tfdefs.h:22
char * sValue
Definition: ifsim.h:235
unsigned int TFoutIsV
Definition: tfdefs.h:27
#define DC_START2
Definition: analysis.h:22
SPICEanalysis TFinfo
Definition: tfsetp.c:90
#define DC_STOP2
Definition: analysis.h:23
#define IF_STRING
Definition: ifsim.h:111
#define DC_STEP2
Definition: analysis.h:24
#define IF_NODE
Definition: ifsim.h:110
int TFsetParm(GENERIC *cktp, GENERIC *anal, int which, IFvalue *value)
Definition: tfsetp.c:20
char GENERIC
Definition: ifsim.h:27
IFuid uValue
Definition: ifsim.h:236
int DCTsetp()