diff --git a/CMakeLists.txt b/CMakeLists.txt index 545c6ca1..6f448347 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -496,6 +496,11 @@ set_property(SOURCE ${STA_SWIG_FILE} -I${STA_HOME}/verilog ) +set_property(SOURCE ${STA_SWIG_FILE} + PROPERTY DEPENDS + ${STA_HOME}/tcl/Exception.i +) + swig_add_library(sta_swig LANGUAGE tcl TYPE STATIC diff --git a/search/Property.cc b/search/Property.cc index 549a7a58..4226cc6d 100644 --- a/search/Property.cc +++ b/search/Property.cc @@ -92,7 +92,7 @@ PropertyUnknown::PropertyUnknown(const char *type, const char * PropertyUnknown::what() const noexcept { - return stringPrint("Error: %s objects do not have a %s property.", + return stringPrint("%s objects do not have a %s property.", type_, property_); } diff --git a/search/WritePathSpice.cc b/search/WritePathSpice.cc index a8c8f2e2..5664ddf6 100644 --- a/search/WritePathSpice.cc +++ b/search/WritePathSpice.cc @@ -239,7 +239,7 @@ SubcktEndsMissing::SubcktEndsMissing(const char *cell_name, const char *subckt_filename) : Exception() { - what_ = "Error: spice subckt for cell "; + what_ = "spice subckt for cell "; what_ += cell_name; what_ += " missing .ends in "; what_ += subckt_filename; diff --git a/tcl/Exception.i b/tcl/Exception.i index 717e01f0..d4f8cb67 100644 --- a/tcl/Exception.i +++ b/tcl/Exception.i @@ -25,7 +25,7 @@ exit(0); } catch (std::exception &excp) { - Tcl_SetResult(interp, const_cast(excp.what()), TCL_VOLATILE); + Tcl_AppendResult(interp, "Error: ", excp.what(), nullptr); return TCL_ERROR; } } diff --git a/tcl/Util.tcl b/tcl/Util.tcl index 0d2bb637..f8f1c929 100644 --- a/tcl/Util.tcl +++ b/tcl/Util.tcl @@ -90,7 +90,7 @@ proc check_for_key_args { cmd arg_var } { while { $args != "" } { set arg [lindex $args 0] if { [is_keyword_arg $arg] } { - sta_warn "$cmd $arg is not a known keyword or flag." + sta_error "$cmd $arg is not a known keyword or flag." } else { lappend args_rtn $arg } diff --git a/util/Error.cc b/util/Error.cc index 460af3fb..0215781e 100644 --- a/util/Error.cc +++ b/util/Error.cc @@ -58,7 +58,7 @@ FileNotReadable::FileNotReadable(const char *filename) : const char * FileNotReadable::what() const noexcept { - return stringPrintTmp("Error: cannot read file %s.", filename_); + return stringPrintTmp("cannot read file %s.", filename_); } FileNotWritable::FileNotWritable(const char *filename) : @@ -69,7 +69,7 @@ FileNotWritable::FileNotWritable(const char *filename) : const char * FileNotWritable::what() const noexcept { - return stringPrintTmp("Error: cannot write file %s.", filename_); + return stringPrintTmp("cannot write file %s.", filename_); } } // namespace