mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-09-03 16:29:09 +02:00
Added substitution for commas in SPICE output, because commas in
instance names and node names are basically fatal to running ngspice.
This commit is contained in:
+3
-1
@@ -209,8 +209,10 @@ EFArgs(argc, argv, err_result, argsProc, cdata)
|
||||
goto usage;
|
||||
if (strchr(cp, '!')) EFTrimFlags |= EF_TRIMGLOB;
|
||||
if (strchr(cp, '#')) EFTrimFlags |= EF_TRIMLOCAL;
|
||||
if (strchr(cp, ',')) EFTrimFlags |= EF_CONVERTCOMMAS;
|
||||
if (strchr(cp, ',')) EFTrimFlags |= EF_CONVERTCOMMA;
|
||||
if (strchr(cp, '=')) EFTrimFlags |= EF_CONVERTEQUAL;
|
||||
if (strchr(cp, '[')) EFTrimFlags |= EF_CONVERTBRACKETS;
|
||||
if (strchr(cp, ']')) EFTrimFlags |= EF_CONVERTBRACKETS;
|
||||
break;
|
||||
case 'C':
|
||||
EFCapThreshold = (EFCapValue)INFINITE_THRESHOLD_F;
|
||||
|
||||
+10
-4
@@ -859,7 +859,7 @@ EFHNOut(hierName, outf)
|
||||
HierName *hierName;
|
||||
FILE *outf;
|
||||
{
|
||||
bool trimGlob, trimLocal, trimComma;
|
||||
bool trimGlob, trimLocal, convComma, convBrackets;
|
||||
char *cp, c;
|
||||
|
||||
if (hierName->hn_parent) efHNOutPrefix(hierName->hn_parent, outf);
|
||||
@@ -868,13 +868,19 @@ EFHNOut(hierName, outf)
|
||||
cp = hierName->hn_name;
|
||||
trimGlob = (EFTrimFlags & EF_TRIMGLOB);
|
||||
trimLocal = (EFTrimFlags & EF_TRIMLOCAL);
|
||||
trimComma = (EFTrimFlags & EF_CONVERTCOMMAS);
|
||||
convComma = (EFTrimFlags & EF_CONVERTCOMMA);
|
||||
convBrackets = (EFTrimFlags & EF_CONVERTBRACKETS);
|
||||
while (c = *cp++)
|
||||
{
|
||||
if (*cp)
|
||||
{
|
||||
if (trimComma && (c == ','))
|
||||
putc(';', outf);
|
||||
if (c == ',')
|
||||
{
|
||||
if (convComma)
|
||||
putc('|', outf);
|
||||
}
|
||||
else if (convBrackets && ((c == '[') || (c == ']')))
|
||||
putc('_', outf);
|
||||
else
|
||||
putc(c, outf);
|
||||
}
|
||||
|
||||
+3
-2
@@ -40,8 +40,9 @@ typedef unsigned char U_char;
|
||||
/* Flags to control output of node names. Stored in EFTrimFlags */
|
||||
#define EF_TRIMGLOB 0x01 /* Delete trailing '!' from names */
|
||||
#define EF_TRIMLOCAL 0x02 /* Delete trailing '#' from names */
|
||||
#define EF_CONVERTCOMMAS 0x04 /* Change ',' to ';' in names */
|
||||
#define EF_CONVERTEQUAL 0x08 /* Change '=' to ':' in names */
|
||||
#define EF_CONVERTCOMMA 0x04 /* Change ',' to '|' in names, else remove */
|
||||
#define EF_CONVERTEQUAL 0x08 /* Change '=' to ':' in names, else remove */
|
||||
#define EF_CONVERTBRACKETS 0x10 /* Change '[' and ']' to '_' in names */
|
||||
|
||||
/*
|
||||
* capacitance type now set to float
|
||||
|
||||
Reference in New Issue
Block a user