SwitCap2 Tips

ATTENTION
There is no one at Columbia in charge of SwitCap2 now, becasue they have left Columbia. So right now, there is no contact way for lisence/distribution. However, don't ask me a copy of the binary. It will be illegal. Thanks. :-) 10/20/2000 (Fri)

First of all, you should read manual carefully.
In this page, you may find what the manual doesn't tell us. You can't find the basic knowledge from here.
SwitCap3 Tips is getting started.

[ TOP ]

General Info

Need manual?

You can down load from SwitCap Homepage in postscript format.
PDF version is also available from here [SwitCap2 Tips].
SwitCap2.pdf (.... Thanks, Joel)

Where is SwitCap2 software in ECE/ORST?

You may need to append your path variable.

On HP [odin, holmes, and mismatch]:
/usr/local/apps/bin/sw2


Invoke

I'm using below script. This is very convenient. You can download from here.
After you create your input file:foo.in, just type
% SW2 foo
You'll have foo.out.
With this script you can put the input file in the loop, if you want. This script has a good advantage if you want to sweep the capacitance or something in SwitCap2, because SwitCap2 doesn't have any way like a SWEEP function in Hspice.
 
## 
echo 'SwitCap2 execution using file name: ' $1 
echo '---- running ----' 

sw2 << EOF 
$1.in 
$1.out 
EOF 
[ Go to TOP of this page ]

Input File Tips

Comment Block
Even though there is no description in the manual, I find you can use /* and */ at the different lines to comment out the block, in the same way as C language,
 
       /* 
       This is the beginning of comment 
       and this is the 
       end of comment.  
       */ 
       

Even if there is already a comment line, you can make them comment lines. Below code should not have problem.
 
       /* 
       This is the beginning of comment 
       and this is  
       /* In-between comments */ 
       and 
       /* 
       this is, too, 
       */ 
       and this is the 
       end of comment. 
       */ 
       

[ Go to TOP of this page ]
Multiple Lines
You can write a long statement into several lines directly. In Spice simulator, you need "+" at the beginning of the following lines. Don't do that in SwitCap2, or you'll get an error message.
For example, the following works well.
 
       set vn2 pwl  
       4.00000000e-02	-1.52827986e-01	 
       4.00010000e-02	1.06195274e+00	 
       4.00020000e-02	2.56355876e-01	 
       4.00030000e-02	-4.63426956e-01	 
       4.00040000e-02	-3.23330795e-01 
       ; 
       
How can I change the number of digits for output values?
No way. You can't increase or decrease it. It's fixed. There is no command to change the digits, such as NUMDGT option in HSpice.

Can I print out the subcircuits' nodes?
Yes and No. Newer version of SwitCap supports this, but not for our version at OSU. I could print out using V(100.x1) format on HP version, but got an error message on SUN version. It should be safe not to use this cheating.
You can pass the node to the main circuit and print it out at the top level for the version you have. (thanks to Dr. Ken Suyama)

Underscore "_" mystery
Don't use a underscore (_) for a node name. Ruoxin Jiang reported me that he got a "Macro error" using the underscore.

I saw the different thing. In SwitCap2 v1.1 (Nov-01-90) for HP, I couldn't see any error message, but the result is different from the one without underscore. This is much more dangerous than giving an error message.
In SwitCap2 v1.0 (Jan-01-91) for SUN, I got an error with the underscore. I got the same result as HP version without the underscore. Here is my condition for a verification.

The error with the underscore in HP version seems to be accumulated.

Underscore mystery

w/o underscore w/ underscore
v1.1 (Nov-01-90) for HP -1.0958D+01 -1.0849D+01
v1.0 (Jan-01-91) for SUN -1.0958D+01 ERROR
symxtr: missing ')' in S1
The bottom line: don't use the underscore. Error message is much better than a silent mistake.
(thanks to Ruoxin Jiang)

[ Go to TOP of this page ]

Debugging

node name error
Node name which starts from '0' is not allowed, like a (010 020).
You don't receive any error message in the display, but in the output file, you will see it if you have 0X0 node names:
e.g.
When you have 060 node in your circuit block:
 
       C020  ( 10     060)   0.5417; 
       
You will see the error in your output file:
 
       ** ERROR:Connectivity check for switches failed. 
       ** FATAL INTERNAL ERROR IN: BDrmat  ==>Die 
       
Solution
Change node name from 060 to 60.

PRINT statement error
Note the first line of the below error message. You maybe specified open node or undefined node to print out. In the below example, I forgot to erase node 26 in print statement, which was inside comment block.
 
analysis block 1: undefined name ' 26 ' in PRINT 
*** FORTRAN I/O ERROR 933: END (OR BEGIN) OF FILE WITH NO "END=" SPECIFIER 
    FILE: /tmp/SWa15615.SRC, UNIT: 8 
( 0)  0xc087e10c   io_ded + 0x304 
( 1)  0xc08820e8   check_read + 0x60 
( 2)  0xc0882588   read_to_newline + 0x2d0 
( 3)  0xc0882b40   read_seq_record + 0x28 
( 4)  0xc0882938   new_record + 0xb0 
( 5)  0xc0876648   __F90_START_IO + 0x350 
( 6)  0xc0876e50   FTN_S_RSLE + 0x98 
( 7)  0x000063f8   FTN_S_RSLE + 0x63f9 
( 8)  0x000079b0   bdaflt + 0x13c 
( 9)  0x00006b74   xcntrn + 0xcc 
(10)  0x00005e78   phase2 + 0x4d4 
(11)  0x000045cc   sw2 + 0xb4                       
       
tok2mac: syntax: CAPACITANCE
I got this error when I insert an apostrophe (') in the TITLE. Of couse, there is no capacitor in the title, but ... :-)

zapcom: unexpected end of file
I got this error when I have an apostrophe (') in the comment block. Even though in the commment, don't use the apostrophe (')! Don't ask me what zapcom means. Zzz... APostrophe in COMments?!

[ TOP ] | [ LaTeX Tips ] | [ MATLAB Tips ] | [ HSPICE Tips ] | [ SwitCap2 Tips ] | [ SwitCap3 Tips ]
Comments? Email to Testuya Kajita

Last modified: Mon Mar 15 09:48:18 1999