Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@
#define NTS 4
#define SMIN 1.e-3

/* Replaces the "10000" limit used to identiy segment/patch connections */
#define PCHCON 10000
/*
* Keep the patch-connection namespace above practical wire-segment counts.
* PCHCON is used to distinguish patch connections from ordinary segment
* connections, so it must not overlap valid generated segment numbers.
*/
#define PCHCON 1000000000

/* carriage return and line feed */
#define CR 0x0d
Expand Down
12 changes: 9 additions & 3 deletions src/reporting.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,11 +880,17 @@ static int process_ex_card(context_t *ctx, const card_t *card, card_state_t *sta
if (cabs(voltage) < 1e-20) {
voltage = 1.0 + 0.0*I; /* Default to 1 volt */
}


/*
* EX specifies a segment relative to its tag, but the queued source is
* subsequently processed using an absolute/global segment number.
*/
int global_seg = segment_number(ctx, tag, seg);

if (extype == 0) {
return add_voltage_source(ctx, tag, seg, voltage);
return add_voltage_source(ctx, tag, global_seg, voltage);
} else {
return add_current_source(ctx, tag, seg, voltage);
return add_current_source(ctx, tag, global_seg, voltage);
}
}
else if (extype >= 1 && extype <= 4) {
Expand Down