Merge branch 'pre-master-42' into bt_dev
This commit is contained in:
commit
7f47047686
|
|
@ -9,7 +9,7 @@ R2 2 0 10k
|
|||
|
||||
V11 11 0 dc 0 ac 1
|
||||
R11 11 12 10k
|
||||
R12 12 0 10k noiseless
|
||||
R12 12 0 10k noisy=0
|
||||
|
||||
V21 21 0 dc 0 ac 1
|
||||
R21 21 22 10k
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
* noise of a resistive divider
|
||||
* noise of a resistive divider, lower resistor noiseless
|
||||
* noise of a resistive divider with filter
|
||||
* 'set behavior = lta' is required
|
||||
|
||||
.model res1 resistorva has_noise=1 R=10K
|
||||
.model noiseless resistorva has_noise=0 R=10K
|
||||
V1 1 0 dc 0 ac 1
|
||||
n1 1 2 res1
|
||||
R2 2 0
|
||||
|
||||
V11 11 0 dc 0 ac 1
|
||||
n11 11 12 res1
|
||||
n12 12 0 noiseless
|
||||
|
||||
V21 21 0 dc 0 ac 1
|
||||
n21 21 22 res1
|
||||
n22 22 0 res1
|
||||
C22 22 0 1u
|
||||
|
||||
.control
|
||||
pre_osdi resistor.osdi
|
||||
noise v(2) V1 dec 10 1 100k 1
|
||||
echo **resistive divider**
|
||||
print onoise_total inoise_total
|
||||
setplot noise1
|
||||
print onoise_spectrum[0] inoise_spectrum[0]
|
||||
noise v(12) V11 dec 10 1 100k
|
||||
echo **resistive divider, lower resistor noiseless**
|
||||
print onoise_total inoise_total
|
||||
setplot noise3
|
||||
print onoise_spectrum[0] inoise_spectrum[0]
|
||||
noise v(22) V21 dec 10 1 100k
|
||||
echo **resistive divider with filter**
|
||||
print onoise_total inoise_total
|
||||
setplot noise5
|
||||
print onoise_spectrum[0] inoise_spectrum[0]
|
||||
set xbrushwidth=2
|
||||
plot onoise_spectrum inoise_spectrum xlimit 1 1e5
|
||||
.endc
|
||||
|
||||
.end
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
`include "discipline.h"
|
||||
|
||||
`define P_KB 1.38064852e-23 // copied from const.h to exactly jmatch builtin
|
||||
`define MPRoz(nam,def,uni, des) (*units=uni, desc=des*) parameter real nam=def from(0.0:inf);
|
||||
|
||||
module resistorva(p,n);
|
||||
electrical p,n;
|
||||
inout p,n;
|
||||
|
||||
`MPRoz(R, 1.0, "Ohm", "Resistance")
|
||||
parameter integer has_noise=1;
|
||||
|
||||
analog
|
||||
begin
|
||||
I(p,n) <+ V(p,n)/R;
|
||||
if (has_noise)
|
||||
I(p,n) <+ white_noise(4*`P_KB*$temperature/R, "thermal");
|
||||
end
|
||||
endmodule
|
||||
|
|
@ -18,6 +18,7 @@
|
|||
typedef struct OsdiRegistryEntry {
|
||||
const void *descriptor;
|
||||
uint32_t inst_offset;
|
||||
uint32_t noise_offset;
|
||||
uint32_t dt;
|
||||
uint32_t temp;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ libosdi_la_SOURCES = \
|
|||
osdiacld.c \
|
||||
osdiparam.c \
|
||||
osdiregistry.c \
|
||||
osdinoise.c \
|
||||
osdisetup.c \
|
||||
osditrunc.c \
|
||||
osdipzld.c \
|
||||
|
|
|
|||
|
|
@ -190,8 +190,7 @@ typedef struct OsdiDescriptor {
|
|||
OsdiSimParas *sim_params, OsdiInitInfo *res);
|
||||
|
||||
uint32_t (*eval)(void *handle, void *inst, const void *model, const OsdiSimInfo *info);
|
||||
void (*load_noise)(void *inst, void *model, double freq, double *noise_dens,
|
||||
double *ln_noise_dens);
|
||||
void (*load_noise)(void *inst, void *model, double freq, double *noise_dens);
|
||||
void (*load_residual_resist)(void *inst, void* model, double *dst);
|
||||
void (*load_residual_react)(void *inst, void* model, double *dst);
|
||||
void (*load_limit_rhs_resist)(void *inst, void* model, double *dst);
|
||||
|
|
|
|||
|
|
@ -75,6 +75,8 @@ typedef struct OsdiModelData {
|
|||
extern size_t osdi_instance_data_off(const OsdiRegistryEntry *entry);
|
||||
extern void *osdi_instance_data(const OsdiRegistryEntry *entry,
|
||||
GENinstance *inst);
|
||||
extern double *osdi_noise_data(const OsdiRegistryEntry *entry,
|
||||
GENinstance *inst);
|
||||
#ifdef KLU
|
||||
extern size_t osdi_instance_matrix_ptr_off(const OsdiRegistryEntry *entry);
|
||||
extern double **osdi_instance_matrix_ptr(const OsdiRegistryEntry *entry,
|
||||
|
|
|
|||
|
|
@ -27,9 +27,11 @@ extern int OSDItemp(GENmodel *, CKTcircuit *);
|
|||
extern int OSDIacLoad(GENmodel *, CKTcircuit *);
|
||||
extern int OSDItrunc(GENmodel *, CKTcircuit *, double *);
|
||||
extern int OSDIpzLoad(GENmodel *, CKTcircuit *, SPcomplex *);
|
||||
extern int OSDInoise(int, int, GENmodel *, CKTcircuit *, Ndata *, double *);
|
||||
|
||||
#ifdef KLU
|
||||
extern int OSDIbindCSC(GENmodel *inModel, CKTcircuit *ckt);
|
||||
extern int OSDIupdateCSC(GENmodel *inModel, CKTcircuit *ckt, bool complex);
|
||||
extern int OSDIbindCSCComplexToReal(GENmodel *inModel, CKTcircuit *ckt);
|
||||
extern int OSDIbindCSCComplex(GENmodel *inModel, CKTcircuit *ckt);
|
||||
#endif
|
||||
|
|
@ -38,5 +40,4 @@ extern int OSDIbindCSCComplex(GENmodel *inModel, CKTcircuit *ckt);
|
|||
/* extern int OSDImDelete(GENmodel*); */
|
||||
/* extern int OSDIgetic(GENmodel*,CKTcircuit*); */
|
||||
/* extern int OSDImAsk(CKTcircuit*,GENmodel*,int,IFvalue*); */
|
||||
/* extern int OSDInoise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); */
|
||||
/* extern int OSDIsoaCheck(CKTcircuit *, GENmodel *); */
|
||||
|
|
|
|||
|
|
@ -196,6 +196,7 @@ extern SPICEdev *osdi_create_spicedev(const OsdiRegistryEntry *entry) {
|
|||
OSDIinfo->DEVacLoad = OSDIacLoad;
|
||||
OSDIinfo->DEVpzLoad = OSDIpzLoad;
|
||||
OSDIinfo->DEVtrunc = OSDItrunc;
|
||||
OSDIinfo->DEVnoise = OSDInoise;
|
||||
|
||||
#ifdef KLU
|
||||
OSDIinfo->DEVbindCSC = OSDIbindCSC;
|
||||
|
|
|
|||
|
|
@ -168,8 +168,9 @@ extern int OSDIload(GENmodel *inModel, CKTcircuit *ckt) {
|
|||
}
|
||||
|
||||
if (ckt->CKTmode & MODEACNOISE) {
|
||||
sim_info.flags |= CALC_NOISE | ANALYSIS_NOISE;
|
||||
sim_info.flags |= ANALYSIS_NOISE;
|
||||
}
|
||||
sim_info.flags |= CALC_NOISE;
|
||||
|
||||
OsdiRegistryEntry *entry = osdi_reg_entry_model(inModel);
|
||||
const OsdiDescriptor *descr = entry->descriptor;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,252 @@
|
|||
/*
|
||||
* This file is part of the OSDI component of NGSPICE.
|
||||
* Copyright© 2023 Pascal Kuthe.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Author: Pascal Kuthe <pascal.kuthe@semimod.de>
|
||||
*/
|
||||
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "ngspice/iferrmsg.h"
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/noisedef.h"
|
||||
#include "ngspice/suffix.h"
|
||||
|
||||
#include "osdi.h"
|
||||
#include "osdidefs.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef RFSPICE
|
||||
extern CMat *eyem;
|
||||
extern CMat *zref;
|
||||
extern CMat *gn;
|
||||
extern CMat *gninv;
|
||||
extern CMat *vNoise;
|
||||
extern CMat *iNoise;
|
||||
#include "../maths/dense/denseinlines.h"
|
||||
#endif
|
||||
|
||||
static double *noise_dens = NULL;
|
||||
static double *noise_dens_ln = NULL;
|
||||
static uint32_t noise_dense_len = 0;
|
||||
|
||||
#define nVar(i, j) noise_vals[i * descr->num_noise_src + j]
|
||||
/*
|
||||
* HICUMnoise (mode, operation, firstModel, ckt, data, OnDens)
|
||||
*
|
||||
* This routine names and evaluates all of the noise sources
|
||||
* associated with HICUM's. It starts with the model *firstModel and
|
||||
* traverses all of its insts. It then proceeds to any other models
|
||||
* on the linked list. The total output noise density generated by
|
||||
* all of the HICUM's is summed with the variable "OnDens".
|
||||
*/
|
||||
|
||||
int OSDInoise(int mode, int operation, GENmodel *inModel, CKTcircuit *ckt,
|
||||
Ndata *data, double *OnDens) {
|
||||
GENmodel *gen_model;
|
||||
GENinstance *gen_inst;
|
||||
uint32_t i, node1, node2;
|
||||
double realVal, imagVal, gain, tempOnoise, tempInoise, totalNoise,
|
||||
totalNoiseLn, inoise;
|
||||
OsdiNoiseSource src;
|
||||
uint32_t *node_mapping;
|
||||
double *noise_vals;
|
||||
NOISEAN *job = (NOISEAN *)ckt->CKTcurJob;
|
||||
|
||||
OsdiRegistryEntry *entry = osdi_reg_entry_model(inModel);
|
||||
const OsdiDescriptor *descr = entry->descriptor;
|
||||
|
||||
if (descr->num_noise_src == 0) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
if (noise_dense_len < descr->num_noise_src) {
|
||||
noise_dens = realloc(noise_dens, descr->num_noise_src * sizeof(double));
|
||||
noise_dens_ln =
|
||||
realloc(noise_dens_ln, descr->num_noise_src * sizeof(double));
|
||||
}
|
||||
|
||||
for (gen_model = inModel; gen_model; gen_model = gen_model->GENnextModel) {
|
||||
void *model = osdi_model_data(gen_model);
|
||||
|
||||
for (gen_inst = gen_model->GENinstances; gen_inst;
|
||||
gen_inst = gen_inst->GENnextInstance) {
|
||||
void *inst = osdi_instance_data(entry, gen_inst);
|
||||
totalNoise = 0.0;
|
||||
noise_vals = osdi_noise_data(entry, gen_inst);
|
||||
|
||||
switch (operation) {
|
||||
|
||||
case N_OPEN:
|
||||
/* see if we have to to produce a summary report */
|
||||
/* if so, name all the noise generators */
|
||||
if (job->NStpsSm != 0) {
|
||||
switch (mode) {
|
||||
|
||||
case N_DENS:
|
||||
for (i = 0; i < descr->num_noise_src; i++) {
|
||||
NOISE_ADD_OUTVAR(ckt, data, "onoise_%s_%s", gen_inst->GENname,
|
||||
descr->noise_sources[i].name);
|
||||
}
|
||||
// TOTAL noise
|
||||
NOISE_ADD_OUTVAR(ckt, data, "onoise_%s%s", gen_inst->GENname, "");
|
||||
break;
|
||||
|
||||
case INT_NOIZ:
|
||||
for (i = 0; i < descr->num_noise_src; i++) {
|
||||
NOISE_ADD_OUTVAR(ckt, data, "onoise_total_%s_%s",
|
||||
gen_inst->GENname, descr->noise_sources[i].name);
|
||||
NOISE_ADD_OUTVAR(ckt, data, "inoise_total_%s_%s",
|
||||
gen_inst->GENname, descr->noise_sources[i].name);
|
||||
}
|
||||
// TOTAL noise
|
||||
NOISE_ADD_OUTVAR(ckt, data, "onoise_total_%s%s", gen_inst->GENname,
|
||||
" ");
|
||||
NOISE_ADD_OUTVAR(ckt, data, "inoise_total_%s%s", gen_inst->GENname,
|
||||
" ");
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case N_CALC:
|
||||
switch (mode) {
|
||||
|
||||
case N_DENS:
|
||||
descr->load_noise(inst, model, data->freq, noise_dens);
|
||||
node_mapping =
|
||||
(uint32_t *)(((char *)inst) + descr->node_mapping_offset);
|
||||
for (i = 0; i < descr->num_noise_src; i++) {
|
||||
src = descr->noise_sources[i];
|
||||
node1 = node_mapping[src.nodes.node_1];
|
||||
if (src.nodes.node_2 == UINT32_MAX) {
|
||||
node2 = 0;
|
||||
} else {
|
||||
node2 = node_mapping[src.nodes.node_2];
|
||||
};
|
||||
#ifdef RFSPICE
|
||||
if (ckt->CKTcurrentAnalysis & DOING_SP) {
|
||||
inoise = sqrt(noise_dens[i]);
|
||||
// Calculate input equivalent noise current source (we have port
|
||||
// impedance attached)
|
||||
for (int s = 0; s < ckt->CKTportCount; s++)
|
||||
vNoise->d[0][s] =
|
||||
cmultdo(csubco(ckt->CKTadjointRHS->d[s][node1],
|
||||
ckt->CKTadjointRHS->d[s][node2]),
|
||||
inoise);
|
||||
|
||||
for (int d = 0; d < ckt->CKTportCount; d++) {
|
||||
cplx in;
|
||||
double yport = 1.0 / zref->d[d][d].re;
|
||||
|
||||
in.re = vNoise->d[0][d].re * yport;
|
||||
in.im = vNoise->d[0][d].im * yport;
|
||||
|
||||
for (int s = 0; s < ckt->CKTportCount; s++)
|
||||
caddc(&in, in,
|
||||
cmultco(ckt->CKTYmat->d[d][s], vNoise->d[0][s]));
|
||||
|
||||
iNoise->d[0][d] = in;
|
||||
}
|
||||
|
||||
for (int d = 0; d < ckt->CKTportCount; d++)
|
||||
for (int s = 0; s < ckt->CKTportCount; s++)
|
||||
ckt->CKTNoiseCYmat->d[d][s] =
|
||||
caddco(ckt->CKTNoiseCYmat->d[d][s],
|
||||
cmultco(iNoise->d[0][d], conju(iNoise->d[0][s])));
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
#endif
|
||||
realVal = ckt->CKTrhs[node1] - ckt->CKTrhs[node2];
|
||||
imagVal = ckt->CKTirhs[node1] - ckt->CKTirhs[node2];
|
||||
gain = (realVal * realVal) + (imagVal * imagVal);
|
||||
noise_dens[i] *= gain;
|
||||
noise_dens_ln[i] = log(MAX(noise_dens[i], N_MINLOG));
|
||||
totalNoise += noise_dens[i];
|
||||
}
|
||||
#ifdef RFSPICE
|
||||
if (ckt->CKTcurrentAnalysis & DOING_SP) {
|
||||
continue;
|
||||
;
|
||||
}
|
||||
#endif
|
||||
|
||||
*OnDens += totalNoise;
|
||||
totalNoiseLn = log(MAX(totalNoise, N_MINLOG));
|
||||
if (data->delFreq == 0.0) {
|
||||
/* if we haven't done any previous integration, we need to */
|
||||
/* initialize our "history" variables */
|
||||
|
||||
for (i = 0; i < descr->num_noise_src; i++) {
|
||||
nVar(LNLSTDENS, i) = noise_dens_ln[i];
|
||||
}
|
||||
|
||||
/* clear out our integration variables if it's the first pass */
|
||||
|
||||
if (data->freq == job->NstartFreq) {
|
||||
for (i = 0; i < descr->num_noise_src; i++) {
|
||||
nVar(OUTNOIZ, i) = 0.0;
|
||||
nVar(INNOIZ, i) = 0.0;
|
||||
}
|
||||
nVar(OUTNOIZ, descr->num_noise_src) = 0.0;
|
||||
nVar(INNOIZ, descr->num_noise_src) = 0.0;
|
||||
}
|
||||
} else { /* data->delFreq != 0.0 (we have to integrate) */
|
||||
|
||||
/* In order to get the best curve fit, we have to integrate each
|
||||
* component separately */
|
||||
|
||||
for (i = 0; i < descr->num_noise_src; i++) {
|
||||
tempOnoise = Nintegrate(noise_dens[i], noise_dens_ln[i],
|
||||
nVar(LNLSTDENS, i), data);
|
||||
tempInoise =
|
||||
Nintegrate(noise_dens[i] * data->GainSqInv,
|
||||
noise_dens_ln[i] + data->lnGainInv,
|
||||
nVar(LNLSTDENS, i) + data->lnGainInv, data);
|
||||
nVar(LNLSTDENS, i) = noise_dens_ln[i];
|
||||
data->outNoiz += tempOnoise;
|
||||
data->inNoise += tempInoise;
|
||||
if (job->NStpsSm != 0) {
|
||||
nVar(OUTNOIZ, i) += tempOnoise;
|
||||
nVar(INNOIZ, i) += tempInoise;
|
||||
nVar(OUTNOIZ, descr->num_noise_src) += tempOnoise;
|
||||
nVar(INNOIZ, descr->num_noise_src) += tempInoise;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (data->prtSummary) {
|
||||
for (i = 0; i < descr->num_noise_src;
|
||||
i++) { /* print a summary report */
|
||||
data->outpVector[data->outNumber++] = noise_dens[i];
|
||||
}
|
||||
data->outpVector[data->outNumber++] = totalNoise;
|
||||
}
|
||||
break;
|
||||
case INT_NOIZ: /* already calculated, just output */
|
||||
if (job->NStpsSm != 0) {
|
||||
for (i = 0; i <= descr->num_noise_src; i++) {
|
||||
data->outpVector[data->outNumber++] = nVar(OUTNOIZ, i);
|
||||
data->outpVector[data->outNumber++] = nVar(INNOIZ, i);
|
||||
}
|
||||
} /* if */
|
||||
break;
|
||||
} /* switch (mode) */
|
||||
break;
|
||||
|
||||
case N_CLOSE:
|
||||
return (OK); /* do nothing, the main calling routine will close */
|
||||
break; /* the plots */
|
||||
}
|
||||
}
|
||||
}
|
||||
return (OK);
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* This file is part of the OSDI component of NGSPICE.
|
||||
* Copyright© 2022 SemiMod GmbH.
|
||||
* Copyright© 2023 Pascal Kuthe.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
@ -218,10 +219,14 @@ static size_t pad_to_align(size_t alignment, size_t size) {
|
|||
static size_t calc_osdi_instance_data_off(const OsdiDescriptor *descr) {
|
||||
size_t res = sizeof(GENinstance) /* generic data */
|
||||
+ descr->num_terminals * sizeof(int);
|
||||
// KLU pointers
|
||||
#ifdef KLU
|
||||
res = pad_to_align(alignof(double *), res);
|
||||
res += ((size_t)descr->num_jacobian_entries) * 2 * sizeof(double *);
|
||||
#endif
|
||||
// noise values
|
||||
res = pad_to_align(alignof(double), res);
|
||||
res += NSTATVARS * (descr->num_noise_src + 1) * sizeof(double);
|
||||
return pad_to_align(alignof(max_align_t), res);
|
||||
}
|
||||
|
||||
|
|
@ -233,6 +238,19 @@ static size_t calc_osdi_instance_matrix_off(const OsdiDescriptor *descr) {
|
|||
}
|
||||
#endif
|
||||
|
||||
static size_t calc_osdi_noise_off(const OsdiDescriptor *descr) {
|
||||
size_t res = sizeof(GENinstance) /* generic data */
|
||||
+ descr->num_terminals * sizeof(int);
|
||||
// KLU pointers
|
||||
#ifdef KLU
|
||||
res = pad_to_align(alignof(double *), res);
|
||||
res += ((size_t)descr->num_jacobian_entries) * 2 * sizeof(double *);
|
||||
#endif
|
||||
// noise values
|
||||
res = pad_to_align(alignof(double), res);
|
||||
return res;
|
||||
}
|
||||
|
||||
#define INVALID_OBJECT \
|
||||
(OsdiObjectFile) { .num_entries = -1 }
|
||||
|
||||
|
|
@ -397,9 +415,11 @@ extern OsdiObjectFile load_object_file(const char *input) {
|
|||
}
|
||||
|
||||
size_t inst_off = calc_osdi_instance_data_off(descr);
|
||||
size_t noise_off = calc_osdi_noise_off(descr);
|
||||
dst[i] = (OsdiRegistryEntry){
|
||||
.descriptor = descr,
|
||||
.inst_offset = (uint32_t)inst_off,
|
||||
.noise_offset = (uint32_t)noise_off,
|
||||
.dt = dt,
|
||||
.temp = temp,
|
||||
.has_m = has_m,
|
||||
|
|
@ -418,9 +438,6 @@ extern OsdiObjectFile load_object_file(const char *input) {
|
|||
};
|
||||
}
|
||||
|
||||
inline size_t osdi_instance_data_off(const OsdiRegistryEntry *entry) {
|
||||
return entry->inst_offset;
|
||||
}
|
||||
#ifdef KLU
|
||||
inline size_t osdi_instance_matrix_ptr_off(const OsdiRegistryEntry *entry) {
|
||||
return entry->matrix_ptr_offset;
|
||||
|
|
@ -431,6 +448,15 @@ inline double **osdi_instance_matrix_ptr(const OsdiRegistryEntry *entry,
|
|||
}
|
||||
#endif
|
||||
|
||||
inline double *osdi_noise_data(const OsdiRegistryEntry *entry,
|
||||
GENinstance *inst) {
|
||||
return (double *)(((char *)inst) + entry->noise_offset);
|
||||
}
|
||||
|
||||
inline size_t osdi_instance_data_off(const OsdiRegistryEntry *entry) {
|
||||
return entry->inst_offset;
|
||||
}
|
||||
|
||||
inline void *osdi_instance_data(const OsdiRegistryEntry *entry,
|
||||
GENinstance *inst) {
|
||||
return (void *)(((char *)inst) + osdi_instance_data_off(entry));
|
||||
|
|
|
|||
|
|
@ -484,7 +484,7 @@ int OSDIbindCSC(GENmodel *inModel, CKTcircuit *ckt) {
|
|||
uint32_t *node_ids = TMALLOC(uint32_t, descr->num_nodes);*/
|
||||
|
||||
for (gen_model = inModel; gen_model; gen_model = gen_model->GENnextModel) {
|
||||
void *model = osdi_model_data(gen_model);
|
||||
/* void *model = osdi_model_data(gen_model); unused */
|
||||
for (gen_inst = gen_model->GENinstances; gen_inst;
|
||||
gen_inst = gen_inst->GENnextInstance) {
|
||||
void *inst = osdi_instance_data(entry, gen_inst);
|
||||
|
|
@ -511,7 +511,7 @@ int OSDIupdateCSC(GENmodel *inModel, CKTcircuit *ckt, bool complex) {
|
|||
uint32_t *node_ids = TMALLOC(uint32_t, descr->num_nodes);*/
|
||||
|
||||
for (gen_model = inModel; gen_model; gen_model = gen_model->GENnextModel) {
|
||||
void *model = osdi_model_data(gen_model);
|
||||
/* void *model = osdi_model_data(gen_model); unused */
|
||||
for (gen_inst = gen_model->GENinstances; gen_inst;
|
||||
gen_inst = gen_inst->GENnextInstance) {
|
||||
void *inst = osdi_instance_data(entry, gen_inst);
|
||||
|
|
|
|||
|
|
@ -77,6 +77,14 @@ NOISEan(CKTcircuit* ckt, int restart)
|
|||
/* gtri - end - wbk */
|
||||
#endif
|
||||
|
||||
#ifdef KLU
|
||||
if (ckt->CKTkluMODE) {
|
||||
fprintf(stderr, "Error: Noise simulation is not (yet) supported with 'option KLU'.\n");
|
||||
fprintf(stderr, " Use 'option sparse' instead.\n");
|
||||
return(E_UNSUPP);
|
||||
}
|
||||
#endif
|
||||
|
||||
NOISEAN* job = (NOISEAN*)ckt->CKTcurJob;
|
||||
GENinstance* inst = CKTfndDev(ckt, job->input);
|
||||
bool frequequal = AlmostEqualUlps(job->NstartFreq, job->NstopFreq, 3);
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ Model Author : 1990 Michael Schröter TU Dresden
|
|||
*/
|
||||
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.1415926535897932384626433832795
|
||||
#endif
|
||||
|
|
@ -2279,6 +2280,8 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
Ibpei_Vrth += model->HICUMtype*irep_dT;
|
||||
|
||||
Ibiei = model->HICUMtype*ibei;
|
||||
*(ckt->CKTstate0 + here->HICUMibiei) = Ibiei;
|
||||
*(ckt->CKTstate0 + here->HICUMibpei) = Ibpei;
|
||||
Ibiei_Vbiei = model->HICUMtype*ibei_Vbiei;
|
||||
Ibiei_Vrth = model->HICUMtype*ibei_dT;
|
||||
Ibiei += model->HICUMtype*irei;
|
||||
|
|
@ -2794,13 +2797,11 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
*(ckt->CKTstate0 + here->HICUMvxf2) = Vxf2;
|
||||
*(ckt->CKTstate0 + here->HICUMvxf) = Vxf;
|
||||
|
||||
*(ckt->CKTstate0 + here->HICUMibiei) = Ibiei;
|
||||
*(ckt->CKTstate0 + here->HICUMibiei_Vbiei) = Ibiei_Vbiei;
|
||||
*(ckt->CKTstate0 + here->HICUMibiei_Vxf) = Ibiei_Vxf;
|
||||
*(ckt->CKTstate0 + here->HICUMibiei_Vbici) = Ibiei_Vbici;
|
||||
*(ckt->CKTstate0 + here->HICUMibiei_Vrth) = Ibiei_Vrth;
|
||||
|
||||
*(ckt->CKTstate0 + here->HICUMibpei) = Ibpei;
|
||||
*(ckt->CKTstate0 + here->HICUMibpei_Vbpei) = Ibpei_Vbpei;
|
||||
*(ckt->CKTstate0 + here->HICUMibpei_Vrth) = Ibpei_Vrth;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@
|
|||
/vngspice-fftw/
|
||||
/sharedspice/
|
||||
|
||||
/KLU/x64/
|
||||
|
||||
/.vs/
|
||||
*.vc.db
|
||||
spinit
|
||||
|
|
|
|||
|
|
@ -1226,6 +1226,7 @@
|
|||
<ClCompile Include="..\src\osdi\osdicallbacks.c" />
|
||||
<ClCompile Include="..\src\osdi\osdiinit.c" />
|
||||
<ClCompile Include="..\src\osdi\osdiload.c" />
|
||||
<ClCompile Include="..\src\osdi\osdinoise.c" />
|
||||
<ClCompile Include="..\src\osdi\osdiparam.c" />
|
||||
<ClCompile Include="..\src\osdi\osdipzld.c" />
|
||||
<ClCompile Include="..\src\osdi\osdiregistry.c" />
|
||||
|
|
|
|||
|
|
@ -1692,6 +1692,7 @@ lib /machine:x64 /def:..\..\fftw-3.3-dll64\libfftw3-3.def /out:$(IntDir)libfftw3
|
|||
<ClCompile Include="..\src\osdi\osdicallbacks.c" />
|
||||
<ClCompile Include="..\src\osdi\osdiinit.c" />
|
||||
<ClCompile Include="..\src\osdi\osdiload.c" />
|
||||
<ClCompile Include="..\src\osdi\osdinoise.c" />
|
||||
<ClCompile Include="..\src\osdi\osdiparam.c" />
|
||||
<ClCompile Include="..\src\osdi\osdipzld.c" />
|
||||
<ClCompile Include="..\src\osdi\osdiregistry.c" />
|
||||
|
|
|
|||
|
|
@ -1706,6 +1706,7 @@
|
|||
<ClCompile Include="..\src\osdi\osdicallbacks.c" />
|
||||
<ClCompile Include="..\src\osdi\osdiinit.c" />
|
||||
<ClCompile Include="..\src\osdi\osdiload.c" />
|
||||
<ClCompile Include="..\src\osdi\osdinoise.c" />
|
||||
<ClCompile Include="..\src\osdi\osdiparam.c" />
|
||||
<ClCompile Include="..\src\osdi\osdipzld.c" />
|
||||
<ClCompile Include="..\src\osdi\osdiregistry.c" />
|
||||
|
|
|
|||
Loading…
Reference in New Issue