implement option 'indverbosity' to control check of inductive systems

default is 2, maximum verbosity

option indverbosity=1
  can be used to prevent check for
    "incomplete set of couplings"

option indverbosity=0
  can be used to avoid the check altogether

set indverbosity=INTEGER
  or
.option indverbosity=INTEGER
  works as well
This commit is contained in:
rlar 2016-12-18 11:42:10 +01:00
parent 05ee2e0182
commit b5ccfca24b
10 changed files with 18 additions and 3 deletions

View File

@ -47,6 +47,7 @@ com_option(wordlist *wl)
}
printf("MaxOrder = %d\n", circuit->CKTmaxOrder);
printf("xmu = %g\n", circuit->CKTxmu);
printf("indverbosity = %d\n", circuit->CKTindverbosity);
printf("\nTolerances (absolute):\n");
printf("abstol (current) = %g\n", circuit->CKTabstol);

View File

@ -1410,6 +1410,7 @@ void com_snload(wordlist *wl)
_t(CKTmaxOrder);
_t(CKTintegrateMethod);
_t(CKTxmu);
_t(CKTindverbosity);
_t(CKTniState);

View File

@ -102,6 +102,7 @@ struct CKTcircuit {
int CKTmaxOrder; /* maximum integration method order */
int CKTintegrateMethod; /* the integration method to be used */
double CKTxmu; /* for trapezoidal method */
int CKTindverbosity; /* control check of inductive couplings */
/* known integration methods */
#define TRAPEZOIDAL 1

View File

@ -120,6 +120,7 @@ typedef struct {
#define OPT_NOOPAC 68
#define OPT_XMU 69
#define OPT_INDVERBOSITY 70
#ifdef XSPICE

View File

@ -21,6 +21,7 @@ struct TSKtask {
int TSKmaxOrder; /* maximum integration method order */
int TSKintegrateMethod; /* the integration method to be used */
double TSKxmu; /* for trapezoidal method */
int TSKindverbosity; /* control check of inductive systems */
int TSKcurrentAnalysis; /* the analysis in progress (if any) */
/* defines for the value of TSKcurrentAnalysis */

View File

@ -52,6 +52,7 @@ CKTdoJob(CKTcircuit *ckt, int reset, TSKtask *task)
ckt->CKTnomTemp = task->TSKnomTemp;
ckt->CKTmaxOrder = task->TSKmaxOrder;
ckt->CKTintegrateMethod = task->TSKintegrateMethod;
ckt->CKTindverbosity = task->TSKindverbosity;
ckt->CKTxmu = task->TSKxmu;
ckt->CKTbypass = task->TSKbypass;
ckt->CKTdcMaxIter = task->TSKdcMaxIter;

View File

@ -39,6 +39,7 @@ CKTnewTask(CKTcircuit *ckt, TSKtask **taskPtr, IFuid taskName, TSKtask **defPtr)
tsk->TSKnomTemp = def->TSKnomTemp;
tsk->TSKmaxOrder = def->TSKmaxOrder;
tsk->TSKintegrateMethod = def->TSKintegrateMethod;
tsk->TSKindverbosity = def->TSKindverbosity;
tsk->TSKxmu = def->TSKxmu;
tsk->TSKbypass = def->TSKbypass;
tsk->TSKdcMaxIter = def->TSKdcMaxIter;
@ -99,6 +100,8 @@ CKTnewTask(CKTcircuit *ckt, TSKtask **taskPtr, IFuid taskName, TSKtask **defPtr)
tsk->TSKdcTrcvMaxIter = 50;
tsk->TSKintegrateMethod = TRAPEZOIDAL;
tsk->TSKmaxOrder = 2;
/* full check, and full verbosity */
tsk->TSKindverbosity = 2;
/*
* when using trapezoidal method
* xmu=0: Backward Euler

View File

@ -114,6 +114,9 @@ CKTsetOpt(CKTcircuit *ckt, JOB *anal, int opt, IFvalue *val)
case OPT_BYPASS:
task->TSKbypass = val->iValue;
break;
case OPT_INDVERBOSITY:
task->TSKindverbosity = val->iValue;
break;
case OPT_XMU:
task->TSKxmu = val->rValue;
break;
@ -268,6 +271,7 @@ static IFparm OPTtbl[] = {
{ "lvltim", 0, IF_INTEGER,"Type of timestep control" },
{ "method", OPT_METHOD, IF_SET|IF_STRING,"Integration method" },
{ "maxord", OPT_MAXORD, IF_SET|IF_INTEGER,"Maximum integration order" },
{ "indverbosity", OPT_INDVERBOSITY, IF_SET|IF_INTEGER,"Control Inductive Systems Check (coupling)" },
{ "xmu", OPT_XMU, IF_SET|IF_REAL,"Coefficient for trapezoidal method" },
{ "defm", OPT_DEFM,IF_SET|IF_REAL,"Default MOSfet Multiplier" },
{ "defl", OPT_DEFL,IF_SET|IF_REAL,"Default MOSfet length" },

View File

@ -65,6 +65,7 @@ CKTinit(CKTcircuit **ckt) /* new circuit to create */
sckt->CKTintegrateMethod = TRAPEZOIDAL;
sckt->CKTorder = 1;
sckt->CKTmaxOrder = 2;
sckt->CKTindverbosity = 2;
sckt->CKTxmu = 0.5;
sckt->CKTpivotAbsTol = 1e-13;
sckt->CKTpivotRelTol = 1e-3;

View File

@ -55,7 +55,8 @@ MUTtemp(GENmodel *inModel, CKTcircuit *ckt)
*/
here->MUTfactor = here->MUTcoupling * sqrt(fabs(ind1 * ind2));
{
if (ckt->CKTindverbosity > 0) {
struct INDsystem *system;
if (!here->MUTind1->system && !here->MUTind2->system) {
@ -179,7 +180,7 @@ MUTtemp(GENmodel *inModel, CKTcircuit *ckt)
}
}
if (!positive || repetitions || expect) {
if (!positive || repetitions || (expect && ckt->CKTindverbosity > 1)) {
fprintf(stderr, "The Inductive System consisting of\n");
for (ind = system->first_ind; ind; ind = ind->system_next_ind)
fprintf(stderr, " %s", ind->INDname);
@ -197,7 +198,7 @@ MUTtemp(GENmodel *inModel, CKTcircuit *ckt)
fprintf(stderr, " %s < 0\n", ind->INDname);
if (repetitions)
fprintf(stderr, "has dupplicate K instances\n");
if (expect)
if (expect && ckt->CKTindverbosity > 1)
fprintf(stderr, "has an incomplete set of K couplings, (missing ones are implicitly 0)\n");
fprintf(stderr, "\n");
}