|
楼主 |
发表于 2025-9-10 11:47:23
|
显示全部楼层
# ---- SVRF header ----
SOURCE PATH "src.net"
SOURCE PRIMARY "TOP"
SOURCE SYSTEM SPICE
PERC REPORT "perc.rep"
PERC NETLIST SOURCE
MASK SVDB DIRECTORY "svdb" QUERY
# Load TVF: init then rule
PERC LOAD aerc INIT init_pad_through_R SELECT rule_gate_to_pad
# ---- TVF / Tcl ----
TVF FUNCTION aerc {} {
package require CalibreLVS_PERC
# Define PAD nets and resistor-only path
proc init_pad_through_R {} {
perc::define_net_type PAD {lvsTopPorts}
perc::create_net_path -type {R} -pin {p n}
# If you must enforce R >= 100 Ω, use:
# perc::create_net_path -type {R} -property {r >= 100} -pin {p n}
}
# Select MOS whose gate path can reach PAD, then collect PAD names
proc rule_gate_to_pad {} {
perc::check_device -type {MN MP} \
-pinPathType {{g} {PAD}} \
-condition gate_to_pad_report \
-comment "Gate→R→PAD: list PAD names"
}
proc gate_to_pad_report {dev} {
set gnet [perc::get_nets [perc::get_pins $dev -name g]]
set top_ports [perc::expand_list lvsTopPorts -type net]
set heads [perc::name $gnet -fromTop -pathHead]
set pads {}
foreach h $heads { if {[lsearch -exact $top_ports $h] >= 0} { lappend pads $h } }
if {[llength $pads] > 0} {
puts [format "DEV=%s GATE->R->PAD: %s "[perc::name $dev] [join $pads ", "]]
return 1
}
return 0
}
} 花了半天整出来的代码,不知道有没有简单的方式,我刚入门,不太熟 |
|