Maker Pro
Maker Pro

Universal "Comment" Character

J

Jim Thompson

Jan 1, 1970
0
Is there a universal character in ALL variations of "Spice" netlists
that designates that the following text is a comment only?

(Trying to adjust my LVS templates so that ALL layout editors will
recognize comments.)

...Jim Thompson
 
J

Jim Thompson

Jan 1, 1970
0
mite want to try these
;comments, //comments , {comments }

So far it looks like ONLY a newline beginning "*" works for ALL cases
:-(

...Jim Thompson
 
J

Jamie

Jan 1, 1970
0
Jim said:
Is there a universal character in ALL variations of "Spice" netlists
that designates that the following text is a comment only?

(Trying to adjust my LVS templates so that ALL layout editors will
recognize comments.)

...Jim Thompson
mite want to try these
;comments, //comments , {comments }
 
M

Martine Riddle

Jan 1, 1970
0
Jim Thompson said:
Is there a universal character in ALL variations of "Spice" netlists
that designates that the following text is a comment only?

(Trying to adjust my LVS templates so that ALL layout editors will
recognize comments.)

...Jim Thompson

All of the model files I have collected use the '*' cahracter.

Cheers
 
J

Jim Thompson

Jan 1, 1970
0
All of the model files I have collected use the '*' cahracter.

Cheers

That (*) only applies at the beginning of a _new_line_.

Looks like both PSpice and HSpice use ";" for comments _in-line_.

But my real need is talking to chip layout tools...

IC Editor

Tanner Tools

etc.

...Jim Thompson
 
J

John Larkin

Jan 1, 1970
0
That (*) only applies at the beginning of a _new_line_.

Looks like both PSpice and HSpice use ";" for comments _in-line_.

But my real need is talking to chip layout tools...

IC Editor

Tanner Tools

etc.

...Jim Thompson

Hey Jim, have you started programming yet?

John
 
J

Jim Thompson

Jan 1, 1970
0
Hey Jim, have you started programming yet?

John

Not yet. But I'm thinking about starting a second life writing
engineering tools ;-)

...Jim Thompson
 
T

Tom Del Rosso

Jan 1, 1970
0
Jim Thompson said:
So far it looks like ONLY a newline beginning "*" works for ALL cases
:-(

Don't you have a son who is a programmer? A text pre-processor that
substitutes one code for the others would be pretty easy. It could have an
option to choose the code for the output file.
 
J

Jim Thompson

Jan 1, 1970
0
Don't you have a son who is a programmer? A text pre-processor that
substitutes one code for the others would be pretty easy. It could have an
option to choose the code for the output file.

He's so busy at his own work he has no time for Dad anymore :-(

So I'm going to have to learn/refresh... I used to do Pascal OK.

...Jim Thompson
 
S

Spehro Pefhany

Jan 1, 1970
0
Don't you have a son who is a programmer? A text pre-processor that
substitutes one code for the others would be pretty easy. It could have an
option to choose the code for the output file.

Maybe something could easily be thrown together in Perl (or even
simple-Simon awk).


Best regards,
Spehro Pefhany
 
N

Ned Konz

Jan 1, 1970
0
Spehro said:
Maybe something could easily be thrown together in Perl (or even
simple-Simon awk).

Yes, here's a Perl script that does just that. Enjoy!
It does semicolon and double-slash comments, but you should be able to
see how to extend it.

--- cut here ---
#!/usr/bin/perl -p
# Takes end-of-line comments in SPICE files and puts them in before the
lines
# in which they appeared as regular SPICE asterisk comments.
# Usage:
#
# perl -p spicecomments.pl originalfile > newfile
#
# or (to do an in-place edit):
#
# perl -pi spicecomments.pl originalfile

# semicolon end-of-line comments
s#^([^;]+)\s*;(.*)#*$2\n$1#;
s#^\s*;(.*)#*$1#;
# double-slash end-of-line comments
s#^(.+)\s*//(.*)#*$2\n$1#;
s#^\s*//(.*)#*$1#;
 
Q

qrk

Jan 1, 1970
0
Don't you have a son who is a programmer? A text pre-processor that
substitutes one code for the others would be pretty easy. It could have an
option to choose the code for the output file.

You can use SED to alter text strings in an ASCII file. Incorporate
SED into a batch file to make life easier. It will take a file,
process, then write it out to another file leaving the original alone.
SED can use reg ex for those really sticky issues. SED can be
daunting, but you will quickly appreciate what it can do.

http://sourceforge.net/project/showfiles.php?group_id=23617&package_id=16429
For Windoze, download the "bin" and "dep" zip files.
 
J

joseph2k

Jan 1, 1970
0
Jim said:
He's so busy at his own work he has no time for Dad anymore :-(

So I'm going to have to learn/refresh... I used to do Pascal OK.

...Jim Thompson

On thinking about it a bit the only relatively reliable one is likely to be
Asterisk in column 1, required for backward compatibility from the old
Fortran days.
 
J

Jim Thompson

Jan 1, 1970
0
On thinking about it a bit the only relatively reliable one is likely to be
Asterisk in column 1, required for backward compatibility from the old
Fortran days.

That's my suspicion also. Since my netlister can insert a newline
that's what I'll probably settle on.

...Jim Thompson
 
H

Hal Murray

Jan 1, 1970
0
On thinking about it a bit the only relatively reliable one is likely to be
Asterisk in column 1, required for backward compatibility from the old
Fortran days.

Sometimes, you can use cpp for hacks like this. It often works very
well if you are using make.

(cpp is the c preprocessor that processes things like #define and #if.)
 
F

Fred Abse

Jan 1, 1970
0
Maybe something could easily be thrown together in Perl (or even
simple-Simon awk).

sed probably can be made to do it all.

Any sed masochists out there?
 
Top