yosys/passes/cmds/sdc/graph-stubs.sdc

43 lines
1.4 KiB
Plaintext
Raw Normal View History

2025-07-30 18:51:14 +02:00
proc unknown {args} {
2025-10-09 20:55:15 +02:00
# Check if it's a getter
if {[llength $args] > 0} {
set first_arg [lindex $args 0]
if {[string match "get_*" $first_arg]} {
# It's a getter, has it been redirected from specialized C++ code?
if {[llength $args] > 1} {
set second_arg [lindex $args 1]
if {$second_arg ne "-getter-validated"} {
error "Unknown getter: $first_arg"
}
} else {
error "Unknown getter: $first_arg"
}
}
}
# TODO this safety feature could be optional via a global
2025-07-30 18:51:14 +02:00
global sdc_call_index
global sdc_calls
if {![info exists sdc_call_index]} {
set sdc_call_index 0
}
if {![info exists sdc_calls]} {
set sdc_calls {}
}
2025-08-01 16:33:10 +02:00
set ret "YOSYS_SDC_MAGIC_NODE_$sdc_call_index"
2025-07-30 18:51:14 +02:00
incr sdc_call_index
lappend sdc_calls $args
2025-10-02 16:52:46 +02:00
# puts "unknown $args, returning YOSYS_SDC_MAGIC_NODE_$sdc_call_index"
2025-08-01 16:33:10 +02:00
return $ret
2025-07-31 18:33:20 +02:00
}
proc list {args} {
2025-08-01 16:33:10 +02:00
return [unknown "list" {*}$args]
2025-10-09 20:55:15 +02:00
}
proc get_clocks {args} {
# get_clocks isn't a design object getter
# because clocks aren't design objects, just aliases
# so the referred to clock pin already are being tracked
# as arguments of uninterpreted create_clock command or similar
return [unknown "get_clocks" "-getter-validated" {*}$args]
}