# VLSI HW3 姓名:劉祐瑋 學校:國立清華大學 學號:110020015 ## 目錄 - [完成度](#完成度) - [環境設定](#環境設定) - [基本操作參考資料](#基本操作參考資料) - [HW3_DFF操作過程](#HW3_DFF操作過程) - [HW3_MUX操作過程](#HW3_MUX操作過程) - [HW3_bonud操作過程](#HW3_bonus操作過程) - [The hardness in this assignment](#The_hardness_in_this_assignment) - [Conclusion_and_Feedback](#Conclusion_and_Feedback) - [Reference](#Reference) ## 完成度 HW3_DFF: 100% 完成 HW3_MUX: 100% 完成 HW3_bonus: 100% 完成 ## 環境設定 首先利用Mobaxterm連接至學校工作站。 ![](https://hackmd.io/_uploads/Bkx9YdpW6.png =40%x) 緊接著連線到機台(X記得要大寫,不然無法使用wv) ``` ssh -X ic53 ``` 再來初始化source,等等才能使用hspice、waveview以及Virtuoso ``` source /users/cad/synopsys/CIC/hspice.cshrc source /users/cad/synopsys/CIC_new/customexplorer.cshrc source /users/cad/cadence/CIC/ic.cshrc source /users/cad/mentor/CIC/calibre.cshrc ``` 設定 Rule.rce 裡的 Rule_20KA.rc 和 Rule_08KA.rc 這兩個檔要改成絕對路徑(約在 300 多行左右)。 ## 基本操作參考資料 sp檔指令說明: https://hackmd.io/Y92TbIvNTYCb0o3FEj1ftg#sp%E6%AA%94%E6%8C%87%E4%BB%A4%E8%AA%AA%E6%98%8E virtuoso 操作說明:如eeclass上課ppt說明(https://eeclass.nthu.edu.tw/course/homework/28815) ## HW3_DFF操作過程 設計圖: ![image](https://hackmd.io/_uploads/SkcZq3EIa.png) 設計要求: - The clock signal has a 50% duty cycle and operates at 100 M Hz. The D signal has a 50% duty cycle and operates at 50 M Hz. - At the beginning, the delay of clock signal should be set to 0ns, and the D signal should be delayed by 5ns. - Set the rise/fall time of the input signals to 100ps. - The highest logic level for all outputs must be greater than 0.9VDD, while the lowest logic level must be less than 0.1VDD. ### pre_sim part 寫.sp檔 我們先設計nand gate 我們可以根據nmos和pmos原理來設計出nand gate ! ![image](https://hackmd.io/_uploads/Hk3c92EL6.png =30%x) 最後利用code實現上圖 ![image](https://hackmd.io/_uploads/Sy_lohVUT.png =50%x) 接著如設計圖所示我們可以利用呼叫nand來拼出。code如下: ![image](https://hackmd.io/_uploads/ry3So3N8p.png) Simulation: 先在.sp檔中利用X、V指令來呼叫subckt和給予CLK, VDD, D的值,加上模擬方式跟時間。(詳細內容請看 pre_DFF.sp) 接著利用 HSPICE程式產生出相對應的檔案 ``` hspice –i <inputFile.sp> –o <outputFile.lis> ``` 會產生以下五種檔案: - .tr0檔:這是Transient Analysis(瞬態分析)的輸出文件,用於記錄電路在不同時間點上的響應數據,通常是電流和電壓隨時間的變化。 - .st0檔:這是Steady-State Analysis(穩態分析)的輸出文件,用於記錄電路在穩態條件下的狀態,包括節點電壓、電流值等。 - .pa0檔:這是AC Analysis(交流分析)的輸出文件,記錄了電路對不同頻率的交流訊號的反應,通常以振幅和相位的形式表示。 - .lis檔案:這是HSPICE的模擬日誌文件,用於記錄模擬過程中的詳細信息,包括警告、錯誤和其他模擬參數的設定。 - .ic0檔:這是Initial Conditions(初始條件)的輸出文件,用於記錄模擬的初始狀態,包括電路元件的初始電壓和電流值。 其中的.tr0檔可利用waveview觀察波型 ``` wv pre.tr0 & ``` 波型如下: ![image](https://hackmd.io/_uploads/rJ4D22NLp.png) 最後開啟.lis檔觀察power ``` vim pre.lis ``` ![image](https://hackmd.io/_uploads/S1Yo2hE8p.png) 由上圖可知,power為65.5949u ### virtuoso part 我們藉由pre.sim 模擬後可以知道對應的W和L,以及mos連接方式。藉此可以畫出layout如下: ![image](https://hackmd.io/_uploads/rJeWT34Ua.png) 注意:這邊我們使用cell的方式來連接。完整顯示如下: ![image](https://hackmd.io/_uploads/SJkDT2NL6.png) 接者我們要跑DRC(操作過程如講義所述),確定我們設計的形式有符合規範。 結果為: ![image](https://hackmd.io/_uploads/Hk5h62EIp.png =50%x) 通過。 接者要跑LVS(操作過程如講義所述),驗證這個layout產出的積體電路與其原始電路設計 pre.sp 之間的差異有無異常。 結果為: ![image](https://hackmd.io/_uploads/BkTMA2NI6.png =50%x) 通過 最後要跑PEX(操作過程如講義所述),產出我們寫post.sp所需要的檔: - hw3_DFF.pex.netlist.pex - hw3_DFF.pex.netlist - hw3_DFF.pex.netlist.HW3_DFF.pxi 這三個檔描述了電路的樣子。 ### post_sim part 一樣要寫.sp檔然後與pre.sp相似,唯一不同的是我們的.subckt 要改成 layout 所產生的檔,所以不用打.subckt而是要加上.include。 ``` .include "hw3_DFF.pex.netlist 的相對路徑" ``` 接著利用 HSPICE程式產生出相對應的檔案 ``` hspice –i <inputFile.sp> –o <outputFile.lis> ``` 其中的.tr0檔可利用waveview觀察波型 ``` wv post.tr0 & ``` 波型如下: ![image](https://hackmd.io/_uploads/ByKZbpELT.png) 最後開啟.lis檔觀察power ``` vim post.lis ``` ![image](https://hackmd.io/_uploads/HkN1G64Ip.png) 由上圖可知,power約為 86.6506u ### 比較 pre.sim 和 post.sim ![image](https://hackmd.io/_uploads/SJLu-aN86.png) ![image](https://hackmd.io/_uploads/S1E9WT48a.png) 首先兩者都符合DFF邏輯,但可以發現Post波型的部分較慢,我覺得原因可能是virtuoso會考慮寄生電容。 ## HW3_MUX操作過程 設計圖: ![image](https://hackmd.io/_uploads/rJ3GGpEUp.png) 設計要求: - In the design of the 2×1 Multiplexer, the signals A, B, and S has a 50% duty cycle. A operates at 200 M Hz, B at 100MHz, and S at 50M Hz. - The order of input combinations (S, B, A) should match the sequence mentioned in this document. - Set the rise/fall time of the input signals to 100ps - The highest logic level for all outputs must be greater than 0.9VDD, while the lowest logic level must be less than 0.1VDD. - Delay1_MUX represents the delay when signals A and OUT are falling, while Delay2_MUX represents the delay when signals A and OUT are rising. Both Delay1_MUX and Delay2_MUX must be less than 300ps, and the difference in delay between them should not exceed 50ps. ### pre_sim part 我們先設計nand gate 我們可以根據nmos和pmos原理來設計出nand gate ! ![image](https://hackmd.io/_uploads/Hk3c92EL6.png =40%x) 最後利用code實現上圖 ![image](https://hackmd.io/_uploads/Sy_lohVUT.png) 接著如設計圖所示我們可以利用呼叫nand以及INV(不是call的形式)來拼出。code如下: ![image](https://hackmd.io/_uploads/ry56GaVUT.png) Simulation: 先在.sp檔中利用X、V指令來呼叫subckt和給予A, B, S, VDD的值,加上模擬方式跟時間。(詳細內容請看 pre_MUX.sp) 接著利用 HSPICE程式產生出相對應的檔案 ``` hspice –i <inputFile.sp> –o <outputFile.lis> ``` 其中的.tr0檔可利用waveview觀察波型 ``` wv pre_bonus.tr0 & ``` 波型如下: ![image](https://hackmd.io/_uploads/HJ-3m648p.png) 有符合MUX波型s=0時,OUT=A;s=1時,OUT=B。 最後開啟.lis檔有沒有符合設計規範c ``` vim pre_bonus.lis ``` ![image](https://hackmd.io/_uploads/SJXLNa4Ua.png) 由上圖可知 Delay1_MUX=200.1821ps Delay2_MUX=165.3239ps |Delay2_MUX-Delay1_MUX|=34.8582ps 符合設計要求 ### virtuoso part 我們藉由pre.sim 模擬後可以知道對應的W和L,以及mos連接方式。藉此可以畫出layout如下: ![image](https://hackmd.io/_uploads/rkR1S6VUa.png) 注意:這邊我們使用cell的方式來連接。完整顯示如下: ![image](https://hackmd.io/_uploads/S1VGSpVUa.png) 接者我們要跑DRC(操作過程如講義所述),確定我們設計的形式有符合規範。 結果為: ![image](https://hackmd.io/_uploads/B1GnSa4I6.png =50%x) 通過。 接者要跑LVS(操作過程如講義所述),驗證這個layout產出的積體電路與其原始電路設計 pre.sp 之間的差異有無異常。 結果為: ![image](https://hackmd.io/_uploads/r1KxIpEIp.png =50%x) 通過 最後要跑PEX(操作過程如講義所述),產出我們寫post.sp所需要的檔: - hw3_MUX.pex.netlist.pex - hw3_MUX.pex.netlist - hw3_MUX.pex.netlist.HW3_MUX.pxi 這三個檔描述了電路的樣子。 ### post_sim part 一樣要寫.sp檔然後與pre_bonus.sp相似,唯一不同的是我們的.subckt 要改成 layout 所產生的檔,所以不用打.subckt而是要加上.include。 ``` .include "hw3_MUX.pex.netlist 的相對路徑" ``` 接著利用 HSPICE程式產生出相對應的檔案 ``` hspice –i <inputFile.sp> –o <outputFile.lis> ``` 其中的.tr0檔可利用waveview觀察波型 ``` wv post_bonus.tr0 & ``` 波型如下: ![image](https://hackmd.io/_uploads/Hyoo8pVUa.png) 有符合MUX波型s=0時,OUT=A;s=1時,OUT=B。 最後開啟.lis檔有沒有符合設計規範c ``` vim pre_bonus.lis ``` ![image](https://hackmd.io/_uploads/HynVvpVUa.png) 由上圖可知 Delay1_MUX=255.1252ps Delay2_MUX=236.5480ps |Delay2_MUX-Delay1_MUX|=18.5772ps 符合設計要求 ### 比較 pre.sim 和 post.sim ![image](https://hackmd.io/_uploads/rJ61waEI6.png) ![image](https://hackmd.io/_uploads/HkYeva48a.png) 首先兩者都符合MUX邏輯,但可以發現Post波型的部分較慢,我覺得原因可能是virtuoso會考慮寄生電容。 ## HW3_bonus操作過程 設計圖: ![image](https://hackmd.io/_uploads/S1hFEA4UT.png =30%x) 設計要求: - In the design of the 2×1 Multiplexer, the signals A, B, and S has a 50% duty cycle. A operates at 200 M Hz, B at 100MHz, and S at 50M Hz. - The order of input combinations (S, B, A) should match the sequence mentioned in this document. - Set the rise/fall time of the input signals to 100ps - The highest logic level for all outputs must be greater than 0.9VDD, while the lowest logic level must be less than 0.1VDD. - Delay1_MUX represents the delay when signals A and OUT are falling, while Delay2_MUX represents the delay when signals A and OUT are rising. Both Delay1_MUX and Delay2_MUX must be less than 300ps, and the difference in delay between them should not exceed 50ps. ### pre_sim part 如設計圖所示我們可以利用nmos和pmos拼出。code如下: ![image](https://hackmd.io/_uploads/H1dRNAVUp.png) Simulation: 先在.sp檔中利用X、V指令來呼叫subckt和給予A, B, S, VDD的值,加上模擬方式跟時間。(詳細內容請看 pre_bonus.sp) 接著利用 HSPICE程式產生出相對應的檔案 ``` hspice –i <inputFile.sp> –o <outputFile.lis> ``` 其中的.tr0檔可利用waveview觀察波型 ``` wv pre_bonus.tr0 & ``` 波型如下: ![image](https://hackmd.io/_uploads/Hyy8rA486.png) 有符合MUX波型s=0時,OUT=A;s=1時,OUT=B。 最後開啟.lis檔有沒有符合設計規範c ``` vim pre_bonus.lis ``` ![image](https://hackmd.io/_uploads/ByLvH048T.png) 由上圖可知 Delay1_MUX=65.4778ps Delay2_MUX=59.6232ps |Delay2_MUX-Delay1_MUX|=5.8546ps 符合設計要求 ### virtuoso part 我們藉由pre.sim 模擬後可以知道對應的W和L,以及mos連接方式。藉此可以畫出layout如下: ![image](https://hackmd.io/_uploads/Skw8rt_Ia.png) 接者我們要跑DRC(操作過程如講義所述),確定我們設計的形式有符合規範。 結果為: ![image](https://hackmd.io/_uploads/By9tBtOL6.png =50%x) 通過。 接者要跑LVS(操作過程如講義所述),驗證這個layout產出的積體電路與其原始電路設計 pre.sp 之間的差異有無異常。 結果為: ![image](https://hackmd.io/_uploads/SyY0BFO8p.png =50%x) 通過 最後要跑PEX(操作過程如講義所述),產出我們寫post.sp所需要的檔: - hw3_bonus.pex.netlist.pex - hw3_bonus.pex.netlist - hw3_bonus.pex.netlist.HW3_BONUS.pxi 這三個檔描述了電路的樣子。 ### post_sim part 一樣要寫.sp檔然後與pre_bonus.sp相似,唯一不同的是我們的.subckt 要改成 layout 所產生的檔,所以不用打.subckt而是要加上.include。 ``` .include "hw3_bonus.pex.netlist 的相對路徑" ``` 接著利用 HSPICE程式產生出相對應的檔案 ``` hspice –i <inputFile.sp> –o <outputFile.lis> ``` 其中的.tr0檔可利用waveview觀察波型 ``` wv post_bonus.tr0 & ``` 波型如下: ![image](https://hackmd.io/_uploads/SkZTNFuIp.png) 有符合MUX波型s=0時,OUT=A;s=1時,OUT=B。 最後開啟.lis檔有沒有符合設計規範c ``` vim post_bonus.lis ``` ![image](https://hackmd.io/_uploads/rJbxrF_La.png) 由上圖可知 Delay1_MUX=67.8576ps Delay2_MUX=63.5324ps |Delay2_MUX-Delay1_MUX|=4.3252ps 符合設計要求 ### 比較 pre.sim 和 post.sim ![image](https://hackmd.io/_uploads/By8BIKdLT.png) ![image](https://hackmd.io/_uploads/SJsUIYOUT.png) 首先兩者都符合MUX邏輯,但可以發現Post波型的部分較慢,我覺得原因可能是virtuoso會考慮寄生電容。 ## The_hardness_in_this_assignment 雖然完成了本次HW3,但在這次的設計中也遇到幾個困難如下: - power 問題:我們必須考慮power要完美那就要設計得非常剛好,不能隨便的設計,不過我也還沒有抓到訣竅。 - layout 繞線的部分很重要,我們可以同樣的cell可能in 、out位置要不一樣,才可能比較好繞線。 ## Conclusion_and_Feedback 從這次的作業,我學到了virtuoso把已經畫好的cell直接拿來用,這樣就不用一直重複畫可以簡單的畫好。 ## Reference workbook- https://eeclass.nthu.edu.tw/course/homework/30254 HackMD- https://hackmd.io/@you8132