diff --git a/app/StaMain.cc b/app/StaMain.cc index 6cb54604..2366fc5e 100644 --- a/app/StaMain.cc +++ b/app/StaMain.cc @@ -117,8 +117,7 @@ staTclAppInit(Tcl_Interp *interp) // Import exported commands from sta namespace to global namespace. Tcl_Eval(interp, "sta::define_sta_cmds"); - const char *export_cmds = "namespace import sta::*"; - Tcl_Eval(interp, export_cmds); + Tcl_Eval(interp, "namespace import sta::*"); if (!findCmdLineFlag(argc, argv, "-no_init")) sourceTclFileEchoVerbose(init_filename, interp); diff --git a/graph/Graph.cc b/graph/Graph.cc index 333a3d18..6f0eb1ff 100644 --- a/graph/Graph.cc +++ b/graph/Graph.cc @@ -146,7 +146,8 @@ Graph::vertexAndEdgeCounts(const Instance *inst, while (set_iter.hasNext()) { TimingArcSet *arc_set = set_iter.next(); LibertyPort *to_port = arc_set->to(); - if (network_->findPin(inst, to_port)) { + if (network_->findPin(inst, to_port) + && filterEdge(arc_set)) { if (dir->isBidirect()) { // Internal path from bidirect output back into the instance. edge_count += 2; @@ -285,9 +286,10 @@ Graph::makePortInstanceEdges(const Instance *inst, TimingArcSet *arc_set = timing_iter.next(); LibertyPort *from_port = arc_set->from(); LibertyPort *to_port = arc_set->to(); - if (from_to_port == nullptr - || from_port == from_to_port - || to_port == from_to_port) { + if ((from_to_port == nullptr + || from_port == from_to_port + || to_port == from_to_port) + && filterEdge(arc_set)) { Pin *from_pin = network_->findPin(inst, from_port); Pin *to_pin = network_->findPin(inst, to_port); if (from_pin && to_pin) { diff --git a/graph/Graph.hh b/graph/Graph.hh index 393fcc6b..05f79c87 100644 --- a/graph/Graph.hh +++ b/graph/Graph.hh @@ -220,6 +220,8 @@ protected: void deleteFloats(float *floats, ObjectIndex count); void removeDelayAnnotated(Edge *edge); + // User defined predicate to filter graph edges for liberty timing arcs. + virtual bool filterEdge(TimingArcSet *) const { return true; } VertexPool *vertices_; EdgePool *edges_; diff --git a/tcl/Util.tcl b/tcl/Util.tcl index 699a5e36..d1bbf8ab 100644 --- a/tcl/Util.tcl +++ b/tcl/Util.tcl @@ -391,10 +391,19 @@ proc check_percent { cmd_arg arg } { ################################################################ # The builtin Tcl "source" and "unknown" commands are redefined by sta. -# This rename provices a mechanism to refer to the original TCL +# This rename provides a mechanism to refer to the original TCL # command. rename source builtin_source -rename unknown builtin_unknown + +# This seems to be a common build problem. +# It happens with incomplete installs of libtcl that can't find the +# corresponding init.tcl file. +if { [info procs unknown] == {} } { + puts "TCL installation problem. proc unknown not defined. Check tcl_libraries $tcl_libraries for init.tcl" + proc unknown { args } { return -code error "invalid command name" } +} else { + rename unknown builtin_unknown +} # Numeric expressions eval to themselves so braces aren't required # around bus names like foo[2] or foo[*].