diff --git a/tcl/Cmds.tcl b/tcl/Cmds.tcl index 63b2551d..6e162be8 100644 --- a/tcl/Cmds.tcl +++ b/tcl/Cmds.tcl @@ -1795,6 +1795,8 @@ proc get_property_cmd { cmd type_key cmd_args } { return [edge_property $object $attr] } elseif { $object_type == "PathEnd" } { return [path_end_property $object $attr] + } elseif { $object_type == "PathRef" } { + return [path_ref_property $object $attr] } else { sta_error "$cmd unsupported object type $object_type." } @@ -1838,7 +1840,9 @@ proc edge_property { edge property } { } proc path_end_property { path_end property } { - if { $property == "startpoint" } { + if { $property == "points" } { + return [$path_end points] + } elseif { $property == "startpoint" } { return [$path_end startpoint] } elseif { $property == "startpoint_clock" } { return [$path_end startpoint_clock] @@ -1855,6 +1859,20 @@ proc path_end_property { path_end property } { } } +proc path_ref_property { path property } { + if { $property == "pin" } { + return [$path pin] + } elseif { $property == "arrival" } { + return [time_sta_ui [$path arrival]] + } elseif { $property == "required" } { + return [time_sta_ui [$path required]] + } elseif { $property == "slack" } { + return [time_sta_ui [$path slack]] + } else { + return "" + } +} + proc get_object_type { obj } { set object_type [object_type $obj] if { $object_type == "Clock" } { diff --git a/tcl/StaTcl.i b/tcl/StaTcl.i index b21b2534..ff9244d5 100644 --- a/tcl/StaTcl.i +++ b/tcl/StaTcl.i @@ -1808,6 +1808,22 @@ using namespace sta; Tcl_SetObjResult(interp, obj); } +%typemap(out) PathRefSeq* { + Tcl_Obj *obj = SWIG_NewInstanceObj($1, $1_descriptor, false); + Tcl_SetObjResult(interp, obj); + + Tcl_Obj *list = Tcl_NewListObj(0, NULL); + PathRefSeq *paths = $1; + PathRefSeq::Iterator path_iter(paths); + while (path_iter.hasNext()) { + PathRef *path = &path_iter.next(); + Tcl_Obj *obj = SWIG_NewInstanceObj(path, SWIGTYPE_p_PathRef, false); + Tcl_ListObjAppendElement(interp, list, obj); + } + delete paths; + Tcl_SetObjResult(interp, list); +} + %typemap(out) MinPulseWidthCheck* { Tcl_Obj *obj = SWIG_NewInstanceObj($1, $1_descriptor, false); Tcl_SetObjResult(interp, obj); @@ -6289,6 +6305,20 @@ endpoint_clock_pin() return self->targetClkPath()->pin(sta); } +PathRefSeq * +points() +{ + Sta *sta = Sta::sta(); + PathExpanded expanded(self->path(), sta); + PathRefSeq *paths = new PathRefSeq; + for (int i = expanded.startIndex(); i < expanded.size(); i++) { + PathRef *path = expanded.path(i); + PathRef *copy = new PathRef(path); + paths->push_back(copy); + } + return paths; +} + } %extend MinPulseWidthCheckSeqIterator { @@ -6312,6 +6342,20 @@ required() return delayAsFloat(self->required(sta)); } +float +slack() +{ + Sta *sta = Sta::sta(); + return delayAsFloat(self->slack(sta)); +} + +Pin * +pin() +{ + Sta *sta = Sta::sta(); + return self->pin(sta); +} + TmpPinSeq * pins() {