Browse Source
Moved the KLU binding structures to be property of the XSPICE connections, instead of XSPICE instances
pre-master-46
Moved the KLU binding structures to be property of the XSPICE connections, instead of XSPICE instances
pre-master-46
committed by
Holger Vogt
4 changed files with 143 additions and 84 deletions
-
110src/include/ngspice/klu-binding.h
-
38src/include/ngspice/mifcmdat.h
-
25src/include/ngspice/mifdefs.h
-
54src/xspice/mif/mifbindCSC.c
@ -1,54 +1,102 @@ |
|||
#ifndef _KLU_BINDING_H |
|||
#define _KLU_BINDING_H |
|||
|
|||
#define CREATE_KLU_BINDING_TABLE(ptr, binding, a, b) \ |
|||
if ((here->a != 0) && (here->b != 0)) { \ |
|||
i = here->ptr ; \ |
|||
#define CREATE_KLU_BINDING_TABLE(ptr, binding, a, b) \ |
|||
if ((here->a != 0) && (here->b != 0)) { \ |
|||
i = here->ptr ; \ |
|||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; \ |
|||
here->binding = matched ; \ |
|||
here->ptr = matched->CSC ; \ |
|||
here->binding = matched ; \ |
|||
here->ptr = matched->CSC ; \ |
|||
} |
|||
|
|||
#define CONVERT_KLU_BINDING_TABLE_TO_COMPLEX(ptr, binding, a, b) \ |
|||
if ((here->a != 0) && (here->b != 0)) \ |
|||
#define CONVERT_KLU_BINDING_TABLE_TO_COMPLEX(ptr, binding, a, b) \ |
|||
if ((here->a != 0) && (here->b != 0)) \ |
|||
here->ptr = here->binding->CSC_Complex ; |
|||
|
|||
#define CONVERT_KLU_BINDING_TABLE_TO_REAL(ptr, binding, a, b) \ |
|||
if ((here->a != 0) && (here->b != 0)) \ |
|||
#define CONVERT_KLU_BINDING_TABLE_TO_REAL(ptr, binding, a, b) \ |
|||
if ((here->a != 0) && (here->b != 0)) \ |
|||
here->ptr = here->binding->CSC ; |
|||
|
|||
#ifdef XSPICE |
|||
#define CREATE_KLU_BINDING_TABLE_XSPICE_OUTPUTS(ptr, binding, a, b) \ |
|||
if ((smp_data_out->a != 0) && (smp_data_out->b != 0)) { \ |
|||
i = smp_data_out->ptr ; \ |
|||
#define CREATE_KLU_BINDING_TABLE_XSPICE_OUTPUTS(ptr, binding, a, b) \ |
|||
if ((smp_data_out->a != 0) && (smp_data_out->b != 0)) { \ |
|||
i = smp_data_out->ptr ; \ |
|||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; \ |
|||
here->binding = matched ; \ |
|||
smp_data_out->ptr = matched->CSC ; \ |
|||
smp_data_out->binding = matched ; \ |
|||
smp_data_out->ptr = matched->CSC ; \ |
|||
} |
|||
|
|||
#define CONVERT_KLU_BINDING_TABLE_TO_COMPLEX_XSPICE_OUTPUTS(ptr, binding, a, b) \ |
|||
if ((smp_data_out->a != 0) && (smp_data_out->b != 0)) \ |
|||
smp_data_out->ptr = here->binding->CSC_Complex ; |
|||
#define CONVERT_KLU_BINDING_TABLE_TO_COMPLEX_XSPICE_OUTPUTS(ptr, binding, a, b) \ |
|||
if ((smp_data_out->a != 0) && (smp_data_out->b != 0)) \ |
|||
smp_data_out->ptr = smp_data_out->binding->CSC_Complex ; |
|||
|
|||
#define CONVERT_KLU_BINDING_TABLE_TO_REAL_XSPICE_OUTPUTS(ptr, binding, a, b) \ |
|||
if ((smp_data_out->a != 0) && (smp_data_out->b != 0)) \ |
|||
smp_data_out->ptr = here->binding->CSC ; |
|||
#define CONVERT_KLU_BINDING_TABLE_TO_REAL_XSPICE_OUTPUTS(ptr, binding, a, b) \ |
|||
if ((smp_data_out->a != 0) && (smp_data_out->b != 0)) \ |
|||
smp_data_out->ptr = smp_data_out->binding->CSC ; |
|||
|
|||
#define CREATE_KLU_BINDING_TABLE_XSPICE_INPUTS(ptr, binding, a, b) \ |
|||
if ((smp_data_out->a != 0) && (smp_data_cntl->b != 0)) { \ |
|||
i = smp_data_out->input[k].port[l].ptr ; \ |
|||
#define CREATE_KLU_BINDING_TABLE_XSPICE_INPUTS_E(ptr, binding, a, b) \ |
|||
if ((smp_data_out->a != 0) && (smp_data_cntl->b != 0)) { \ |
|||
i = smp_data_out->input[k].port[l].ptr ; \ |
|||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; \ |
|||
here->binding = matched ; \ |
|||
smp_data_out->input[k].port[l].ptr = matched->CSC ; \ |
|||
smp_data_out->input[k].port[l].e.binding = matched ; \ |
|||
smp_data_out->input[k].port[l].ptr = matched->CSC ; \ |
|||
} |
|||
|
|||
#define CONVERT_KLU_BINDING_TABLE_TO_COMPLEX_XSPICE_INPUTS(ptr, binding, a, b) \ |
|||
if ((smp_data_out->a != 0) && (smp_data_cntl->b != 0)) \ |
|||
smp_data_out->input[k].port[l].ptr = here->binding->CSC_Complex ; |
|||
#define CONVERT_KLU_BINDING_TABLE_TO_COMPLEX_XSPICE_INPUTS_E(ptr, binding, a, b) \ |
|||
if ((smp_data_out->a != 0) && (smp_data_cntl->b != 0)) \ |
|||
smp_data_out->input[k].port[l].ptr = smp_data_out->input[k].port[l].e.binding->CSC_Complex ; |
|||
|
|||
#define CONVERT_KLU_BINDING_TABLE_TO_REAL_XSPICE_INPUTS(ptr, binding, a, b) \ |
|||
if ((smp_data_out->a != 0) && (smp_data_cntl->b != 0)) \ |
|||
smp_data_out->input[k].port[l].ptr = here->binding->CSC ; |
|||
#define CONVERT_KLU_BINDING_TABLE_TO_REAL_XSPICE_INPUTS_E(ptr, binding, a, b) \ |
|||
if ((smp_data_out->a != 0) && (smp_data_cntl->b != 0)) \ |
|||
smp_data_out->input[k].port[l].ptr = smp_data_out->input[k].port[l].e.binding->CSC ; |
|||
|
|||
#define CREATE_KLU_BINDING_TABLE_XSPICE_INPUTS_F(ptr, binding, a, b) \ |
|||
if ((smp_data_out->a != 0) && (smp_data_cntl->b != 0)) { \ |
|||
i = smp_data_out->input[k].port[l].ptr ; \ |
|||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; \ |
|||
smp_data_out->input[k].port[l].f.binding = matched ; \ |
|||
smp_data_out->input[k].port[l].ptr = matched->CSC ; \ |
|||
} |
|||
|
|||
#define CONVERT_KLU_BINDING_TABLE_TO_COMPLEX_XSPICE_INPUTS_F(ptr, binding, a, b) \ |
|||
if ((smp_data_out->a != 0) && (smp_data_cntl->b != 0)) \ |
|||
smp_data_out->input[k].port[l].ptr = smp_data_out->input[k].port[l].f.binding->CSC_Complex ; |
|||
|
|||
#define CONVERT_KLU_BINDING_TABLE_TO_REAL_XSPICE_INPUTS_F(ptr, binding, a, b) \ |
|||
if ((smp_data_out->a != 0) && (smp_data_cntl->b != 0)) \ |
|||
smp_data_out->input[k].port[l].ptr = smp_data_out->input[k].port[l].f.binding->CSC ; |
|||
|
|||
#define CREATE_KLU_BINDING_TABLE_XSPICE_INPUTS_G(ptr, binding, a, b) \ |
|||
if ((smp_data_out->a != 0) && (smp_data_cntl->b != 0)) { \ |
|||
i = smp_data_out->input[k].port[l].ptr ; \ |
|||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; \ |
|||
smp_data_out->input[k].port[l].g.binding = matched ; \ |
|||
smp_data_out->input[k].port[l].ptr = matched->CSC ; \ |
|||
} |
|||
|
|||
#define CONVERT_KLU_BINDING_TABLE_TO_COMPLEX_XSPICE_INPUTS_G(ptr, binding, a, b) \ |
|||
if ((smp_data_out->a != 0) && (smp_data_cntl->b != 0)) \ |
|||
smp_data_out->input[k].port[l].ptr = smp_data_out->input[k].port[l].g.binding->CSC_Complex ; |
|||
|
|||
#define CONVERT_KLU_BINDING_TABLE_TO_REAL_XSPICE_INPUTS_G(ptr, binding, a, b) \ |
|||
if ((smp_data_out->a != 0) && (smp_data_cntl->b != 0)) \ |
|||
smp_data_out->input[k].port[l].ptr = smp_data_out->input[k].port[l].g.binding->CSC ; |
|||
|
|||
#define CREATE_KLU_BINDING_TABLE_XSPICE_INPUTS_H(ptr, binding, a, b) \ |
|||
if ((smp_data_out->a != 0) && (smp_data_cntl->b != 0)) { \ |
|||
i = smp_data_out->input[k].port[l].ptr ; \ |
|||
matched = (BindElement *) bsearch (&i, BindStruct, nz, sizeof(BindElement), BindCompare) ; \ |
|||
smp_data_out->input[k].port[l].h.binding = matched ; \ |
|||
smp_data_out->input[k].port[l].ptr = matched->CSC ; \ |
|||
} |
|||
|
|||
#define CONVERT_KLU_BINDING_TABLE_TO_COMPLEX_XSPICE_INPUTS_H(ptr, binding, a, b) \ |
|||
if ((smp_data_out->a != 0) && (smp_data_cntl->b != 0)) \ |
|||
smp_data_out->input[k].port[l].ptr = smp_data_out->input[k].port[l].h.binding->CSC_Complex ; |
|||
|
|||
#define CONVERT_KLU_BINDING_TABLE_TO_REAL_XSPICE_INPUTS_H(ptr, binding, a, b) \ |
|||
if ((smp_data_out->a != 0) && (smp_data_cntl->b != 0)) \ |
|||
smp_data_out->input[k].port[l].ptr = smp_data_out->input[k].port[l].h.binding->CSC ; |
|||
#endif |
|||
|
|||
#endif |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue