3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-11-26 23:39:51 +00:00

sdc: error on unknown getters

This commit is contained in:
Emil J. Tywoniak 2025-10-09 20:55:15 +02:00
parent 229123eb87
commit 920f4793fb
4 changed files with 60 additions and 7 deletions

View file

@ -1,4 +1,21 @@
proc unknown {args} {
# 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
global sdc_call_index
global sdc_calls
if {![info exists sdc_call_index]} {
@ -15,4 +32,11 @@ proc unknown {args} {
}
proc list {args} {
return [unknown "list" {*}$args]
}
}
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]
}