Yueting Li
04/04/2022, 5:40 AMproc shift_to_center {} {
set res1 [box size]
move [expr {-[lindex $res1 0] / 2}]i [expr {-[lindex $res1 1] / 2}]i
}
proc place_pmos {x_center y_center index {m 1}} {
select clear
puts "index: $index"
puts "m: $m"
puts "x_center: $x_center"
puts "y_center: $y_center"
box [expr $x_center]um [expr $y_center]um [expr $x_center]um [expr $y_center]um
set parameters [sky130::sky130_fd_pr__pfet_01v8_lvt_defaults]
# customize m
if {$m} {dict set paramete m $m}
puts "cell_parameter: $parameters"
magic::gencell sky130_fd_pr__pfet_01v8_lvt [format "xm%d" $index] $parameters
shift_to_center
}
While source functions.tcl and put in "place_pmos 100 100 1 2", I got below error in magic, I wonder why default parameters couldn't work. Do you have any suggestions?Tim Edwards
04/04/2022, 12:36 PMif {$m} {dict set paramete m $m}
.Yueting Li
04/04/2022, 10:29 PMif {$m} {dict set parameters m $m}
, the same error persistsTim Edwards
04/05/2022, 1:44 AMgencell(...)
call has arguments gencell_name instance_name parameter0_name value0 parameter1_name value1 . . .
, so the parameters are given to the function in expanded form, not as a dictionary. If you have a dictionary already, then you want to expand it by doing: eval magic::gencell sky130::sky130_fd_pr__ pfet_01v8_lvt [format "xm$d" $index] $parameters
. Note that in addition to needing to preface the statement with eval
, I also need to give the fully-qualified name with namespace sky130::
, because the routine picks up the library name from that prefix.Yueting Li
04/05/2022, 7:50 AMTim Edwards
04/05/2022, 12:08 PMtclck/tookit.tcl
(the same script that defines the gencell
procedure), there is a procedure called netlist_to_layout
that is probably the most relevant. The Sky130 PDK for magic installs the File -> Import SPICE
menu item, which invokes the netlist_to_layout
procedure, which places cells, creates pins, and generates a subcircuit hierarchy from a SPICE netlist.Yueting Li
04/05/2022, 4:29 PMLinen is a search-engine friendly community platform. We offer integrations with existing Slack/Discord communities and make those conversations Google-searchable.
Powered by