Add carry_cyinit_mux.tcl

Signed-off-by: Clifford Wolf <clifford@clifford.at>
Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
This commit is contained in:
Clifford Wolf 2017-10-13 16:41:21 +02:00
parent e4104f6da9
commit e91686fdd7
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
# set carry_cell [lindex [get_cells -hierarchical -filter {REF_NAME == CARRY4}] 0]
proc get_carry_cyinit_mux_cfg {carry_cell} {
set cyinit_pin [get_pins -of_objects $carry_cell -filter {REF_PIN_NAME == CYINIT}]
set cyinit_net [get_nets -quiet -of_objects $cyinit_pin]
if {[string last "<const0>" $cyinit_net] > 0} { return "zero" }
if {[string last "<const1>" $cyinit_net] > 0} { return "one" }
set cin_pin [get_site_pins -of_objects [get_sites -of_objects $carry_cell] */CIN]
set cin_net [get_nets -quiet -of_objects $cin_pin]
if {"$cyinit_net" == "$cin_net"} { return "cin" }
set ax_pin [get_site_pins -of_objects [get_sites -of_objects $carry_cell] */AX]
set ax_net [get_nets -quiet -of_objects $ax_pin]
if {"$cyinit_net" == "$ax_net"} { return "ax" }
return "unknown"
}
proc list_carry_cyinit_mux_cfg {} {
foreach carry_cell [get_cells -hierarchical -filter {REF_NAME == CARRY4}] {
puts "[get_bels -of_objects $carry_cell] [get_carry_cyinit_mux_cfg $carry_cell]"
}
}