Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsElectronicsBasicsRepairDesignCADComponentsEquipmentElectrical Engineering
ElectronicsKB.com
Contact UsLink To UsSearch & Site Map

Electronics Forum / CAD / October 2006



Tip: Looking for answers? Try searching our database.

Universal "Comment" Character

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim Thompson - 16 Oct 2006 16:45 GMT
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
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
           
I love to cook with wine.      Sometimes I even put it in the food.
Jamie - 16 Oct 2006 17:18 GMT
> Is there a universal character in ALL variations of "Spice" netlists
> that designates that the following text is a comment only?
[quoted text clipped - 3 lines]
>
>                                         ...Jim Thompson
mite want to try these
 ;comments, //comments , {comments }

Signature

"I am never wrong, once i thought i was, but i was mistaken"
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5

Jim Thompson - 16 Oct 2006 18:05 GMT
>> Is there a universal character in ALL variations of "Spice" netlists
>> that designates that the following text is a comment only?
[quoted text clipped - 5 lines]
>mite want to try these
>  ;comments, //comments , {comments }

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

                                       ...Jim Thompson
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
           
I love to cook with wine.      Sometimes I even put it in the food.
Tom Del Rosso - 17 Oct 2006 15:58 GMT
> 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.

Signature

Reply in group, but if emailing add another
zero, and remove the last word.

Jim Thompson - 17 Oct 2006 16:00 GMT
>> 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.

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
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
           
I love to cook with wine.      Sometimes I even put it in the food.
joseph2k - 19 Oct 2006 11:56 GMT
>>> So far it looks like ONLY a newline beginning "*" works for ALL cases
>>> :-(
[quoted text clipped - 8 lines]
>
>                                         ...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.

Signature

JosephKK
Gegen dummheit kampfen die Gotter Selbst, vergebens.  
 --Schiller

Jim Thompson - 19 Oct 2006 15:16 GMT
>>>> So far it looks like ONLY a newline beginning "*" works for ALL cases
>>>> :-(
[quoted text clipped - 12 lines]
>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
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
           
I love to cook with wine.      Sometimes I even put it in the food.
Hal Murray - 19 Oct 2006 17:55 GMT
>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.)

Signature

The suespammers.org mail server is located in California.  So are all my
other mailboxes.  Please do not send unsolicited bulk e-mail or unsolicited
commercial e-mail to my suespammers.org address or any of my other addresses.
These are my opinions, not necessarily my employer's.  I hate spam.

Spehro Pefhany - 17 Oct 2006 16:17 GMT
>> 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.

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

Best regards,
Spehro Pefhany
Signature

"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

Ned Konz - 18 Oct 2006 04:09 GMT
>>> So far it looks like ONLY a newline beginning "*" works for ALL cases
>>> :-(
[quoted text clipped - 4 lines]
> 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#;
Fred Abse - 20 Oct 2006 16:09 GMT
>>> So far it looks like ONLY a newline beginning "*" works for ALL cases
>>> :-(
[quoted text clipped - 5 lines]
> 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?

Signature

"Electricity is of two kinds, positive and negative. The difference
is, I presume, that one comes a little more expensive, but is more
durable; the other is a cheaper thing, but the moths get into it."
                                            (Stephen Leacock)

qrk - 18 Oct 2006 21:30 GMT
>> 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.

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.

---
Mark
Martine Riddle - 17 Oct 2006 00:04 GMT
> Is there a universal character in ALL variations of "Spice" netlists
> that designates that the following text is a comment only?
[quoted text clipped - 11 lines]
>
> I love to cook with wine.      Sometimes I even put it in the food.

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

Cheers
Jim Thompson - 17 Oct 2006 00:11 GMT
>> Is there a universal character in ALL variations of "Spice" netlists
>> that designates that the following text is a comment only?
[quoted text clipped - 15 lines]
>
>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
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
           
I love to cook with wine.      Sometimes I even put it in the food.
John Larkin - 17 Oct 2006 00:42 GMT
>>> Is there a universal character in ALL variations of "Spice" netlists
>>> that designates that the following text is a comment only?
[quoted text clipped - 29 lines]
>
>                                        ...Jim Thompson

Hey Jim, have you started programming yet?

John
Jim Thompson - 17 Oct 2006 00:52 GMT
>>>> Is there a universal character in ALL variations of "Spice" netlists
>>>> that designates that the following text is a comment only?
[quoted text clipped - 25 lines]
>
>John

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

                                       ...Jim Thompson
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
           
I love to cook with wine.      Sometimes I even put it in the food.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.