Jspice3
distsetp.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: 1988 Jaijeet S Roychowdhury
5  1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include <stdio.h>
10 #include "cktdefs.h"
11 #include "jobdefs.h"
12 #include "distodef.h"
13 #include "iferrmsg.h"
14 #include "distoext.h"
15 
16 
17 /* ARGSUSED */
18 int
19 DISTOsetParm(cktp,anal,which,value)
20 
21 GENERIC *cktp;
22 GENERIC *anal;
23 int which;
24 IFvalue *value;
25 {
26  switch (which) {
27 
28  case D_START:
29  ((DISTOAN*)anal)->DstartF1 = value->rValue;
30  break;
31 
32  case D_STOP:
33  ((DISTOAN*)anal)->DstopF1 = value->rValue;
34  break;
35 
36  case D_STEPS:
37  ((DISTOAN*)anal)->DnumSteps = value->iValue;
38  break;
39 
40  case D_DEC:
41  ((DISTOAN*)anal)->DstepType = DECADE;
42  break;
43 
44  case D_OCT:
45  ((DISTOAN*)anal)->DstepType = OCTAVE;
46  break;
47 
48  case D_LIN:
49  ((DISTOAN*)anal)->DstepType = LINEAR;
50  break;
51 
52  case D_F2OVRF1:
53  ((DISTOAN*)anal)->Df2ovrF1 = value->rValue;
54  ((DISTOAN*)anal)->Df2wanted = 1;
55  break;
56 
57  default:
58  return (E_BADPARM);
59  }
60  return (OK);
61 }
62 
63 
64 static IFparm Dparms[] = {
65  { "start", D_START, IF_SET|IF_REAL, "starting frequency" },
66  { "stop", D_STOP, IF_SET|IF_REAL, "ending frequency" },
67  { "numsteps", D_STEPS, IF_SET|IF_INTEGER, "number of frequencies" },
68  { "dec", D_DEC, IF_SET|IF_FLAG, "step by decades" },
69  { "oct", D_OCT, IF_SET|IF_FLAG, "step by octaves" },
70  { "lin", D_LIN, IF_SET|IF_FLAG, "step linearly" },
71  { "f2overf1", D_F2OVRF1, IF_SET|IF_REAL, "ratio of F2 to F1" },
72 };
73 
75  {
76  "DISTO",
77  "Small signal distortion analysis",
78 
79  sizeof(Dparms)/sizeof(IFparm),
80  Dparms
81  },
82  sizeof(DISTOAN),
84  DISTOparse,
87  DISTOan
88 };
#define D_LIN
Definition: distodef.h:150
int DISTOaskQuest()
#define D_DEC
Definition: distodef.h:148
#define D_STOP
Definition: distodef.h:152
#define E_BADPARM
Definition: iferrmsg.h:26
#define OCTAVE
Definition: analysis.h:48
int iValue
Definition: ifsim.h:232
double rValue
Definition: ifsim.h:233
#define OK
Definition: iferrmsg.h:17
#define IF_SET
Definition: ifsim.h:135
#define D_START
Definition: distodef.h:151
#define IF_INTEGER
Definition: ifsim.h:107
#define LINEAR
Definition: analysis.h:49
int DISTOparse()
SPICEanalysis DISTOinfo
Definition: distsetp.c:74
Definition: ifsim.h:54
#define IF_REAL
Definition: ifsim.h:108
int DISTOsetParm(GENERIC *cktp, GENERIC *anal, int which, IFvalue *value)
Definition: distsetp.c:19
#define FREQUENCYDOMAIN
Definition: jobdefs.h:34
#define D_F2OVRF1
Definition: distodef.h:154
#define IF_FLAG
Definition: ifsim.h:106
int DISTOan()
static IFparm Dparms[]
Definition: distsetp.c:64
#define DECADE
Definition: analysis.h:47
#define D_STEPS
Definition: distodef.h:153
char GENERIC
Definition: ifsim.h:27
#define D_OCT
Definition: distodef.h:149