The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 20th, 2024, 8:36pm
Pages: 1
Send Topic Print
how to comment multi-lines in SPICE (Read 9385 times)
microe
Junior Member
**
Offline



Posts: 16

how to comment multi-lines in SPICE
Aug 08th, 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.
Back to top
 
 
View Profile   IP Logged
bernd
Senior Member
****
Offline



Posts: 229
Munich/Germany
Re: how to comment multi-lines in SPICE
Reply #1 - 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
Back to top
 
 

Just another lonesome cad guy
View Profile WWW   IP Logged
Andrew Beckett
Senior Fellow
******
Offline

Life, don't talk to
me about Life...

Posts: 1742
Bracknell, UK
Re: how to comment multi-lines in SPICE
Reply #2 - 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.
Back to top
 
 
View Profile WWW   IP Logged
ywguo
Community Fellow
*****
Offline



Posts: 943
Shanghai, PRC
Re: how to comment multi-lines in SPICE
Reply #3 - 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
Back to top
 
 
View Profile   IP Logged
Andrew Beckett
Senior Fellow
******
Offline

Life, don't talk to
me about Life...

Posts: 1742
Bracknell, UK
Re: how to comment multi-lines in SPICE
Reply #4 - 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.
Back to top
 
 
View Profile WWW   IP Logged
ipsc
Junior Member
**
Offline



Posts: 10
India
Re: how to comment multi-lines in SPICE
Reply #5 - 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
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.