2022年7月21日 星期四

將 APR 後的 gds 檔和 memory 及 analog macro 的 gds 合併

做完 APR 以後,產出的 gds 檔中沒有 memory 和 analog macro 的 layout,需要將這些 macro 的 layout 進行合併,可使用以下指令。

calibredrv -a layout filemerge -smartdiff -rename -preserve merge_filterfile\
    -in top_apr.gds \
    -in memory.gds \
    -in analog_macro.gds \
    -out top_apr_merge.gds \
    -topcell top_apr

-smartdiff
由於在不同的 gds 中可能存在相同名稱的 cell,當合併時會造成某些 cell 被覆蓋掉,加上這個選項,就可以自動辨別 cell 的內容,當 cell 內容不同時會自動重新命名。

-in
定義要被合併的 gds 路徑與檔名。

-out
定義輸出的 gds 的路徑與檔名。

-topcell
指定 top cell 的名稱。

-preserve
在 -preserve 後面的 merge_filterfile 是一個檔案,其內容如下:

analog_macro.gds    analog_macro_module_name  -nohier
memory.gds             memory_module_name            -nohier

由於在原本 APR 後產生的 memory 和 analog macro 要用真實的 layout 換掉,因此在 merge_filter_file 中定義 analog_macro.gds 和 memory.gds 是合併後保留的。

-nohier 表示只有 analog_macro 的最上層 hierarchy 會被強制保留,其它內容還是會透過 smartdiff 進行比對,決定是否需要重新命名。如果沒有加上 -nohier,會造成 memory.gds 或 analog_macro.gds 中的 cell 可能把 top_apr.gds 裡面同名的 cell 覆蓋掉。


將 gate level netlist 轉成 LVS 用的 spice netlist

 

v2lvs -64 -i \
    -v top_apr.v \
    -v memory.v \
    -lsr standard_cell_library.spi \
    -lsr io_cell_library.spi \
    -lsr memory.spi \
    -lsr analog_macro.sp \
    -s standard_cell_library.spi \
    -s io_cell_library.spi \
    -s memory.spi \
    -s analog_macro.sp \
    -o top_apr.sp

-v            將 top module、memory 的 verilog code 加入
-lsr          將 standard cell library、io cell library、memory 和 analog macro 的 spice netlist 加入
-s            在產生的 spice netlist 的一開頭加入 .include 的指令,把需要的檔案引入
-o            定義輸出檔案名稱

如何使 Virtuoso 產生的 netlist pin order 符合 library 中的順序

 

做完 Automatic Placement & Routing (APR) 後,要產生 netlist 進行 LVS。

如果 IC 內部有 analog macro,analog macro 中也有用到 standard cell 的話,可能會發現 virtuoso 轉出的 netlist 中的 pin order 和 standard cell library 中的定義不一致。 

解決方式為:

1. 在執行 virtuoso 的目錄下建立一個名為 .simrc 的檔案

2. 在檔案中加入以下文字 auCdlCDFPinCntrl=t


2021年10月31日 星期日

登山紀錄

 小百岳

[新北] 基隆山 588m

[桃園] 大棟山 405m

[桃園] 石門山 551m

[新竹] 十八尖山 130m

[新竹] 飛鳳山 423m

[新竹] 鵝公髻山 1,579m

[苗栗] 火炎山 596m

[苗栗] 哈堪尼山加里山縱走 2,220m

[高雄] 大社觀音山 177m

其它

[新竹] 觀霧國家森林遊樂區

        榛山步道

        雲霧步道

        觀霧瀑布步道

        檜山巨木群步道

[新竹] 九芎湖步道

[新竹] 五指山橫向登山步道 856m

[新竹] 獅山古道 492m

[台中] 鳶嘴山 2,180m

[台南] 糖子恩山 642m

[高雄] 半屏山 181m


2021年7月31日 星期六

開源IC設計工具

 

Verilog Simulation

安裝 Icarus:         sudo apt-get install iverilog

安裝 GTKWave: sudo apt-get install gtkwave

使用方式:

1. 編譯:                           iverilog -o out test.v

                                           iverilog -o out -s top_module -c file_list.txt

                                           iverilog -o out test.v -Dmacro=value

2. 模擬與產生波形檔:   vvp -n out -lxt2

3. 開啟波形檔:               gtkwave wave.vcd &

testbench 中需加入以下指令以產生波形檔

initial begin

    $dumpfile("wave.vcd");

    $dumpvars;

end



2021年7月22日 星期四

如何針對不同的 net 設置不同的 routing rule

 由於我的晶片內部有 0.9V 和 3.3V 不同的電壓區域,在使用 ICC 進行 routing 時,預設的 minimum spacing 是針對兩條線都是同電壓的情況,假如兩條線不同電壓,他們的 minimum spacing 會稍微大一點。為了避免不同電壓的繞線發生 DRC error,需要針對不同的線設置 routing rule。以下程式先定義一個稱為 MVDD 的 routing rule,將 M1~M5 的 minimum spacing 設定為 0.1um。接下來將此 routing rule 套用到所有連接至 macroA 的 net 上。

define_routing_rule -default_reference_rule -spacings {M1 {0.1} M2 {0.1} M3 {0.1} M4 {0.1} M5 {0.1}} {MVDD}
set_net_routing_rule -rule MVDD [get_nets -of_objects macroA]

如何避免 tap cell 距離 macro 太近

在 ICC 加入 tap cell 時,有時會發生 tap cell 距離 macro 太近,產生 DRC error 的問題。可能是 tap cell 的 nwell 和 macro 內部的 nwell 距離太近。也有可能是 tap cell 的 metal 和 macro 內的 metal 距離太近等。我們可以用 create_placement_blockage 在 macro 周圍設置一個禁止 placement 的區域,就可以避免 tap cell 離 macro 太近。以下的指令是在 macro 周圍 1um 的範圍內設置 placement blockage。

foreach_in_collection z $MACRO_LIST {
    set px1 [expr [lindex [lindex [get_attribute $z bbox] 0] 0]-1]
    set py1 [expr [lindex [lindex [get_attribute $z bbox] 0] 1]-1]
    set px2 [expr [lindex [lindex [get_attribute $z bbox] 1] 0]+1]
    set py2 [expr [lindex [lindex [get_attribute $z bbox] 1] 1]+1]
    create_placement_blockage -type hard -bbox [list $px1 $py1 $px2 $py2]
}