The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design >> Analog Design >> how to comment multi-lines in SPICE
https://designers-guide.org/forum/YaBB.pl?num=1155105286

Message started by microe on Aug 8th, 2006, 11:34pm

Title: how to comment multi-lines in SPICE
Post by microe on Aug 8th, 2006, 11:34pm

In SPICE, we can use "*" to turn the current line into comment. If I want to comment for a couple of lines, is there an easy way to do that, other than put "*" at the beginning of each line.

Thanks.

Title: Re: how to comment multi-lines in SPICE
Post by bernd on Aug 9th, 2006, 1:21am

For Spice3, but be aware there are many Spice dialects out there.


2.2.3. Comments
General Form:
* <any comment>
Examples:
* RF=1K Gain should be 100
* Check open-loop gain and phase margin

The asterisk in the first column indicates that this line is a comment line. Comment lines may be placed anywhere in the circuit description. Note that SPICE3 also considers any line with leading white space to be a comment.


Refer to:
http://bwrc.eecs.berkeley.edu/Classes/IcBook/SPICE/
http://bwrc.eecs.berkeley.edu/Classes/IcBook/SPICE/UserGuide/description_fr.html


Bernd

Title: Re: how to comment multi-lines in SPICE
Post by Andrew Beckett on Aug 10th, 2006, 2:25pm

Spectre (for example) allows C-style comments if the -E argument is specified (or the -I is used to give an include path) - it passes the netlist through cpp - the C preprocessor.

Many years ago (probably about 14-15 years), I used a little wrapper script around HSPICE which did the same thing - it first used cpp to preprocess the netlist, and then invoked hspice. Then I could use multi-line /* */ type comments, and also preprocessor directives like #ifdef and so on. This approach could be used with any simulator.

Regards,

Andrew.

Title: Re: how to comment multi-lines in SPICE
Post by ywguo on Aug 10th, 2006, 9:17pm

Andrew,

So we need a Cpp compiler if using your wrapper, doesn't it? Sometimes block comment is easy to use. Why does SPICE NOT provide block comment?


BG
Yawei

Title: Re: how to comment multi-lines in SPICE
Post by Andrew Beckett on Aug 20th, 2006, 3:09pm

SPICE was invented in the days of punch cards. So each line was intended to be quite brief, and separate from the other lines. You would have done a minimal amount of commenting (because it wastes cards), and multi-line comments would have been never used.

That said, it could have been adapted for more modern input methods.

However, I can't speak for SPICE - you'd have to ask Berkeley this question!

Still, cpp is pretty universally available, so using it should not really be a penalty. I tended to use cpp for the conditional include capabilities as much as anything - you can then have a single netlist which can be used for multiple things, just by giving different -D options to cpp...

Andrew.

Title: Re: how to comment multi-lines in SPICE
Post by ipsc on Sep 17th, 2006, 10:56am

#com
--------
--------Lines to be commented-----
--------
#endcom

is used for multiline commenting is SmartSpice. See if it works in spice as well.

Regards

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.