Jspice3
dctsetp.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 "dctdefs.h"
12 #include "jobdefs.h"
13 #include "iferrmsg.h"
14 #include "util.h"
15 
16 
17 /* ARGSUSED */
18 int
19 DCTsetParm(cktp,anal,which,value)
20 
21 GENERIC *cktp;
22 GENERIC *anal;
23 int which;
24 IFvalue *value;
25 {
26  DCTAN *job = (DCTAN *) anal;
27 
28  if (DCTsetp(&job->DC,which,value) == OK)
29  return (OK);
30  return (E_BADPARM);
31 }
32 
33 
34 int
35 DCTsetp(dc,which,value)
36 
37 struct sDCTprms *dc;
38 int which;
39 IFvalue *value;
40 {
41  switch (which) {
42 
43  case DC_NAME1:
44  dc->nestLevel = 0;
45  dc->eltName[0] = value->uValue;
46  break;
47 
48  case DC_START1:
49  dc->vstart[0] = value->rValue;
50  break;
51 
52  case DC_STOP1:
53  dc->vstop[0] = value->rValue;
54  break;
55 
56  case DC_STEP1:
57  dc->vstep[0] = value->rValue;
58  break;
59 
60  case DC_NAME2:
61  dc->eltName[1] = value->uValue;
62  break;
63 
64  case DC_START2:
65  dc->vstart[1] = value->rValue;
66  break;
67 
68  case DC_STOP2:
69  dc->vstop[1] = value->rValue;
70  break;
71 
72  case DC_STEP2:
73  dc->vstep[1] = value->rValue;
74  dc->nestLevel = 1;
75  break;
76 
77  default:
78  return (E_BADPARM);
79  }
80  return (OK);
81 }
82 
83 
84 static IFparm DCTparms[] = {
85  { "name1", DC_NAME1, IFP|IF_INSTANCE, "name of source to step" },
86  { "start1", DC_START1, IFP|IF_REAL, "starting voltage/current"},
87  { "stop1", DC_STOP1, IFP|IF_REAL, "ending voltage/current" },
88  { "step1", DC_STEP1, IFP|IF_REAL, "voltage/current step" },
89  { "name2", DC_NAME2, IFP|IF_INSTANCE, "name of source to step" },
90  { "start2", DC_START2, IFP|IF_REAL, "starting voltage/current"},
91  { "stop2", DC_STOP2, IFP|IF_REAL, "ending voltage/current" },
92  { "step2", DC_STEP2, IFP|IF_REAL, "voltage/current step" }
93 };
94 
95 
97  {
98  "DCTransfer",
99  "D.C. Transfer curve analysis",
100 
101  sizeof(DCTparms)/sizeof(IFparm),
102  DCTparms
103  },
104  sizeof(DCTAN),
105  SWEEPDOMAIN,
106  DCTparse,
107  DCTsetParm,
108  DCTaskQuest,
109  DCTan
110 };
static IFparm DCTparms[]
Definition: dctsetp.c:84
#define DC_STOP1
Definition: analysis.h:19
Definition: dctdefs.h:18
#define DC_START1
Definition: analysis.h:18
#define E_BADPARM
Definition: iferrmsg.h:26
int DCTaskQuest()
#define IF_INSTANCE
Definition: ifsim.h:112
int DCTsetp(struct sDCTprms *dc, int which, IFvalue *value)
Definition: dctsetp.c:35
double rValue
Definition: ifsim.h:233
#define DC_NAME2
Definition: analysis.h:21
#define OK
Definition: iferrmsg.h:17
#define IFP
Definition: analysis.h:10
#define DC_STEP1
Definition: analysis.h:20
struct sDCTprms DC
Definition: dctdefs.h:23
int DCTan()
int DCTsetParm(GENERIC *cktp, GENERIC *anal, int which, IFvalue *value)
Definition: dctsetp.c:19
#define DC_NAME1
Definition: analysis.h:17
Definition: ifsim.h:54
#define IF_REAL
Definition: ifsim.h:108
SPICEanalysis DCTinfo
Definition: dctsetp.c:96
#define DC_START2
Definition: analysis.h:22
int DCTparse()
#define DC_STOP2
Definition: analysis.h:23
#define DC_STEP2
Definition: analysis.h:24
#define SWEEPDOMAIN
Definition: jobdefs.h:35
char GENERIC
Definition: ifsim.h:27
IFuid uValue
Definition: ifsim.h:236