简体   繁体   中英

Call Interactive Mode of HSPICE in Python

I want to efficiently call HSPICE in Python. My final goal is speedup in my simulations (I have millions of it).

If I call HSPICE directly in shell:

hspice a1.sp                // method 1
hspice a2.sp
...

or

hspice -I -L xxx.txt       // method 2

Example of xxx.txt:

load a1.sp
run
load a2.sp
run
...
quit

The difference is that method 1 checks HSPICE's license each time, but method 2 uses interactive mode ( -I ) and it checks the license one time, so it is more time efficient.

I want to call HSPICE in Python to automate my simulation process:

Method 1 works, but method 2 has problem. In other words:

os.system('hspice yyy.sp')           // it works

However, when I use os.system, subprocess.call or subprocess.Popen, I cannot run it. For example,

args = ['hspice64', '-I', '-L', 'xxx.txt']
subprocess.Popen(args)

or

os.system('hspice64 -I -L xxx.txt')          

It will stuck after Hspice license have checked out . The HSICE simulation is not done (thus, the whole simulation does not end)
Does any one have any idea what is happening and how can I solve it?

一种解决方法是编写shell脚本来自动执行交互式HSPICE调用。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM