From a1d27b4257c92cfed553a83f6f0dc0b2f9b9ea0c Mon Sep 17 00:00:00 2001 From: dwarning Date: Tue, 25 Jul 2017 10:53:06 +0200 Subject: [PATCH] dio, introduce qd as an alias for diode charge to get the right unit in plotting --- examples/various/diode_ac_par.sp | 4 ++-- src/include/ngspice/devdefs.h | 1 + src/spicelib/devices/dio/dio.c | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/various/diode_ac_par.sp b/examples/various/diode_ac_par.sp index bd13435a6..b2d536318 100644 --- a/examples/various/diode_ac_par.sp +++ b/examples/various/diode_ac_par.sp @@ -18,11 +18,11 @@ d1 1 0 myd + IBV = 10u) .control -save @d1[gd] @d1[cd] @d1[charge] +save @d1[gd] @d1[cd] @d1[qd] dc v1 -5 .1 0.01 plot @d1[gd] plot @d1[cd] -plot @d1[charge] +plot @d1[qd] .endc * .END diff --git a/src/include/ngspice/devdefs.h b/src/include/ngspice/devdefs.h index 0c7829ae9..be1724da1 100644 --- a/src/include/ngspice/devdefs.h +++ b/src/include/ngspice/devdefs.h @@ -174,6 +174,7 @@ extern int DEVmaxnum; /* size of DEVices array */ # define IPR(a,b,c,d) { a , b , c|IF_SET|IF_REDUNDANT , d } # define OP(a,b,c,d) { a , b , c|IF_ASK , d } # define OPU(a,b,c,d) { a , b , c|IF_ASK|IF_UNINTERESTING , d } +# define OPUR(a,b,c,d) { a , b , c|IF_ASK|IF_UNINTERESTING|IF_REDUNDANT , d } # define OPR(a,b,c,d) { a , b , c|IF_ASK|IF_REDUNDANT , d } # define P(a,b,c,d) { a , b , c , d } diff --git a/src/spicelib/devices/dio/dio.c b/src/spicelib/devices/dio/dio.c index fc869995c..af82ce9b6 100644 --- a/src/spicelib/devices/dio/dio.c +++ b/src/spicelib/devices/dio/dio.c @@ -27,6 +27,7 @@ IFparm DIOpTable[] = { /* parameters */ OP("gd", DIO_CONDUCT,IF_REAL, "Diode conductance"), OP("cd", DIO_CAP, IF_REAL, "Diode capacitance"), OPU("charge", DIO_CHARGE, IF_REAL, "Diode capacitor charge"), + OPUR("qd", DIO_CHARGE, IF_REAL, "Diode capacitor charge"), OPU("capcur", DIO_CAPCUR, IF_REAL, "Diode capacitor current"), OPU("p", DIO_POWER, IF_REAL, "Diode power"), OPU("sens_dc",DIO_QUEST_SENS_DC, IF_REAL, "dc sensitivity "),