Error message and exit if a vdmos device instance

has different source and bulk node (have to be the same).
This commit is contained in:
Holger Vogt 2018-04-11 11:14:04 +02:00 committed by rlar
parent b13675ea44
commit c5f47d3c1b
1 changed files with 10 additions and 0 deletions

View File

@ -98,6 +98,16 @@ VDMOSsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt,
for (here = VDMOSinstances(model); here != NULL;
here = VDMOSnextInstance(here)) {
/* Check if source and bulk nodes are the same.
* The power MOS devices in fact are 3-terminal devices,
* but the actual device input still uses 4 terminals to be compatible.
*/
if (here->VDMOSbNode != here->VDMOSsNode) {
fprintf(stderr, "\nError: source and bulk nodes of device %s have to be the same!\n",
here->VDMOSname);
controlled_exit(1);
}
/* allocate a chunk of the state vector */
here->VDMOSstates = *states;
*states += VDMOSnumStates;