Browse Source

Allow m parameter for B source with current output

Fixes bug no. 734
pre-master-46
Holger Vogt 1 year ago
parent
commit
26b197df33
  1. 18
      src/frontend/inpcom.c

18
src/frontend/inpcom.c

@ -4126,13 +4126,25 @@ static int inp_fix_subckt_multiplier(struct names *subckt_w_params,
for (card = subckt_card->nextcard; card && !ciprefix(".ends", card->line); for (card = subckt_card->nextcard; card && !ciprefix(".ends", card->line);
card = card->nextcard) { card = card->nextcard) {
char *curr_line = card->line; char *curr_line = card->line;
/* no 'm' for comment line, B, V, E, H and some others that are not
* using 'm' in their model description */
if (strchr("*bvehaknopstuwy", curr_line[0]))
/* no 'm' for comment line, V, E, H and some others that are not
using 'm' in their model description.
B source will get 'm' only when it is a current source. */
if (strchr("*vehaknopstuwy", curr_line[0]))
continue; continue;
/* no 'm' for model cards */ /* no 'm' for model cards */
if (ciprefix(".model", curr_line)) if (ciprefix(".model", curr_line))
continue; continue;
/* Special treatment for B source:
Skip voltage source */
if (curr_line[0] == 'b') {
char* tmpstr = curr_line;
/* Skip Bxxx, node1, node2 */
tmpstr = nexttok(tmpstr);
tmpstr = nexttok(tmpstr);
tmpstr = nexttok(tmpstr);
if (ciprefix("v=", tmpstr))
continue;
}
if (newcompat.hs && card->compmod == 0) { if (newcompat.hs && card->compmod == 0) {
/* if there is already an m=xx in the instance line, multiply it with the new m */ /* if there is already an m=xx in the instance line, multiply it with the new m */
char* mult = strstr(curr_line, " m="); char* mult = strstr(curr_line, " m=");

Loading…
Cancel
Save