HSPICE 入門教學
Read me
概述hspice一些基礎用法,同學可以大致瀏覽,了解hspice的程式邏輯,不用全部背起來,日後有需要再來查找。
這邊只有少部分的基礎用法,同學若想進一步了解,建議善用google搜尋,或是閱讀HSPICE使用手冊,可以得到最完整的答案。
Circuit file
如何透過 hspice描述一個子電路
檔案命名: 通常我們會將子電路寫在ooo.cir的檔案中 (ooo可隨意命名)
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
hspice中的 * 或 $ 後為註解。
在hspice中,code沒有大小寫之分。
代號後面緊接著是命名。比如我想命名一個叫做 soonj 的電晶體,就可以寫成 msoonj。
- example 1: inverter.cir
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- example 2: RC_circuit.cir
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Testbench file
如何測試我們寫好的電路
檔案命名:通常我們會將Testbench file寫在ooo.sp的檔案中(ooo可隨意命名)
宣告subckt時,可在後面加入 m=[multiply],意即 並聯 多少個。
ex: 並聯4個單位的inverter
1. 電壓源的設定
HSPICE有主要四種電壓源,分別是DC, Pulse, Sinusoidal, 和Piecewise Linear。
電壓元的代號是 V,後面接著電壓源的名字。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
2. 模擬的設定
HSPICE有主要三種模擬,分別為AC, DC, 和Transient
AC: 交流分析,屬於小訊號分析,分析電路在頻域上的表現,如波德圖。 (本課程中不會用到)
- DC: 穩態分析。
- Tran: 暫態分析,屬於大訊號分析,分析電路在時域上的表現,最貼近真實的電路運作狀況。
3. 量測的設定
模擬之後會產生出波形,可以針對產生的波形進行量測,量測有兩種方式:
- 使用語法進行量測,量測結果儲存於ooo.mx0檔案中 (x取決於跑什麼類型的模擬)
- DC: ooo.ms0
- AC: ooo.ma0
- Tran: ooo.mt0
- 使用看圖軟體(Waveview)將模擬結果的波形檔案打開,使用Waveview中的tool進行量測。
- DC: ooo.sw0
- AC: ooo.ac0
- Tran: ooo.tr0
IC Designer通常會兩種方式併用,使用Waveview看波形可以快速確認電路function,使用語法量測則能幫助我們同時量測大量資料,以便後續使用Matlab、Excel等軟體進行分析。以下先針對語法量測說明,Waveview使用會在下一部分介紹。
1. meas
有時我們會想要量測電路運作時的一些資訊,可藉由".meas"來進行量測

2. print
有時我們會自己定義一些參數,可以使用".print"將參數印出在模擬結果波形檔中以便分析
範例:量測VDS電壓變化對NMOS關閉阻抗Roff的曲線

Terminal Command
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
如果跑模擬出現 hspice job aborted,請開啟 [output_file_name].lis 來debug。
以'print'教學範例為例

Waveview
以下介紹一些常用的Waveview功能
以'print'教學範例為例






Appendix
Element |
Symbol |
Resistor |
r |
Capacitor |
c |
Inductor |
l |
MOSFET |
m |
Sub-circuit |
x |
Voltage source |
v |
Current source |
i |
Scale Factor |
Symbol |
1e-15 |
f |
1e-12 |
p |
1e-9 |
n |
1e-6 |
u |
1e-3 |
m |
1e3 |
k |
1e6 |
meg |
1e9 |
g |
1e12 |
t |