devices/asrc, cleanup #3/9, polish comments
This commit is contained in:
parent
2cb727476f
commit
03ef81785a
|
|
@ -2,9 +2,6 @@
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1988 Kanwar Jit Singh
|
Author: 1988 Kanwar Jit Singh
|
||||||
**********/
|
**********/
|
||||||
/*
|
|
||||||
* singh@ic.Berkeley.edu
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "ngspice/ngspice.h"
|
#include "ngspice/ngspice.h"
|
||||||
#include "ngspice/cktdefs.h"
|
#include "ngspice/cktdefs.h"
|
||||||
|
|
@ -13,16 +10,15 @@ Author: 1988 Kanwar Jit Singh
|
||||||
#include "ngspice/suffix.h"
|
#include "ngspice/suffix.h"
|
||||||
|
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*
|
||||||
|
* Actually load the current voltage value into the
|
||||||
|
* sparse matrix previously provided. The values have
|
||||||
|
* been precomputed and stored with the instance model.
|
||||||
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
ASRCacLoad(GENmodel *inModel, CKTcircuit *ckt)
|
ASRCacLoad(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* Actually load the current voltage value into the
|
|
||||||
* sparse matrix previously provided. The values have
|
|
||||||
* been precomputed and stored with the instance model.
|
|
||||||
*/
|
|
||||||
|
|
||||||
ASRCmodel *model = (ASRCmodel*) inModel;
|
ASRCmodel *model = (ASRCmodel*) inModel;
|
||||||
ASRCinstance *here;
|
ASRCinstance *here;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
@ -32,9 +28,7 @@ ASRCacLoad(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
|
|
||||||
NG_IGNORE(ckt);
|
NG_IGNORE(ckt);
|
||||||
|
|
||||||
/* loop through all the Arbitrary source models */
|
|
||||||
for (; model != NULL; model = model->ASRCnextModel) {
|
for (; model != NULL; model = model->ASRCnextModel) {
|
||||||
/* loop through all the instances of the model */
|
|
||||||
for (here = model->ASRCinstances; here != NULL;
|
for (here = model->ASRCinstances; here != NULL;
|
||||||
here = here->ASRCnextInstance) {
|
here = here->ASRCnextInstance) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,6 @@
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1987 Kanwar Jit Singh
|
Author: 1987 Kanwar Jit Singh
|
||||||
**********/
|
**********/
|
||||||
/*
|
|
||||||
* singh@ic.Berkeley.edu
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This routine gives access to the internal device parameters
|
|
||||||
* of Current Controlled Voltage Source
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "ngspice/ngspice.h"
|
#include "ngspice/ngspice.h"
|
||||||
#include "ngspice/cktdefs.h"
|
#include "ngspice/cktdefs.h"
|
||||||
|
|
@ -20,7 +12,11 @@ Author: 1987 Kanwar Jit Singh
|
||||||
#include "ngspice/suffix.h"
|
#include "ngspice/suffix.h"
|
||||||
|
|
||||||
|
|
||||||
/* ARGSUSED */
|
/*
|
||||||
|
* This routine gives access to the internal device parameters
|
||||||
|
* of Current Controlled Voltage Source
|
||||||
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
ASRCask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFvalue *select)
|
ASRCask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFvalue *select)
|
||||||
{
|
{
|
||||||
|
|
@ -68,5 +64,4 @@ ASRCask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFvalu
|
||||||
default:
|
default:
|
||||||
return(E_BADPARM);
|
return(E_BADPARM);
|
||||||
}
|
}
|
||||||
/* NOTREACHED */
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,6 @@
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1987 Kanwar Jit Singh
|
Author: 1987 Kanwar Jit Singh
|
||||||
**********/
|
**********/
|
||||||
/*
|
|
||||||
* singh@ic.Berkeley.edu
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "ngspice/ngspice.h"
|
#include "ngspice/ngspice.h"
|
||||||
#include "asrcdefs.h"
|
#include "asrcdefs.h"
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,6 @@
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1987 Kanwar Jit Singh
|
Author: 1987 Kanwar Jit Singh
|
||||||
**********/
|
**********/
|
||||||
/*
|
|
||||||
* singh@ic.Berkeley.edu
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "ngspice/ngspice.h"
|
#include "ngspice/ngspice.h"
|
||||||
#include "ngspice/cktdefs.h"
|
#include "ngspice/cktdefs.h"
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,6 @@
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1987 Kanwar Jit Singh
|
Author: 1987 Kanwar Jit Singh
|
||||||
**********/
|
**********/
|
||||||
/*
|
|
||||||
* singh@ic.Berkeley.edu
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "ngspice/ngspice.h"
|
#include "ngspice/ngspice.h"
|
||||||
#include "ngspice/cktdefs.h"
|
#include "ngspice/cktdefs.h"
|
||||||
|
|
@ -17,14 +14,13 @@ double *asrc_vals, *asrc_derivs;
|
||||||
int asrc_nvals;
|
int asrc_nvals;
|
||||||
|
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/* actually load the current voltage value into the
|
||||||
|
* sparse matrix previously provided
|
||||||
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
ASRCload(GENmodel *inModel, CKTcircuit *ckt)
|
ASRCload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
{
|
{
|
||||||
/* actually load the current voltage value into the
|
|
||||||
* sparse matrix previously provided
|
|
||||||
*/
|
|
||||||
|
|
||||||
ASRCmodel *model = (ASRCmodel*) inModel;
|
ASRCmodel *model = (ASRCmodel*) inModel;
|
||||||
ASRCinstance *here;
|
ASRCinstance *here;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
@ -32,9 +28,7 @@ ASRCload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
double difference;
|
double difference;
|
||||||
double factor;
|
double factor;
|
||||||
|
|
||||||
/* loop through all the Arbitrary source models */
|
|
||||||
for (; model != NULL; model = model->ASRCnextModel) {
|
for (; model != NULL; model = model->ASRCnextModel) {
|
||||||
/* loop through all the instances of the model */
|
|
||||||
for (here = model->ASRCinstances; here != NULL;
|
for (here = model->ASRCinstances; here != NULL;
|
||||||
here=here->ASRCnextInstance)
|
here=here->ASRCnextInstance)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,6 @@
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1987 Kanwar Jit Singh
|
Author: 1987 Kanwar Jit Singh
|
||||||
**********/
|
**********/
|
||||||
/*
|
|
||||||
* singh@ic.Berkeley.edu
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "ngspice/ngspice.h"
|
#include "ngspice/ngspice.h"
|
||||||
#include "asrcdefs.h"
|
#include "asrcdefs.h"
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,6 @@
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1987 Kanwar Jit Singh
|
Author: 1987 Kanwar Jit Singh
|
||||||
**********/
|
**********/
|
||||||
/*
|
|
||||||
* singh@ic.Berkeley.edu
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "ngspice/ngspice.h"
|
#include "ngspice/ngspice.h"
|
||||||
#include "ngspice/ifsim.h"
|
#include "ngspice/ifsim.h"
|
||||||
|
|
@ -13,7 +10,6 @@ Author: 1987 Kanwar Jit Singh
|
||||||
#include "ngspice/suffix.h"
|
#include "ngspice/suffix.h"
|
||||||
|
|
||||||
|
|
||||||
/* ARGSUSED */
|
|
||||||
int
|
int
|
||||||
ASRCparam(int param, IFvalue *value, GENinstance *fast, IFvalue *select)
|
ASRCparam(int param, IFvalue *value, GENinstance *fast, IFvalue *select)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,12 @@ Author: 1987 Kanwar Jit Singh
|
||||||
#include "ngspice/complex.h"
|
#include "ngspice/complex.h"
|
||||||
|
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
int
|
|
||||||
ASRCpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
|
|
||||||
/* actually load the current voltage value into the
|
/* actually load the current voltage value into the
|
||||||
* sparse matrix previously provided
|
* sparse matrix previously provided
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
int
|
||||||
|
ASRCpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
|
||||||
{
|
{
|
||||||
ASRCmodel *model = (ASRCmodel*) inModel;
|
ASRCmodel *model = (ASRCmodel*) inModel;
|
||||||
ASRCinstance *here;
|
ASRCinstance *here;
|
||||||
|
|
@ -27,9 +27,7 @@ ASRCpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
|
||||||
|
|
||||||
NG_IGNORE(s);
|
NG_IGNORE(s);
|
||||||
|
|
||||||
/* loop through all the Arbitrary source models */
|
|
||||||
for (; model != NULL; model = model->ASRCnextModel) {
|
for (; model != NULL; model = model->ASRCnextModel) {
|
||||||
/* loop through all the instances of the model */
|
|
||||||
for (here = model->ASRCinstances; here != NULL;
|
for (here = model->ASRCinstances; here != NULL;
|
||||||
here = here->ASRCnextInstance)
|
here = here->ASRCnextInstance)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,6 @@
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1987 Kanwar Jit Singh
|
Author: 1987 Kanwar Jit Singh
|
||||||
**********/
|
**********/
|
||||||
/*
|
|
||||||
* singh@ic.Berkeley.edu
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "ngspice/ngspice.h"
|
#include "ngspice/ngspice.h"
|
||||||
#include "ngspice/cktdefs.h"
|
#include "ngspice/cktdefs.h"
|
||||||
|
|
@ -13,12 +10,12 @@ Author: 1987 Kanwar Jit Singh
|
||||||
#include "ngspice/suffix.h"
|
#include "ngspice/suffix.h"
|
||||||
|
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
int
|
|
||||||
ASRCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
|
||||||
/* load the voltage source structure with those
|
/* load the voltage source structure with those
|
||||||
* pointers needed later for fast matrix loading
|
* pointers needed later for fast matrix loading
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
int
|
||||||
|
ASRCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
{
|
{
|
||||||
ASRCinstance *here;
|
ASRCinstance *here;
|
||||||
ASRCmodel *model = (ASRCmodel*) inModel;
|
ASRCmodel *model = (ASRCmodel*) inModel;
|
||||||
|
|
@ -28,9 +25,7 @@ ASRCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
|
|
||||||
NG_IGNORE(states);
|
NG_IGNORE(states);
|
||||||
|
|
||||||
/* loop through all the user models*/
|
|
||||||
for (; model != NULL; model = model->ASRCnextModel) {
|
for (; model != NULL; model = model->ASRCnextModel) {
|
||||||
/* loop through all the instances of the model */
|
|
||||||
for (here = model->ASRCinstances; here != NULL;
|
for (here = model->ASRCinstances; here != NULL;
|
||||||
here=here->ASRCnextInstance) {
|
here=here->ASRCnextInstance) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,7 @@ ASRCtemp(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
ASRCmodel *model = (ASRCmodel *) inModel;
|
ASRCmodel *model = (ASRCmodel *) inModel;
|
||||||
ASRCinstance *here;
|
ASRCinstance *here;
|
||||||
|
|
||||||
/* loop through all the source models */
|
|
||||||
for (; model != NULL; model = model->ASRCnextModel) {
|
for (; model != NULL; model = model->ASRCnextModel) {
|
||||||
/* loop through all the instances of the model */
|
|
||||||
for (here = model->ASRCinstances; here != NULL;
|
for (here = model->ASRCinstances; here != NULL;
|
||||||
here = here->ASRCnextInstance) {
|
here = here->ASRCnextInstance) {
|
||||||
|
|
||||||
|
|
@ -26,7 +24,7 @@ ASRCtemp(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
if (!here->ASRCtempGiven) {
|
if (!here->ASRCtempGiven) {
|
||||||
here->ASRCtemp = ckt->CKTtemp;
|
here->ASRCtemp = ckt->CKTtemp;
|
||||||
if (!here->ASRCdtempGiven) here->ASRCdtemp = 0.0;
|
if (!here->ASRCdtempGiven) here->ASRCdtemp = 0.0;
|
||||||
} else { /* ASRCtempGiven */
|
} else {
|
||||||
here->ASRCdtemp = 0.0;
|
here->ASRCdtemp = 0.0;
|
||||||
if (here->ASRCdtempGiven)
|
if (here->ASRCdtempGiven)
|
||||||
printf("%s: Instance temperature specified, dtemp ignored\n", here->ASRCname);
|
printf("%s: Instance temperature specified, dtemp ignored\n", here->ASRCname);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue