Jspice3
noisetp.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: 1987 Gary W. Ng
5  1992 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include <stdio.h>
10 #include "cktdefs.h"
11 #include "noisedef.h"
12 #include "jobdefs.h"
13 #include "iferrmsg.h"
14 
15 
16 int
17 NOISEsetParm(cktp,anal,which,value)
18 
19 GENERIC *cktp;
20 GENERIC *anal;
21 int which;
22 IFvalue *value;
23 {
24  NOISEAN *job = (NOISEAN *) anal;
25 
26  switch (which) {
27 
28  case N_OUTPUT:
29  job->Noutput = value->sValue;
30  break;
31 
32  case N_OUTREF:
33  job->NoutputRef = value->sValue;
34  break;
35 
36  case N_INPUT:
37  job->Ninput = value->sValue;
38  break;
39 
40  case N_PTSPERSUM:
41  job->NStpsSm = value->iValue;
42  break;
43 
44  default:
45  if (ACsetp(&job->AC,which,value) == OK)
46  return (OK);
47  if (DCTsetp(&job->DC,which,value) == OK)
48  return (OK);
49  return (E_BADPARM);
50  }
51  return (OK);
52 }
53 
54 
55 static IFparm Nparms[] = {
56  { "output", N_OUTPUT, IF_SET|IF_STRING, "output noise summation node" },
57  { "outputref", N_OUTREF, IF_SET|IF_STRING, "output noise reference node" },
58  { "input", N_INPUT, IF_SET|IF_STRING, "input noise source" },
59  { "ptspersum", N_PTSPERSUM, IF_SET|IF_INTEGER, "frequency points per summary report" },
60  { "dec", AC_DEC, IF_SET|IF_FLAG, "step by decades" },
61  { "oct", AC_OCT, IF_SET|IF_FLAG, "step by octaves" },
62  { "lin", AC_LIN, IF_SET|IF_FLAG, "step linearly" },
63  { "numsteps", AC_STEPS, IF_SET|IF_INTEGER, "number of frequencies" },
64  { "start", AC_START, IF_SET|IF_REAL, "starting frequency" },
65  { "stop", AC_STOP, IF_SET|IF_REAL, "ending frequency" },
66  { "name1", DC_NAME1, IF_SET|IF_INSTANCE, "name of source to step" },
67  { "start1", DC_START1, IF_SET|IF_REAL, "starting voltage/current"},
68  { "stop1", DC_STOP1, IF_SET|IF_REAL, "ending voltage/current" },
69  { "step1", DC_STEP1, IF_SET|IF_REAL, "voltage/current step" },
70  { "name2", DC_NAME2, IF_SET|IF_INSTANCE, "name of source to step" },
71  { "start2", DC_START2, IF_SET|IF_REAL, "starting voltage/current"},
72  { "stop2", DC_STOP2, IF_SET|IF_REAL, "ending voltage/current" },
73  { "step2", DC_STEP2, IF_SET|IF_REAL, "voltage/current step" }
74 };
75 
77  {
78  "NOISE",
79  "Noise analysis",
80 
81  sizeof(Nparms)/sizeof(IFparm),
82  Nparms
83  },
84  sizeof(NOISEAN),
86  NOISEparse,
89  NOISEan
90 };
int NOISEparse()
#define AC_STOP
Definition: analysis.h:56
#define N_PTSPERSUM
Definition: noisedef.h:78
#define AC_START
Definition: analysis.h:55
#define DC_STOP1
Definition: analysis.h:19
char * Ninput
Definition: noisedef.h:47
#define DC_START1
Definition: analysis.h:18
#define AC_OCT
Definition: analysis.h:53
#define E_BADPARM
Definition: iferrmsg.h:26
#define N_OUTREF
Definition: noisedef.h:76
#define IF_INSTANCE
Definition: ifsim.h:112
int iValue
Definition: ifsim.h:232
#define AC_LIN
Definition: analysis.h:54
SPICEanalysis NOISEinfo
Definition: noisetp.c:76
#define N_OUTPUT
Definition: noisedef.h:75
#define DC_NAME2
Definition: analysis.h:21
#define OK
Definition: iferrmsg.h:17
#define AC_STEPS
Definition: analysis.h:57
#define DC_STEP1
Definition: analysis.h:20
#define IF_SET
Definition: ifsim.h:135
char * NoutputRef
Definition: noisedef.h:46
int ACsetp()
#define IF_INTEGER
Definition: ifsim.h:107
#define N_INPUT
Definition: noisedef.h:77
int NOISEan()
#define DC_NAME1
Definition: analysis.h:17
Definition: ifsim.h:54
#define IF_REAL
Definition: ifsim.h:108
#define FREQUENCYDOMAIN
Definition: jobdefs.h:34
struct sACprms AC
Definition: noisedef.h:55
#define IF_FLAG
Definition: ifsim.h:106
static IFparm Nparms[]
Definition: noisetp.c:55
#define AC_DEC
Definition: analysis.h:52
int NOISEsetParm(GENERIC *cktp, GENERIC *anal, int which, IFvalue *value)
Definition: noisetp.c:17
int NStpsSm
Definition: noisedef.h:50
char * sValue
Definition: ifsim.h:235
struct sDCTprms DC
Definition: noisedef.h:56
#define DC_START2
Definition: analysis.h:22
#define DC_STOP2
Definition: analysis.h:23
#define IF_STRING
Definition: ifsim.h:111
#define DC_STEP2
Definition: analysis.h:24
int NOISEaskQuest()
char * Noutput
Definition: noisedef.h:45
char GENERIC
Definition: ifsim.h:27
int DCTsetp()