From d763b39ec36053fe58e75431c0385bf80cf5ea1b Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Thu, 24 Nov 2022 14:43:16 +0100 Subject: [PATCH 1/3] Add a new compatibility mode xs (for XSPICE) --- src/frontend/inpcom.c | 9 +++++++-- src/include/ngspice/compatmode.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 7b6ad0f89..64acd47b3 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -773,7 +773,7 @@ char *find_back_assignment(const char *p, const char *start) /* Set a compatibility flag. Currently available are flags for: -- LTSPICE, HSPICE, Spice3, PSPICE, KiCad, Spectre +- LTSPICE, HSPICE, Spice3, PSPICE, KiCad, Spectre, XSPICE */ struct compat newcompat; static void set_compat_mode(void) @@ -781,6 +781,7 @@ static void set_compat_mode(void) char behaviour[80]; newcompat.hs = FALSE; newcompat.ps = FALSE; + newcompat.xs = FALSE; newcompat.lt = FALSE; newcompat.ki = FALSE; newcompat.a = FALSE; @@ -793,6 +794,8 @@ static void set_compat_mode(void) newcompat.isset = newcompat.hs = TRUE; /*HSPICE*/ if (strstr(behaviour, "ps")) newcompat.isset = newcompat.ps = TRUE; /*PSPICE*/ + if (strstr(behaviour, "xs")) + newcompat.isset = newcompat.xs = TRUE; /*XSPICE*/ if (strstr(behaviour, "lt")) newcompat.isset = newcompat.lt = TRUE; /*LTSPICE*/ if (strstr(behaviour, "ki")) @@ -820,7 +823,7 @@ static void set_compat_mode(void) } /* reset everything for 'make check' */ if (newcompat.mc) - newcompat.eg = newcompat.hs = newcompat.spe = newcompat.ps = + newcompat.eg = newcompat.hs = newcompat.spe = newcompat.ps = newcompat.xs = newcompat.ll = newcompat.lt = newcompat.ki = newcompat.a = FALSE; } @@ -835,6 +838,8 @@ static void print_compat_mode(void) { fprintf(stdout, " hs"); if (newcompat.ps) fprintf(stdout, " ps"); + if (newcompat.xs) + fprintf(stdout, " xs"); if (newcompat.lt) fprintf(stdout, " lt"); if (newcompat.ki) diff --git a/src/include/ngspice/compatmode.h b/src/include/ngspice/compatmode.h index 5cbc26af5..1355a74ed 100644 --- a/src/include/ngspice/compatmode.h +++ b/src/include/ngspice/compatmode.h @@ -16,6 +16,7 @@ struct compat bool spe; /* spectre */ bool eg; /* EAGLE */ bool mc; /* to be set for 'make check' */ + bool xs; /* XSPICE */ }; extern struct compat newcompat; From f7c038466b5065c35a39b9756ae204f0e6c3eaac Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Thu, 24 Nov 2022 14:46:54 +0100 Subject: [PATCH 2/3] The 8th parameter on a voltage or current source now is 'number of pulses'. Previous usage had been PHASE, introduced by XSPICE, which has been redundant to DELAY. PHASE is again available when compatibility flag xs has been set. --- src/spicelib/devices/isrc/isrcacct.c | 119 ++++++++++++++++----------- src/spicelib/devices/isrc/isrcload.c | 57 ++++++++----- src/spicelib/devices/vsrc/vsrcacct.c | 119 ++++++++++++++++----------- src/spicelib/devices/vsrc/vsrcload.c | 57 ++++++++----- 4 files changed, 212 insertions(+), 140 deletions(-) diff --git a/src/spicelib/devices/isrc/isrcacct.c b/src/spicelib/devices/isrc/isrcacct.c index dc87c6e77..b71987f30 100644 --- a/src/spicelib/devices/isrc/isrcacct.c +++ b/src/spicelib/devices/isrc/isrcacct.c @@ -11,6 +11,7 @@ Author: 1985 Thomas L. Quarles #include "ngspice/suffix.h" #include "ngspice/missing_math.h" #include "ngspice/1-f-code.h" +#include "ngspice/compatmode.h" #ifndef HAVE_LIBFFTW3 extern void fftFree(void); @@ -56,6 +57,7 @@ ISRCaccept(CKTcircuit *ckt, GENmodel *inModel) double PHASE; double phase; double deltat; + double tmax = 1e99; TD = here->ISRCfunctionOrder > 2 ? here->ISRCcoeffs[2] : 0.0; @@ -78,60 +80,79 @@ ISRCaccept(CKTcircuit *ckt, GENmodel *inModel) time = ckt->CKTtime - TD; tshift = TD; - /* normalize phase to 0 - 360° */ - /* normalize phase to cycles */ - phase = PHASE / 360.0; - phase = fmod(phase, 1.0); - deltat = phase * PER; - while (deltat > 0) - deltat -= PER; - time += deltat; - tshift = TD - deltat; - - if(time >= PER) { - /* repeating signal - figure out where we are */ - /* in period */ - basetime = PER * floor(time/PER); - time -= basetime; + if (newcompat.xs) { + /* normalize phase to 0 - 360° */ + /* normalize phase to cycles */ + phase = PHASE / 360.0; + phase = fmod(phase, 1.0); + deltat = phase * PER; + while (deltat > 0) + deltat -= PER; + time += deltat; + tshift = TD - deltat; + } + else if (PHASE > 0.0) { + tmax = PHASE * PER; } - if( time <= 0.0 || time >= TR + PW + TF) { - if(ckt->CKTbreak && SAMETIME(time,0.0)) { - error = CKTsetBreak(ckt,basetime + TR + tshift); - if(error) return(error); - } else if(ckt->CKTbreak && SAMETIME(TR+PW+TF,time) ) { - error = CKTsetBreak(ckt,basetime + PER + tshift); - if(error) return(error); - } else if (ckt->CKTbreak && (time == -tshift) ) { - error = CKTsetBreak(ckt,basetime + tshift); - if(error) return(error); - } else if (ckt->CKTbreak && SAMETIME(PER,time) ) { - error = CKTsetBreak(ckt,basetime + tshift + TR + PER); - if(error) return(error); + if (!newcompat.xs && time > tmax) { + /* Do nothing */ + } + else { + if (time >= PER) { + /* repeating signal - figure out where we are */ + /* in period */ + basetime = PER * floor(time / PER); + time -= basetime; } - } else if ( time >= TR && time <= TR + PW) { - if(ckt->CKTbreak && SAMETIME(time,TR) ) { - error = CKTsetBreak(ckt,basetime + tshift + TR + PW); - if(error) return(error); - } else if(ckt->CKTbreak && SAMETIME(TR+PW,time) ) { - error = CKTsetBreak(ckt,basetime + tshift + TR + PW + TF); - if(error) return(error); + + if (time <= 0.0 || time >= TR + PW + TF) { + if (ckt->CKTbreak && SAMETIME(time, 0.0)) { + error = CKTsetBreak(ckt, basetime + TR + tshift); + if (error) return(error); + } + else if (ckt->CKTbreak && SAMETIME(TR + PW + TF, time)) { + error = CKTsetBreak(ckt, basetime + PER + tshift); + if (error) return(error); + } + else if (ckt->CKTbreak && (time == -tshift)) { + error = CKTsetBreak(ckt, basetime + tshift); + if (error) return(error); + } + else if (ckt->CKTbreak && SAMETIME(PER, time)) { + error = CKTsetBreak(ckt, basetime + tshift + TR + PER); + if (error) return(error); + } } - } else if (time > 0 && time < TR) { - if(ckt->CKTbreak && SAMETIME(time,0) ) { - error = CKTsetBreak(ckt,basetime + tshift + TR); - if(error) return(error); - } else if(ckt->CKTbreak && SAMETIME(time,TR)) { - error = CKTsetBreak(ckt,basetime + tshift + TR + PW); - if(error) return(error); + else if (time >= TR && time <= TR + PW) { + if (ckt->CKTbreak && SAMETIME(time, TR)) { + error = CKTsetBreak(ckt, basetime + tshift + TR + PW); + if (error) return(error); + } + else if (ckt->CKTbreak && SAMETIME(TR + PW, time)) { + error = CKTsetBreak(ckt, basetime + tshift + TR + PW + TF); + if (error) return(error); + } } - } else { /* time > TR + PW && < TR + PW + TF */ - if(ckt->CKTbreak && SAMETIME(time,TR+PW) ) { - error = CKTsetBreak(ckt,basetime + tshift+TR + PW +TF); - if(error) return(error); - } else if(ckt->CKTbreak && SAMETIME(time,TR+PW+TF) ) { - error = CKTsetBreak(ckt,basetime + tshift + PER); - if(error) return(error); + else if (time > 0 && time < TR) { + if (ckt->CKTbreak && SAMETIME(time, 0)) { + error = CKTsetBreak(ckt, basetime + tshift + TR); + if (error) return(error); + } + else if (ckt->CKTbreak && SAMETIME(time, TR)) { + error = CKTsetBreak(ckt, basetime + tshift + TR + PW); + if (error) return(error); + } + } + else { /* time > TR + PW && < TR + PW + TF */ + if (ckt->CKTbreak && SAMETIME(time, TR + PW)) { + error = CKTsetBreak(ckt, basetime + tshift + TR + PW + TF); + if (error) return(error); + } + else if (ckt->CKTbreak && SAMETIME(time, TR + PW + TF)) { + error = CKTsetBreak(ckt, basetime + tshift + PER); + if (error) return(error); + } } } } diff --git a/src/spicelib/devices/isrc/isrcload.c b/src/spicelib/devices/isrc/isrcload.c index fd86d1ce7..f947686c9 100644 --- a/src/spicelib/devices/isrc/isrcload.c +++ b/src/spicelib/devices/isrc/isrcload.c @@ -11,6 +11,7 @@ Modified: 2000 Alansfixes #include "ngspice/sperror.h" #include "ngspice/suffix.h" #include "ngspice/1-f-code.h" +#include "ngspice/compatmode.h" #ifdef XSPICE_EXP /* gtri - begin - wbk - modify for supply ramping option */ @@ -75,6 +76,7 @@ ISRCload(GENmodel *inModel, CKTcircuit *ckt) double PHASE; double phase; double deltat; + double tmax = 1e99; V1 = here->ISRCcoeffs[0]; V2 = here->ISRCcoeffs[1]; @@ -99,29 +101,42 @@ ISRCload(GENmodel *inModel, CKTcircuit *ckt) PHASE = here->ISRCfunctionOrder > 7 ? here->ISRCcoeffs[7] : 0.0; - /* normalize phase to cycles */ - phase = PHASE / 360.0; - phase = fmod(phase, 1.0); - deltat = phase * PER; - while (deltat > 0) - deltat -= PER; - /* shift time by pase (neg. for pos. phase value) */ - time += deltat; - - if(time > PER) { - /* repeating signal - figure out where we are */ - /* in period */ - basetime = PER * floor(time/PER); - time -= basetime; + if (newcompat.xs) { /* 7th parameter is PHASE */ + /* normalize phase to cycles */ + phase = PHASE / 360.0; + phase = fmod(phase, 1.0); + deltat = phase * PER; + while (deltat > 0) + deltat -= PER; + /* shift time by pase (neg. for pos. phase value) */ + time += deltat; } - if (time <= 0 || time >= TR + PW + TF) { + else if (PHASE > 0.0) { /* 7th parameter is number of pulses */ + tmax = PHASE * PER; + } + + if (!newcompat.xs && time > tmax) { value = V1; - } else if (time >= TR && time <= TR + PW) { - value = V2; - } else if (time > 0 && time < TR) { - value = V1 + (V2 - V1) * (time) / TR; - } else { /* time > TR + PW && < TR + PW + TF */ - value = V2 + (V1 - V2) * (time - (TR + PW)) / TF; + } + else { + if (time > PER) { + /* repeating signal - figure out where we are */ + /* in period */ + basetime = PER * floor(time / PER); + time -= basetime; + } + if (time <= 0 || time >= TR + PW + TF) { + value = V1; + } + else if (time >= TR && time <= TR + PW) { + value = V2; + } + else if (time > 0 && time < TR) { + value = V1 + (V2 - V1) * (time) / TR; + } + else { /* time > TR + PW && < TR + PW + TF */ + value = V2 + (V1 - V2) * (time - (TR + PW)) / TF; + } } } break; diff --git a/src/spicelib/devices/vsrc/vsrcacct.c b/src/spicelib/devices/vsrc/vsrcacct.c index 85ad3e3fd..1ec386681 100644 --- a/src/spicelib/devices/vsrc/vsrcacct.c +++ b/src/spicelib/devices/vsrc/vsrcacct.c @@ -11,6 +11,7 @@ Author: 1985 Thomas L. Quarles #include "ngspice/suffix.h" #include "ngspice/missing_math.h" #include "ngspice/1-f-code.h" +#include "ngspice/compatmode.h" #ifndef HAVE_LIBFFTW3 extern void fftFree(void); @@ -53,6 +54,7 @@ VSRCaccept(CKTcircuit *ckt, GENmodel *inModel) double tshift; double time = 0.; double basetime = 0; + double tmax = 1e99; double PHASE; double phase; @@ -79,60 +81,79 @@ VSRCaccept(CKTcircuit *ckt, GENmodel *inModel) time = ckt->CKTtime - TD; tshift = TD; - /* normalize phase to 0 - 360° */ - /* normalize phase to cycles */ - phase = PHASE / 360.0; - phase = fmod(phase, 1.0); - deltat = phase * PER; - while (deltat > 0) - deltat -= PER; - time += deltat; - tshift = TD - deltat; - - if(time >= PER) { - /* repeating signal - figure out where we are */ - /* in period */ - basetime = PER * floor(time/PER); - time -= basetime; + if (newcompat.xs) { + /* normalize phase to 0 - 360° */ + /* normalize phase to cycles */ + phase = PHASE / 360.0; + phase = fmod(phase, 1.0); + deltat = phase * PER; + while (deltat > 0) + deltat -= PER; + time += deltat; + tshift = TD - deltat; + } + else if (PHASE > 0.0) { + tmax = PHASE * PER; } - if( time <= 0.0 || time >= TR + PW + TF) { - if(ckt->CKTbreak && SAMETIME(time,0.0)) { - error = CKTsetBreak(ckt,basetime + TR + tshift); - if(error) return(error); - } else if(ckt->CKTbreak && SAMETIME(TR+PW+TF,time) ) { - error = CKTsetBreak(ckt,basetime + PER + tshift); - if(error) return(error); - } else if (ckt->CKTbreak && (time == -tshift) ) { - error = CKTsetBreak(ckt,basetime + tshift); - if(error) return(error); - } else if (ckt->CKTbreak && SAMETIME(PER,time) ) { - error = CKTsetBreak(ckt,basetime + tshift + TR + PER); - if(error) return(error); + if (!newcompat.xs && time > tmax) { + /* Do nothing */ + } + else { + if (time >= PER) { + /* repeating signal - figure out where we are */ + /* in period */ + basetime = PER * floor(time / PER); + time -= basetime; } - } else if ( time >= TR && time <= TR + PW) { - if(ckt->CKTbreak && SAMETIME(time,TR) ) { - error = CKTsetBreak(ckt,basetime + tshift + TR + PW); - if(error) return(error); - } else if(ckt->CKTbreak && SAMETIME(TR+PW,time) ) { - error = CKTsetBreak(ckt,basetime + tshift + TR + PW + TF); - if(error) return(error); + + if (time <= 0.0 || time >= TR + PW + TF) { + if (ckt->CKTbreak && SAMETIME(time, 0.0)) { + error = CKTsetBreak(ckt, basetime + TR + tshift); + if (error) return(error); + } + else if (ckt->CKTbreak && SAMETIME(TR + PW + TF, time)) { + error = CKTsetBreak(ckt, basetime + PER + tshift); + if (error) return(error); + } + else if (ckt->CKTbreak && (time == -tshift)) { + error = CKTsetBreak(ckt, basetime + tshift); + if (error) return(error); + } + else if (ckt->CKTbreak && SAMETIME(PER, time)) { + error = CKTsetBreak(ckt, basetime + tshift + TR + PER); + if (error) return(error); + } } - } else if (time > 0 && time < TR) { - if(ckt->CKTbreak && SAMETIME(time,0) ) { - error = CKTsetBreak(ckt,basetime + tshift + TR); - if(error) return(error); - } else if(ckt->CKTbreak && SAMETIME(time,TR)) { - error = CKTsetBreak(ckt,basetime + tshift + TR + PW); - if(error) return(error); + else if (time >= TR && time <= TR + PW) { + if (ckt->CKTbreak && SAMETIME(time, TR)) { + error = CKTsetBreak(ckt, basetime + tshift + TR + PW); + if (error) return(error); + } + else if (ckt->CKTbreak && SAMETIME(TR + PW, time)) { + error = CKTsetBreak(ckt, basetime + tshift + TR + PW + TF); + if (error) return(error); + } } - } else { /* time > TR + PW && < TR + PW + TF */ - if(ckt->CKTbreak && SAMETIME(time,TR+PW) ) { - error = CKTsetBreak(ckt,basetime + tshift+TR + PW +TF); - if(error) return(error); - } else if(ckt->CKTbreak && SAMETIME(time,TR+PW+TF) ) { - error = CKTsetBreak(ckt,basetime + tshift + PER); - if(error) return(error); + else if (time > 0 && time < TR) { + if (ckt->CKTbreak && SAMETIME(time, 0)) { + error = CKTsetBreak(ckt, basetime + tshift + TR); + if (error) return(error); + } + else if (ckt->CKTbreak && SAMETIME(time, TR)) { + error = CKTsetBreak(ckt, basetime + tshift + TR + PW); + if (error) return(error); + } + } + else { /* time > TR + PW && < TR + PW + TF */ + if (ckt->CKTbreak && SAMETIME(time, TR + PW)) { + error = CKTsetBreak(ckt, basetime + tshift + TR + PW + TF); + if (error) return(error); + } + else if (ckt->CKTbreak && SAMETIME(time, TR + PW + TF)) { + error = CKTsetBreak(ckt, basetime + tshift + PER); + if (error) return(error); + } } } } diff --git a/src/spicelib/devices/vsrc/vsrcload.c b/src/spicelib/devices/vsrc/vsrcload.c index 96422b5f2..beee1c99c 100644 --- a/src/spicelib/devices/vsrc/vsrcload.c +++ b/src/spicelib/devices/vsrc/vsrcload.c @@ -11,6 +11,7 @@ Modified: 2000 AlansFixes #include "ngspice/sperror.h" #include "ngspice/suffix.h" #include "ngspice/1-f-code.h" +#include "ngspice/compatmode.h" #ifdef XSPICE_EXP /* gtri - begin - wbk - modify for supply ramping option */ @@ -98,6 +99,7 @@ VSRCload(GENmodel *inModel, CKTcircuit *ckt) double PHASE; double phase; double deltat; + double tmax = 1e99; V1 = here->VSRCcoeffs[0]; V2 = here->VSRCcoeffs[1]; @@ -122,29 +124,42 @@ VSRCload(GENmodel *inModel, CKTcircuit *ckt) PHASE = here->VSRCfunctionOrder > 7 ? here->VSRCcoeffs[7] : 0.0; - /* normalize phase to cycles */ - phase = PHASE / 360.0; - phase = fmod(phase, 1.0); - deltat = phase * PER; - while (deltat > 0) - deltat -= PER; - /* shift time by pase (neg. for pos. phase value) */ - time += deltat; - - if(time > PER) { - /* repeating signal - figure out where we are */ - /* in period */ - basetime = PER * floor(time/PER); - time -= basetime; + if (newcompat.xs) { /* 7th parameter is PHASE */ + /* normalize phase to cycles */ + phase = PHASE / 360.0; + phase = fmod(phase, 1.0); + deltat = phase * PER; + while (deltat > 0) + deltat -= PER; + /* shift time by pase (neg. for pos. phase value) */ + time += deltat; } - if (time <= 0 || time >= TR + PW + TF) { + else if (PHASE > 0.0) { /* 7th parameter is number of pulses */ + tmax = PHASE * PER; + } + + if (!newcompat.xs && time > tmax) { value = V1; - } else if (time >= TR && time <= TR + PW) { - value = V2; - } else if (time > 0 && time < TR) { - value = V1 + (V2 - V1) * (time) / TR; - } else { /* time > TR + PW && < TR + PW + TF */ - value = V2 + (V1 - V2) * (time - (TR + PW)) / TF; + } + else { + if (time > PER) { + /* repeating signal - figure out where we are */ + /* in period */ + basetime = PER * floor(time / PER); + time -= basetime; + } + if (time <= 0 || time >= TR + PW + TF) { + value = V1; + } + else if (time >= TR && time <= TR + PW) { + value = V2; + } + else if (time > 0 && time < TR) { + value = V1 + (V2 - V1) * (time) / TR; + } + else { /* time > TR + PW && < TR + PW + TF */ + value = V2 + (V1 - V2) * (time - (TR + PW)) / TF; + } } } break; From 9fbf2acceb41103cf8af6f8416e0ad88da1b273b Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Thu, 24 Nov 2022 16:47:59 +0100 Subject: [PATCH 3/3] Move digital examples to new locations --- examples/digital/{ => compare}/74HCng_short_2.lib | 0 examples/digital/{ => compare}/adder-comparison.txt | 0 examples/digital/{ => compare}/adder_Xspice.cir | 0 examples/digital/{ => compare}/adder_behav.cir | 0 examples/digital/{ => compare}/adder_bip.cir | 0 examples/digital/{ => compare}/adder_common.inc | 0 examples/digital/{ => compare}/adder_mos.cir | 0 examples/digital/{ => compare}/nggtk.tcl | 0 .../{p-to-n-examples => digital/digital_devices}/behav-283-1.cir | 0 .../{p-to-n-examples => digital/digital_devices}/behav-283-1.stim | 0 .../{p-to-n-examples => digital/digital_devices}/behav-283.cir | 0 .../digital_devices}/behav-tristate-pulse.cir | 0 .../digital_devices}/behav-tristate-pulse.stim | 0 .../digital_devices}/behav-tristate.cir | 0 .../digital_devices}/behav-tristate.stim | 0 examples/{p-to-n-examples => digital/digital_devices}/counter.cir | 0 examples/{p-to-n-examples => digital/digital_devices}/decoder.cir | 0 .../{p-to-n-examples => digital/digital_devices}/decoder.stim | 0 examples/{p-to-n-examples => digital/digital_devices}/ex283.cir | 0 examples/{p-to-n-examples => digital/digital_devices}/ex283.stim | 0 examples/{p-to-n-examples => digital/digital_devices}/ex4.cir | 0 examples/{p-to-n-examples => digital/digital_devices}/ex4.stim | 0 examples/{p-to-n-examples => digital/digital_devices}/ex5.cir | 0 examples/{p-to-n-examples => digital/digital_devices}/ex5.stim | 0 examples/{p-to-n-examples => digital/digital_devices}/nggtk.tcl | 0 .../{p-to-n-examples => digital/digital_devices}/xspice_c4.cir | 0 26 files changed, 0 insertions(+), 0 deletions(-) rename examples/digital/{ => compare}/74HCng_short_2.lib (100%) rename examples/digital/{ => compare}/adder-comparison.txt (100%) rename examples/digital/{ => compare}/adder_Xspice.cir (100%) rename examples/digital/{ => compare}/adder_behav.cir (100%) rename examples/digital/{ => compare}/adder_bip.cir (100%) rename examples/digital/{ => compare}/adder_common.inc (100%) rename examples/digital/{ => compare}/adder_mos.cir (100%) rename examples/digital/{ => compare}/nggtk.tcl (100%) rename examples/{p-to-n-examples => digital/digital_devices}/behav-283-1.cir (100%) rename examples/{p-to-n-examples => digital/digital_devices}/behav-283-1.stim (100%) rename examples/{p-to-n-examples => digital/digital_devices}/behav-283.cir (100%) rename examples/{p-to-n-examples => digital/digital_devices}/behav-tristate-pulse.cir (100%) rename examples/{p-to-n-examples => digital/digital_devices}/behav-tristate-pulse.stim (100%) rename examples/{p-to-n-examples => digital/digital_devices}/behav-tristate.cir (100%) rename examples/{p-to-n-examples => digital/digital_devices}/behav-tristate.stim (100%) rename examples/{p-to-n-examples => digital/digital_devices}/counter.cir (100%) rename examples/{p-to-n-examples => digital/digital_devices}/decoder.cir (100%) rename examples/{p-to-n-examples => digital/digital_devices}/decoder.stim (100%) rename examples/{p-to-n-examples => digital/digital_devices}/ex283.cir (100%) rename examples/{p-to-n-examples => digital/digital_devices}/ex283.stim (100%) rename examples/{p-to-n-examples => digital/digital_devices}/ex4.cir (100%) rename examples/{p-to-n-examples => digital/digital_devices}/ex4.stim (100%) rename examples/{p-to-n-examples => digital/digital_devices}/ex5.cir (100%) rename examples/{p-to-n-examples => digital/digital_devices}/ex5.stim (100%) rename examples/{p-to-n-examples => digital/digital_devices}/nggtk.tcl (100%) rename examples/{p-to-n-examples => digital/digital_devices}/xspice_c4.cir (100%) diff --git a/examples/digital/74HCng_short_2.lib b/examples/digital/compare/74HCng_short_2.lib similarity index 100% rename from examples/digital/74HCng_short_2.lib rename to examples/digital/compare/74HCng_short_2.lib diff --git a/examples/digital/adder-comparison.txt b/examples/digital/compare/adder-comparison.txt similarity index 100% rename from examples/digital/adder-comparison.txt rename to examples/digital/compare/adder-comparison.txt diff --git a/examples/digital/adder_Xspice.cir b/examples/digital/compare/adder_Xspice.cir similarity index 100% rename from examples/digital/adder_Xspice.cir rename to examples/digital/compare/adder_Xspice.cir diff --git a/examples/digital/adder_behav.cir b/examples/digital/compare/adder_behav.cir similarity index 100% rename from examples/digital/adder_behav.cir rename to examples/digital/compare/adder_behav.cir diff --git a/examples/digital/adder_bip.cir b/examples/digital/compare/adder_bip.cir similarity index 100% rename from examples/digital/adder_bip.cir rename to examples/digital/compare/adder_bip.cir diff --git a/examples/digital/adder_common.inc b/examples/digital/compare/adder_common.inc similarity index 100% rename from examples/digital/adder_common.inc rename to examples/digital/compare/adder_common.inc diff --git a/examples/digital/adder_mos.cir b/examples/digital/compare/adder_mos.cir similarity index 100% rename from examples/digital/adder_mos.cir rename to examples/digital/compare/adder_mos.cir diff --git a/examples/digital/nggtk.tcl b/examples/digital/compare/nggtk.tcl similarity index 100% rename from examples/digital/nggtk.tcl rename to examples/digital/compare/nggtk.tcl diff --git a/examples/p-to-n-examples/behav-283-1.cir b/examples/digital/digital_devices/behav-283-1.cir similarity index 100% rename from examples/p-to-n-examples/behav-283-1.cir rename to examples/digital/digital_devices/behav-283-1.cir diff --git a/examples/p-to-n-examples/behav-283-1.stim b/examples/digital/digital_devices/behav-283-1.stim similarity index 100% rename from examples/p-to-n-examples/behav-283-1.stim rename to examples/digital/digital_devices/behav-283-1.stim diff --git a/examples/p-to-n-examples/behav-283.cir b/examples/digital/digital_devices/behav-283.cir similarity index 100% rename from examples/p-to-n-examples/behav-283.cir rename to examples/digital/digital_devices/behav-283.cir diff --git a/examples/p-to-n-examples/behav-tristate-pulse.cir b/examples/digital/digital_devices/behav-tristate-pulse.cir similarity index 100% rename from examples/p-to-n-examples/behav-tristate-pulse.cir rename to examples/digital/digital_devices/behav-tristate-pulse.cir diff --git a/examples/p-to-n-examples/behav-tristate-pulse.stim b/examples/digital/digital_devices/behav-tristate-pulse.stim similarity index 100% rename from examples/p-to-n-examples/behav-tristate-pulse.stim rename to examples/digital/digital_devices/behav-tristate-pulse.stim diff --git a/examples/p-to-n-examples/behav-tristate.cir b/examples/digital/digital_devices/behav-tristate.cir similarity index 100% rename from examples/p-to-n-examples/behav-tristate.cir rename to examples/digital/digital_devices/behav-tristate.cir diff --git a/examples/p-to-n-examples/behav-tristate.stim b/examples/digital/digital_devices/behav-tristate.stim similarity index 100% rename from examples/p-to-n-examples/behav-tristate.stim rename to examples/digital/digital_devices/behav-tristate.stim diff --git a/examples/p-to-n-examples/counter.cir b/examples/digital/digital_devices/counter.cir similarity index 100% rename from examples/p-to-n-examples/counter.cir rename to examples/digital/digital_devices/counter.cir diff --git a/examples/p-to-n-examples/decoder.cir b/examples/digital/digital_devices/decoder.cir similarity index 100% rename from examples/p-to-n-examples/decoder.cir rename to examples/digital/digital_devices/decoder.cir diff --git a/examples/p-to-n-examples/decoder.stim b/examples/digital/digital_devices/decoder.stim similarity index 100% rename from examples/p-to-n-examples/decoder.stim rename to examples/digital/digital_devices/decoder.stim diff --git a/examples/p-to-n-examples/ex283.cir b/examples/digital/digital_devices/ex283.cir similarity index 100% rename from examples/p-to-n-examples/ex283.cir rename to examples/digital/digital_devices/ex283.cir diff --git a/examples/p-to-n-examples/ex283.stim b/examples/digital/digital_devices/ex283.stim similarity index 100% rename from examples/p-to-n-examples/ex283.stim rename to examples/digital/digital_devices/ex283.stim diff --git a/examples/p-to-n-examples/ex4.cir b/examples/digital/digital_devices/ex4.cir similarity index 100% rename from examples/p-to-n-examples/ex4.cir rename to examples/digital/digital_devices/ex4.cir diff --git a/examples/p-to-n-examples/ex4.stim b/examples/digital/digital_devices/ex4.stim similarity index 100% rename from examples/p-to-n-examples/ex4.stim rename to examples/digital/digital_devices/ex4.stim diff --git a/examples/p-to-n-examples/ex5.cir b/examples/digital/digital_devices/ex5.cir similarity index 100% rename from examples/p-to-n-examples/ex5.cir rename to examples/digital/digital_devices/ex5.cir diff --git a/examples/p-to-n-examples/ex5.stim b/examples/digital/digital_devices/ex5.stim similarity index 100% rename from examples/p-to-n-examples/ex5.stim rename to examples/digital/digital_devices/ex5.stim diff --git a/examples/p-to-n-examples/nggtk.tcl b/examples/digital/digital_devices/nggtk.tcl similarity index 100% rename from examples/p-to-n-examples/nggtk.tcl rename to examples/digital/digital_devices/nggtk.tcl diff --git a/examples/p-to-n-examples/xspice_c4.cir b/examples/digital/digital_devices/xspice_c4.cir similarity index 100% rename from examples/p-to-n-examples/xspice_c4.cir rename to examples/digital/digital_devices/xspice_c4.cir