2022年12月14日 星期三

自動修復 Short Error 的程式

以下程式利用 IC Compiler 的 verify_lvs 指令回報發生 short error 的 nets,用 python 將 short nets 擷取出來,將其刪除並重新繞線。反覆執行此流程直到所有 short errors 都被修復為止。

In Tcl File:

proc fix_short_nets {} {
    verify_lvs > lvs_result.txt
    set short_nets [exec python get_short_nets.py lvs_result.txt]
    while {$short_nets != {}} {
        remove_net_routing $short_nets
        route_zrt_eco -nets $short_nets -reroute modified_nets_only
        verify_lvs > lvs_result.txt
        set short_nets [exec python3 get_short_nets.py lvs_result.txt]
    }
}

In Python File:

import sys
short_net_list = []
if len(sys.argv) == 2:
    fname = sys.argv[1]
    with open(fname, "r") as f:
        lines = f.readlines()
        record = 0
        for line in lines:
            if "ERROR :" in line and "nets short together." in line:
                record = 1
            elif line == "\n":
                record = 0
            if record and not "ERROR :" in line:
                net = line.split()[0]
                if net != "VDD" and net != "VSS":
                    short_net_list.append(net)
for net in short_net_list:
    print(net, end = ' ')

沒有留言:

張貼留言