bullet proof for missing tcl unknown proc
This commit is contained in:
parent
895c4c97c1
commit
a8e15ae64f
|
|
@ -117,8 +117,7 @@ staTclAppInit(Tcl_Interp *interp)
|
||||||
|
|
||||||
// Import exported commands from sta namespace to global namespace.
|
// Import exported commands from sta namespace to global namespace.
|
||||||
Tcl_Eval(interp, "sta::define_sta_cmds");
|
Tcl_Eval(interp, "sta::define_sta_cmds");
|
||||||
const char *export_cmds = "namespace import sta::*";
|
Tcl_Eval(interp, "namespace import sta::*");
|
||||||
Tcl_Eval(interp, export_cmds);
|
|
||||||
|
|
||||||
if (!findCmdLineFlag(argc, argv, "-no_init"))
|
if (!findCmdLineFlag(argc, argv, "-no_init"))
|
||||||
sourceTclFileEchoVerbose(init_filename, interp);
|
sourceTclFileEchoVerbose(init_filename, interp);
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,8 @@ Graph::vertexAndEdgeCounts(const Instance *inst,
|
||||||
while (set_iter.hasNext()) {
|
while (set_iter.hasNext()) {
|
||||||
TimingArcSet *arc_set = set_iter.next();
|
TimingArcSet *arc_set = set_iter.next();
|
||||||
LibertyPort *to_port = arc_set->to();
|
LibertyPort *to_port = arc_set->to();
|
||||||
if (network_->findPin(inst, to_port)) {
|
if (network_->findPin(inst, to_port)
|
||||||
|
&& filterEdge(arc_set)) {
|
||||||
if (dir->isBidirect()) {
|
if (dir->isBidirect()) {
|
||||||
// Internal path from bidirect output back into the instance.
|
// Internal path from bidirect output back into the instance.
|
||||||
edge_count += 2;
|
edge_count += 2;
|
||||||
|
|
@ -285,9 +286,10 @@ Graph::makePortInstanceEdges(const Instance *inst,
|
||||||
TimingArcSet *arc_set = timing_iter.next();
|
TimingArcSet *arc_set = timing_iter.next();
|
||||||
LibertyPort *from_port = arc_set->from();
|
LibertyPort *from_port = arc_set->from();
|
||||||
LibertyPort *to_port = arc_set->to();
|
LibertyPort *to_port = arc_set->to();
|
||||||
if (from_to_port == nullptr
|
if ((from_to_port == nullptr
|
||||||
|| from_port == from_to_port
|
|| from_port == from_to_port
|
||||||
|| to_port == from_to_port) {
|
|| to_port == from_to_port)
|
||||||
|
&& filterEdge(arc_set)) {
|
||||||
Pin *from_pin = network_->findPin(inst, from_port);
|
Pin *from_pin = network_->findPin(inst, from_port);
|
||||||
Pin *to_pin = network_->findPin(inst, to_port);
|
Pin *to_pin = network_->findPin(inst, to_port);
|
||||||
if (from_pin && to_pin) {
|
if (from_pin && to_pin) {
|
||||||
|
|
|
||||||
|
|
@ -220,6 +220,8 @@ protected:
|
||||||
void deleteFloats(float *floats,
|
void deleteFloats(float *floats,
|
||||||
ObjectIndex count);
|
ObjectIndex count);
|
||||||
void removeDelayAnnotated(Edge *edge);
|
void removeDelayAnnotated(Edge *edge);
|
||||||
|
// User defined predicate to filter graph edges for liberty timing arcs.
|
||||||
|
virtual bool filterEdge(TimingArcSet *) const { return true; }
|
||||||
|
|
||||||
VertexPool *vertices_;
|
VertexPool *vertices_;
|
||||||
EdgePool *edges_;
|
EdgePool *edges_;
|
||||||
|
|
|
||||||
11
tcl/Util.tcl
11
tcl/Util.tcl
|
|
@ -391,10 +391,19 @@ proc check_percent { cmd_arg arg } {
|
||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# The builtin Tcl "source" and "unknown" commands are redefined by sta.
|
# 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.
|
# command.
|
||||||
rename source builtin_source
|
rename source builtin_source
|
||||||
|
|
||||||
|
# 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
|
rename unknown builtin_unknown
|
||||||
|
}
|
||||||
|
|
||||||
# Numeric expressions eval to themselves so braces aren't required
|
# Numeric expressions eval to themselves so braces aren't required
|
||||||
# around bus names like foo[2] or foo[*].
|
# around bus names like foo[2] or foo[*].
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue