remove autotools/configure support

This commit is contained in:
James Cherry 2019-02-16 12:07:59 -08:00
parent 87e749304f
commit d8146af755
58 changed files with 1643 additions and 971 deletions

29
.gitignore vendored
View File

@ -13,31 +13,13 @@ TAGS
.~lock.*#
.DS_Store
Makefile
Makefile.in
.libs
.deps
/build
/configure
/m4
/compile
/config.h
/config.guess
/config.h.in
/config.log
/config.sub
/config.status
/libtool
/ltmain.sh
/install-sh
/missing
/depcomp
/ylwrap
/aclocal.m4
/autom4te.cache
/stamp-h1
/ylwrap
/debug
/rel
# /util/
/util/StaConfig.hh
# /app/
/app/StaApp_wrap.cc
@ -45,7 +27,6 @@ Makefile.in
/app/sta
/app/sta.exe
/app/sta.dSYM
/app/.dirstamp
# /doc/
/doc/._Sta.docx

View File

@ -1 +0,0 @@
James Cherry, Parallax Software, Inc.

View File

@ -16,7 +16,7 @@
cmake_minimum_required (VERSION 3.9)
project(STA VERSION 2.0.6)
project(STA VERSION 2.0.7)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 11)
@ -436,13 +436,19 @@ set(STA_SWIG_FILES
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads)
set(HAVE_PTHREADS ${CMAKE_USE_PTHREADS_INIT})
if (HAVE_PTHREADS)
set(PTHREADS ${CMAKE_USE_PTHREADS_INIT})
if (PTHREADS)
message(STATUS "Found pthreads")
endif()
# Zlib
include(FindZLIB)
# translate cmake bool to ifdef bool
if (ZLIB_FOUND)
set(ZLIB 1)
else()
set(ZLIB 0)
endif()
################################################################
#
@ -457,12 +463,13 @@ if("${CUDD}" STREQUAL "")
set(CUDD_INCLUDE "")
set(CUDD_LIB "")
set(CUDD_FOUND FALSE)
set(CUDD 0)
else()
set(CUDD_INCLUDE ${CUDD}/include)
find_library(CUDD_LIB NAMES cudd PATHS ${CUDD}/lib)
if (CUDD_LIB)
# CUDD_FOUND referenced by config.h.cmake
set(CUDD_FOUND TRUE)
# CUDD referenced by StaConfig.hh.cmake
set(CUDD 1)
message(STATUS "CUDD library: ${CUDD_LIB}")
endif()
endif()
@ -473,8 +480,8 @@ endif()
message(STATUS "Enable SSTA: ${SSTA}")
# configure a header file to pass some of the CMake settins
configure_file(${STA_HOME}/config.h.cmake
${STA_HOME}/config.h
configure_file(${STA_HOME}/util/StaConfig.hh.cmake
${STA_HOME}/util/StaConfig.hh
)
@ -651,7 +658,6 @@ set(STA_INCLUDE_DIRS
search
util
verilog
. # config.h
${TCL_HEADER_DIR}
${CUDD_INCLUDE}
)

16
COPYING
View File

@ -1,16 +0,0 @@
# OpenSTA, Static Timing Analyzer
# Copyright (c) 2019, Parallax Software, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

View File

@ -1,11 +0,0 @@
OpenSTA Static Timing Analyzer Release Notes
--------------------------------------------
This file summarizes user visible changes for each release.
Release 2.0 2018/06/27
----------------------
# Local Variables:
# mode:text
# End:

View File

@ -1 +0,0 @@
See README.MD for installation instructions.

View File

@ -1,35 +0,0 @@
# OpenSTA, Static Timing Analyzer
# Copyright (c) 2019, Parallax Software, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
ACLOCAL_AMFLAGS = -I m4
# app has to follow all library subdirs
SUBDIRS = $(STA_SUBDIRS)
libs:
for subdir in $(SUBDIRS); do \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) libs); \
done
include_HEADERS = config.h
# The automake target uses include directives, which don't work in xemacs.
xtags:
rm -rf TAGS; \
for subdir in $(SUBDIRS); do \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) xtags); \
done

1
NEWS
View File

@ -1 +0,0 @@
See doc/BugLog for bug fixes in this release.

1
README
View File

@ -1 +0,0 @@
See README.MD

View File

@ -53,7 +53,7 @@ See doc/OpenSTA.pdf for complete documentiaton.
## Getting Started
OpenSTA can be run as a [Docker](https://www.docker.com/) container
or built as local executable with CMake or Autotools.
or built as local executable with CMake.
### Run using Docker
* Install Docker on [Windows](https://docs.docker.com/docker-for-windows/), [Mac](https://docs.docker.com/docker-for-mac/) or [Linux](https://docs.docker.com/install/).
@ -96,8 +96,7 @@ cudd 2.4.1 3.0.0
CUDD is a binary decision diageram (BDD) package that is used to improve conditional timing arc handling. It is available [here](https://www.davidkebo.com/source/cudd_versions/cudd-3.0.0.tar.gz) or [here](https://sourceforge.net/projects/cudd-mirror/).
Note that the file hierarchy of the CUDD installation changed with version 3.0.
Some changes to the CMake or configure scripts are required to support older
versions.
Some changes to the CMake are required to support older versions.
You may use the `--prefix ` option to `configure` to install in a location other than
the default (`/usr/local/lib`).
@ -162,72 +161,12 @@ If you make changes to `CMakeLists.txt` you may need to clean out
existing CMake cached variable values by deleting all of the
files in the build directory.
### Installing from a tarfile
Installing from a tarfile has the advantage that Autotools, bison,
flex and swig do not need to be installed.
Use the following commands to unpack the dist file and compile it.
```
tar zvfz opensta-<version>.tgz
cd opensta-<version>
./configure [options...]
make
```
With no options, configure builds an optimized executable.
The resulting executable is app/sta.
```
configure options:
-h, --help display configure help and exit
--enable-debug enable debug
--enable-asan enable AddressSanitizer
--enable-gprof enable gprof profiling
--enable-gcov enable gcov profiling
--enable-32bit force 32 bit compile
--with-include=dirs directories to search for include files
--with-lib=dirs directories to search for libraries
--with-tcl=dirs directories to search for Tcl init files
--with-cudd=path use Cudd BDD package, defaults to $CUDD
--with-visualstudio use Microcruft Visual Studio C++ compiler
```
If the configure script fails to find any of the `TCL`, `Zlib` or `CUDD`
files, use the `--with-include`, `--with-lib`, `--with-tcl`, `--with-cudd`
options to add directories to search for the files.
The configure `--help` option lists the generic configure options that
are not described above. The default arguments to configure disable
shared libraries. To build with shared libraries use the
`--enable-shared` option.
### Installing with Autotools
Building with GNU Autotools the additional build dependencies shown
below.
```
from Ubuntu Xcode
18.04.1 10.1
autoconf 2.53 2.69 2.69
automake 1.6.3 1.15.1 1.16.1
libtool 1.4.2 2.4.6 2.4.6
```
Use the following commands to checkout the git repository and compile
it.
```
git clone https://xp-dev.com/git/opensta
git checkout master|branch
./bootstrap
./configure [options...]
make
```
Configure options are show above in the "Installing from tarkit" section.
### Installing on Windoz
The Win32 API does not natively support the pthreads API. The
pthreads-win32 package is one way to get support for pthreads for 32
bit builds. It is available from [pthreads](www.sourceware.org/pthreads-win32).
If the configure script does not find `pthreads.h` the build proceeds
without thread support.
If Cmake does not find `pthreads.h` the build proceeds without thread support.
Use a .bat file to start a cygwin shell that has its path set to
support the Microcruft cl compiler by calling the vsvars32.bat script
@ -242,13 +181,15 @@ tcsh-startup.bat
CMake is supposedly more compatible with the windoz environment
so you may have better luck wih it.
Configure and build from the shell. Note that tcl and zlib must be
Cmake and build from the shell. Note that tcl and zlib must be
built with the Visual C++ compiler to link to the sta libraries.
mkdir build
cd build
cmakd ..
make
...
./bootstrap
./configure --with-visualstudio
make maintainer-clean
...
Good luck and don't bother me with windoz specific issues.
I am happy to say I haven't owned a windoz machine in 20 years.

View File

@ -16,7 +16,7 @@
#include <stdio.h>
#include "Machine.hh"
#include "config.h" // VERSION
#include "StaConfig.hh" // STA_VERSION
#include "StringUtil.hh"
#include "Sta.hh"
#include "StaMain.hh"
@ -39,7 +39,7 @@ main(int argc, char **argv)
return 0;
}
else if (argc == 2 && stringEq(argv[1], "-version")) {
printf("%s\n", VERSION);
printf("%s\n", STA_VERSION);
return 0;
}
else {

View File

@ -1,3 +0,0 @@
#!/bin/sh
autoreconf --install

View File

@ -1,15 +0,0 @@
// Compatible with autoheader/configure generated config.h
#define VERSION "${STA_VERSION}"
#define HAVE_PTHREAD_H ${HAVE_PTHREADS}
#if ${ZLIB_FOUND}==TRUE
#define ZLIB
#endif
#if ${CUDD_FOUND}==TRUE
#define CUDD
#endif
#define SSTA ${SSTA}

View File

@ -1,560 +0,0 @@
# OpenSTA, Static Timing Analyzer
# Copyright (c) 2019, Parallax Software, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Process this file with autoconf to produce a configure script.
AC_INIT(sta, 2.0.6)
AM_INIT_AUTOMAKE
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS(config.h)
#--------------------------------------------------------------------
# Set default paths.
#--------------------------------------------------------------------
AC_ARG_ENABLE(32bit,
[AS_HELP_STRING([--enable-32bit],[force 32 bit compile])],
[case "${enableval}" in
yes) force32bit=true ;;
no) force32bit=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-32bit) ;;
esac],
[force32bit=false])
HOST_ARCH=`uname -m`
HOST_OS=`uname -s`
if test x$force32bit = xtrue; then
HOST_ARCH=i686
fi
echo -n "checking host... "
case "${HOST_OS}" in
*Linux*)
case "${HOST_ARCH}" in
i?86)
echo "Linux 32bit"
INCLUDE_DIRS="/usr/include"
LIB_DIRS="/usr/lib /usr/local/lib /usr/lib/i386-linux-gnu"
LIB_EXTS="a so .so.1"
;;
x86_64)
echo "Linux 64bit"
INCLUDE_DIRS="/usr/include"
LIB_DIRS="/usr/lib64 /usr/lib /usr/lib/x86_64-linux-gnu"
LIB_EXTS="a so"
;;
*)
echo "Linux unknown"
INCLUDE_DIRS="/usr/include"
LIB_DIRS="/usr/lib"
LIB_EXTS="a so"
;;
esac
;;
CYGWIN*)
echo "Cygwin"
INCLUDE_DIRS="/usr/include"
LIB_DIRS="/usr/lib"
LIB_EXTS="a so"
;;
Darwin)
echo "Darwin"
use_clang=true
if test x$use_clang = xtrue; then
# clang/gcc-apple llvm
CXX=clang++
CC=clang++
INCLUDE_DIRS="/usr/local/include /usr/include"
LIB_DIRS="/usr/local/lib /usr/lib"
else
# gcc
CXX=g++
CC=g++
INCLUDE_DIRS="/usr/local/opt/tcl-tk/include /usr/local/opt/zlib/include /usr/include"
LIB_DIRS="/usr/local/opt/tcl-tk/lib /usr/local/opt/zlib/lib /usr/local/lib"
fi
LIB_EXTS="dylib"
;;
*)
echo "Unknown"
INCLUDE_DIRS="/usr/include /usr/local/include"
LIB_DIRS="/usr/lib /usr/local/lib"
LIB_EXTS="a so"
;;
esac
#--------------------------------------------------------------------
AC_ARG_ENABLE(debug,
[AS_HELP_STRING([--enable-debug],[enable debug])],
[case "${enableval}" in
yes) debug=true ;;
no) debug=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
esac],
[debug=false])
AC_ARG_ENABLE(gprof,
[AS_HELP_STRING([--enable-gprof],[enable gprof profiling])],
[case "${enableval}" in
yes) gprof=true ;;
no) gprof=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-gprof) ;;
esac],
[gprof=false])
AC_ARG_ENABLE(gcov,
[AS_HELP_STRING([--enable-gcov],[enable gcov profiling])],
[case "${enableval}" in
yes) gcov=true ;;
no) gcov=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --with-gcov) ;;
esac],
[gcov=false])
AC_ARG_ENABLE(asan,
[AS_HELP_STRING([--enable-asan],[enable AddressSanitizer])],
[case "${enableval}" in
yes) asan=true ;;
no) asan=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-asan) ;;
esac],
[asan=false])
AC_ARG_ENABLE(ssta,
[AS_HELP_STRING([--enable-ssta],[enable ssta])],
[case "${enableval}" in
yes) ssta=true ;;
no) ssta=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-ssta) ;;
esac],
[ssta=false])
AC_ARG_WITH(include,
[AS_HELP_STRING([--with-include=dirs],[directories to search for include files])],
[INCLUDE_DIRS="${withval}"],
[])
AC_ARG_WITH(lib,
[AS_HELP_STRING([--with-lib=dirs],[directories to search for libraries])],
[LIB_DIRS="${withval}"],
[])
AC_ARG_WITH(cudd,
[AS_HELP_STRING([--with-cudd=path],[use CUDD BDD package, defaults to $CUDD])],
[CUDD_ARG="${withval}"],
[CUDD_ARG=$CUDD])
AC_ARG_WITH(visualstudio,
[AS_HELP_STRING([--with-visualstudio],[use Microcruft Visual Studio C++ compiler])],
[case "${withval}" in
yes) visualstudio=true ;;
no) visualstudio=false ;;
*) AC_MSG_ERROR(bad value ${withval} for --with-visualstudio) ;;
esac],
[visualstudio=false])
if test x$visualstudio = xtrue; then
CXX=cl
CC=cl
LIB_EXTS="lib"
fi
AC_ARG_WITH(optimize,
[AS_HELP_STRING([--with-optimize],[obsolete; optimization is on by default])],
[],
[])
#--------------------------------------------------------------------
if test x$ssta = xtrue; then
AC_DEFINE(SSTA, 1, "SSTA support")
else
AC_DEFINE(SSTA, 0, "SSTA support")
fi
#--------------------------------------------------------------------
# Locate the Tcl package
#--------------------------------------------------------------------
TCL_INCLUDE=""
tcl_major="8"
tcl_minors="6 5 4 3 2"
for tcl_minor in $tcl_minors; do
AC_MSG_CHECKING(for Tcl $tcl_major.$tcl_minor header file)
found_tcl_header=false
for dir in $INCLUDE_DIRS ; do
tcl_header=$dir/tcl.h
if test -r $tcl_header; then
AC_MSG_RESULT($tcl_header)
TCL_INCLUDE=$dir
found_tcl_header=true
break
fi
dir2=$dir/tcl$tcl_major.$tcl_minor
tcl_header=$dir2/tcl.h
if test -r $tcl_header; then
AC_MSG_RESULT($tcl_header)
TCL_INCLUDE=$dir2
found_tcl_header=true
break
fi
done
if test -z "$TCL_INCLUDE"; then
AC_MSG_RESULT(not found)
fi
AC_MSG_CHECKING(for Tcl $tcl_major.$tcl_minor library)
TCL_LIB=""
for dir in $LIB_DIRS ; do
for ext in $LIB_EXTS; do
# With period between tcl_major/tcl_minor.
lib=tcl$tcl_major.$tcl_minor
lib_path="$dir/lib$lib.$ext"
if test -r $lib_path; then
AC_MSG_RESULT($lib_path)
TCL_LIB_DIR=$dir
TCL_LIB=$lib
break 2
fi
# Without period between major/minor.
lib=tcl$tcl_major$tcl_minor
lib_path="$dir/lib$lib.$ext"
if test -r $lib_path; then
AC_MSG_RESULT($lib_path)
TCL_LIB_DIR=$dir
TCL_LIB=$lib
break 2
fi
# Without leading lib or period between major/minor (windoz).
lib=tcl$tcl_major$tcl_minor
lib_path="$dir/$lib.$ext"
if test -r $lib_path; then
AC_MSG_RESULT($lib_path)
TCL_LIB_DIR=$dir
TCL_LIB=$lib
break 2
fi
done
done
if test -z "$TCL_LIB"; then
AC_MSG_RESULT(not found)
fi
if test $found_tcl_header = true &&
test -n "$TCL_LIB"; then
break
fi
done
#--------------------------------------------------------------------
# Locate the Zlib package
#--------------------------------------------------------------------
AC_MSG_CHECKING(for Zlib header file)
ZLIB_INCLUDE=""
for dir in $INCLUDE_DIRS ; do
if test -r $dir/zlib.h; then
AC_MSG_RESULT($dir)
ZLIB_INCLUDE=$dir
AC_DEFINE(ZLIB, 1, "Zlib compressed file reader")
break
fi
done
if test -z "$ZLIB_INCLUDE"; then
AC_MSG_RESULT(not found)
fi
AC_MSG_CHECKING(for Zlib library)
ZLIB_LIB=""
for dir in $LIB_DIRS ; do
for ext in $LIB_EXTS; do
lib_path="$dir/libz.$ext"
if test -r $lib_path; then
AC_MSG_RESULT($lib_path)
ZLIB_DIR=$dir
ZLIB_LIB="z"
break 2
fi
done
done
if test -z "$ZLIB_LIB"; then
AC_MSG_RESULT(not found)
fi
AC_SUBST(ZLIB_INCLUDE)
AC_SUBST(ZLIB_LIB)
#--------------------------------------------------------------------
# Locate the Cudd package
#--------------------------------------------------------------------
CUDD_INCLUDE=""
CUDD_LIBS=""
if test "$CUDD_ARG"; then
AC_MSG_RESULT($CUDD_ARG)
AC_MSG_CHECKING(for CUDD header file)
CUDD_INCLUDE_DIR="$CUDD_ARG/include"
CUDD_HEADER="$CUDD_INCLUDE_DIR/cudd.h"
if test -r "$CUDD_HEADER"; then
AC_MSG_RESULT($CUDD_HEADER)
CUDD_INCLUDE=$CUDD_INCLUDE_DIR
AC_DEFINE(CUDD, 1, "CUDD bdd package")
else
AC_MSG_RESULT(not found)
fi
AC_MSG_CHECKING(for CUDD library)
CUDD_LIB_EXT="a"
CUDD_LIB="$CUDD_ARG/lib/libcudd.$CUDD_LIB_EXT"
if test -r $CUDD_LIB; then
AC_MSG_RESULT($CUDD_LIB)
CUDD_LIBS="$CUDD_ARG/lib/libcudd.$CUDD_LIB_EXT"
else
AC_MSG_RESULT(not found)
fi
fi
AC_SUBST(CUDD_LIBS)
#--------------------------------------------------------------------
# Checks for programs.
AC_PROG_CXX
# Disable shared libraries by default.
AC_DISABLE_SHARED
AC_PROG_AWK
AC_PROG_YACC
AM_PROG_LEX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
# Checks for header files.
AC_CHECK_HEADERS(malloc.h)
AC_CHECK_HEADERS(limits.h)
AC_CHECK_HEADERS(strings.h)
AC_CHECK_HEADERS(stddef.h)
AC_CHECK_HEADERS(inttypes.h)
AC_CHECK_HEADERS(float.h)
AC_CHECK_HEADERS(pthread.h, HAVE_PTHREAD=true, HAVE_PTHREAD=false)
AC_CHECK_HEADERS([sys/time.h])
AC_HEADER_STDBOOL
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_VPRINTF
AC_FUNC_STRTOD
AC_TYPE_SIZE_T
AC_CHECK_FUNC(strdup)
AC_CHECK_FUNC(strstr)
AC_CHECK_FUNC(strchr)
AC_CHECK_FUNC(strrchr)
AC_CHECK_FUNC(strpbrk)
AC_CHECK_FUNC(strtol)
AC_CHECK_FUNC(strtoul)
AC_CHECK_FUNC(strcasecmp)
AC_CHECK_FUNC(strncasecmp)
AC_CHECK_FUNC(gettimeofday)
AC_CHECK_FUNC(sqrt)
AC_CHECK_FUNC(memset)
AC_C_INLINE
AC_FUNC_ERROR_AT_LINE
#--------------------------------------------------------------------
if test $CXX = clang++; then
# suppress deprecated-register warnings in flex files.
CXXFLAGS="-std=c++11 -Wall -Wcast-qual -Wunused-parameter -Wno-deprecated-register"
CXX_OPT="-O3"
CXX_DEBUG="-g"
CXX_ASAN="-fsanitize=address -O1 -fno-omit-frame-pointer"
CXX_LD=$CXX
LDFLAGS="-stdlib=libc++"
if test x$HAVE_PTHREAD = xtrue; then
LDFLAGS="$LDFLAGS -lpthread"
fi
if test "$TCL_LIB"; then
LDFLAGS="$LDFLAGS -L$TCL_LIB_DIR -l$TCL_LIB"
fi
if test "$ZLIB_LIB"; then
LDFLAGS="$LDFLAGS -L$ZLIB_DIR -l$ZLIB_LIB"
fi
elif test x$GXX = xyes; then
# Use GCC_EXTRA_FLAGS for local flags.
# -Wno-deprecated-register to suppress warnings in flex files
CXXFLAGS="-std=c++11 -Wall -Wextra -Wpointer-arith -Wcast-qual -Wno-deprecated-register -pipe $GCC_EXTRA_FLAGS"
if test x$force32bit = xtrue; then
CXXFLAGS="$CXXCFLAGS -m32"
fi
CXX_OPT="-O3"
CXX_DEBUG="-g"
CXX_GPROF="-pg -g"
CXX_GCOV="-fprofile-arcs -ftest-coverage"
CXX_LD=$CXX
LDFLAGS=""
if test x$HAVE_PTHREAD = xtrue; then
LDFLAGS="$LDFLAGS -lpthread"
fi
if test "$TCL_LIB"; then
LDFLAGS="$LDFLAGS -L$TCL_LIB_DIR -l$TCL_LIB"
fi
if test "$ZLIB_LIB"; then
LDFLAGS="$LDFLAGS -L$ZLIB_DIR -l$ZLIB_LIB"
fi
elif test x$visualstudio = xtrue; then
# /Zc:forScope force conformance in for Loop scope
# /EHa use c++ exception handling
# /W3 display level 3 warnings
# /WL one line diagnostics
# /c compiles without linking
# /GR enable run time type info (RTTI)
CXX_FLAGS="/nologo /Zc:forScope /EHa /W3 /WL /c /GR"
# /MDd use debug version of vc runtime library.
# /RTC1 run time error check use of uninitialized variable, initialize stack
# variables to non-zero value
# /GS buffer security check
# /Z7 symbolic debugging info
# /Od disable optimization
CXX_DEBUG="/MDd /RTC1 /GS /Z7 /Od"
# /MD use optimized version of vc runtime library.
# /Ox full optimization
# /G7 ??
# /Gy enable function level linking
CXX_OPT="/MD /Ox /G7 /Gy"
CXX_GPROF=""
CXX_GCOV=""
CXX_LD="link"
LDFLAGS="/nologo /SUBSYSTEM:CONSOLE /OPT:REF /IGNORE:4089 /NODEFAULTLIB:MSVCRT user32.lib advapi32.lib /OUT:sta"
if test "$TCL_LIB"; then
LDFLAGS="$LDFLAGS `cygpath -m $TCL_LIB_DIR/$TCL_LIB.$LIB_EXTS`"
fi
if test "$ZLIB_LIB"; then
LDFLAGS="$LDFLAGS `cygpath -m $ZLIB_DIR/$ZLIB_LIB.$LIB_EXTS`"
fi
if test "$TCL_INCLUDE"; then
TCL_INCLUDE=`cygpath -m $TCL_INCLUDE`
fi
if test "$ZLIB_INCLUDE"; then
ZLIB_INCLUDE=`cygpath -m $ZLIB_INCLUDE`
fi
if test "$CUDD_INCLUDE"; then
CUDD_INCLUDE=`cygpath -m $CUDD_INCLUDE`
fi
fi
if test x$debug = xtrue; then
CXXFLAGS+=" $CXX_DEBUG"
elif test x$optimize = xtrue; then
CXXFLAGS+=" $CXX_OPT"
elif test x$gprof = xtrue; then
if test $CXX = clang++; then
echo "clang does not support gprof"
exit
fi
CXXFLAGS+=" $CXX_GPROF"
LDFLAGS+=" $CXX_GPROF"
elif test x$asan = xtrue; then
CXXFLAGS+=" $CXX_ASAN"
elif test x$gcov = xtrue; then
CXXFLAGS+=" $CXX_GCOV"
LDFLAGS+=" $CXX_GCOV"
else
# optimize by default
CXXFLAGS+=" $CXX_OPT"
fi
YFLAGS="-d -p \$*_"
AC_SUBST(YFLAGS)
SWIG=swig
AC_SUBST(SWIG)
SWIG_FLAGS="-tcl8 -c++"
AC_SUBST(SWIG_FLAGS)
# The subdirectory app has to follow all library subdirs.
STA_SUBDIRS="util liberty network graph sdc sdf parasitics dcalc search tcl doc etc verilog app"
STA_INCLUDE="-I.. -I../util -I../liberty -I../network -I../graph -I../sdc -I../sdf -I../parasitics -I../dcalc -I../search -I../verilog -I../app"
STA_LIBS="../search/libsearch.la ../sdf/libsdf.la ../graph/libgraph.la ../dcalc/libdcalc.la ../parasitics/libparasitics.la ../sdc/libsdc.la ../liberty/libliberty.la ../network/libnetwork.la ../util/libutil.la"
SWIG_DEPEND="../tcl/StaException.i ../tcl/StaTcl.i ../tcl/NetworkEdit.i ../sdf/Sdf.i ../dcalc/DelayCalc.i ../parasitics/Parasitics.i"
TCL_INIT_FILES="../tcl/Util.tcl ../dcalc/DelayCalc.tcl ../tcl/Graph.tcl ../tcl/Liberty.tcl ../tcl/Link.tcl ../tcl/Network.tcl ../tcl/NetworkEdit.tcl ../parasitics/Parasitics.tcl ../tcl/Sdc.tcl ../sdf/Sdf.tcl ../tcl/Search.tcl ../tcl/Cmds.tcl ../tcl/Variables.tcl ../tcl/Sta.tcl ../tcl/Power.tcl ../tcl/Splash.tcl"
if test "$TCL_INCLUDE"; then
STA_INCLUDE="$STA_INCLUDE -I$TCL_INCLUDE"
fi
if test "$ZLIB_INCLUDE"; then
STA_INCLUDE="$STA_INCLUDE -I$ZLIB_INCLUDE"
fi
if test "$CUDD_INCLUDE"; then
STA_INCLUDE="$STA_INCLUDE -I$CUDD_INCLUDE"
fi
AC_SUBST(STA_INCLUDE)
AC_SUBST(STA_LIBS)
AC_SUBST(TCL_INIT_FILES)
AC_SUBST(SWIG_DEPEND)
AM_CPPFLAGS=$STA_INCLUDE
AC_SUBST(AM_CPPFLAGS)
# libtool generation has to be after AR/AR_FLAGS are set.
AC_PROG_LIBTOOL
AC_CONFIG_FILES(Makefile)
AC_CONFIG_FILES(util/Makefile)
AC_CONFIG_FILES(liberty/Makefile)
AC_CONFIG_FILES(network/Makefile)
AC_CONFIG_FILES(verilog/Makefile)
AC_CONFIG_FILES(graph/Makefile)
AC_CONFIG_FILES(sdc/Makefile)
AC_CONFIG_FILES(sdf/Makefile)
AC_CONFIG_FILES(parasitics/Makefile)
AC_CONFIG_FILES(dcalc/Makefile)
AC_CONFIG_FILES(search/Makefile)
AC_CONFIG_FILES(tcl/Makefile)
AC_CONFIG_FILES(doc/Makefile)
AC_CONFIG_FILES(etc/Makefile)
AC_CONFIG_FILES(app/Makefile)
# Pass $STA_SUBDIRS to Makefile.am.
AC_SUBST(STA_SUBDIRS)
AC_OUTPUT

View File

@ -1438,7 +1438,7 @@ GraphDelayCalc1::edgeFromSlew(const Vertex *from_vertex,
Slew
GraphDelayCalc1::idealClkSlew(const Vertex *vertex,
const TransRiseFall *tr,
const MinMax *min_max) const
const MinMax *min_max)
{
float slew = min_max->initValue();
const ClockSet *clks = idealClks(vertex);
@ -1718,7 +1718,7 @@ GraphDelayCalc1::setIdealClks(const Vertex *vertex,
}
ClockSet *
GraphDelayCalc1::idealClks(const Vertex *vertex) const
GraphDelayCalc1::idealClks(const Vertex *vertex)
{
ideal_clks_map_lock_.lock();
ClockSet *clks = ideal_clks_map_.findKey(vertex);
@ -1727,7 +1727,7 @@ GraphDelayCalc1::idealClks(const Vertex *vertex) const
}
bool
GraphDelayCalc1::isIdealClk(const Vertex *vertex) const
GraphDelayCalc1::isIdealClk(const Vertex *vertex)
{
const ClockSet *clks = idealClks(vertex);
return clks != 0

View File

@ -195,11 +195,11 @@ protected:
void clearIdealClkMap();
bool setIdealClks(const Vertex *vertex,
ClockSet *clks);
ClockSet *idealClks(const Vertex *vertex) const;
bool isIdealClk(const Vertex *vertex) const;
ClockSet *idealClks(const Vertex *vertex);
bool isIdealClk(const Vertex *vertex);
Slew idealClkSlew(const Vertex *vertex,
const TransRiseFall *tr,
const MinMax *min_max) const;
const MinMax *min_max);
MultiDrvrNet *multiDrvrNet(const Vertex *drvr_vertex) const;
void loadCap(Parasitic *drvr_parasitic,
bool has_set_load,
@ -222,7 +222,7 @@ protected:
VertexSet invalid_delays_;
// Vertices with invalid -from/-to timing checks.
VertexSet invalid_checks_;
mutable Mutex check_vertices_lock_;
Mutex check_vertices_lock_;
SearchPred *search_pred_;
SearchPred *search_non_latch_pred_;
SearchPred *clk_pred_;
@ -233,7 +233,7 @@ protected:
// delays to be recomputed during incremental delay calculation.
float incremental_delay_tolerance_;
VertexIdealClksMap ideal_clks_map_;
mutable Mutex ideal_clks_map_lock_;
Mutex ideal_clks_map_lock_;
friend class FindVertexDelays;
friend class MultiDrvrNet;

1290
doc/ChangeLog.txt Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "config.h"
#include "StaConfig.hh"
#ifndef STA_DELAY_H
#define STA_DELAY_H

View File

@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "config.h"
#include "StaConfig.hh"
#include "Machine.hh"
#include "Fuzzy.hh"
#include "Units.hh"

View File

@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "config.h"
#include "StaConfig.hh"
#include <cmath> // sqrt
#include "Machine.hh"
#include "Error.hh"

View File

@ -2569,10 +2569,10 @@ LibertyReader::setPortDefaults(LibertyPort *port)
}
void
LibertyReader::endPin(LibertyGroup *group)
LibertyReader::endPin(LibertyGroup *)
{
if (cell_) {
endPorts(group);
endPorts();
if (in_bus_ || in_bundle_) {
ports_ = saved_ports_;
port_group_ = saved_port_group_;
@ -2582,7 +2582,7 @@ LibertyReader::endPin(LibertyGroup *group)
}
void
LibertyReader::endPorts(LibertyGroup *)
LibertyReader::endPorts()
{
// Capacitances default based on direction so wait until the end
// of the pin group to set them.
@ -2638,7 +2638,7 @@ LibertyReader::endBus(LibertyGroup *group)
if (cell_) {
if (ports_->empty())
libWarn(group, "bus %s bus_type not found.\n", group->firstName());
endBusOrBundle(group);
endBusOrBundle();
in_bus_ = false;
}
}
@ -2662,9 +2662,9 @@ LibertyReader::beginBusOrBundle(LibertyGroup *group)
}
void
LibertyReader::endBusOrBundle(LibertyGroup *group)
LibertyReader::endBusOrBundle()
{
endPorts(group);
endPorts();
deleteContents(&bus_names_);
bus_names_.clear();
ports_ = NULL;
@ -2716,7 +2716,7 @@ LibertyReader::endBundle(LibertyGroup *group)
if (cell_) {
if (ports_->empty())
libWarn(group, "bundle %s member not found.\n", group->firstName());
endBusOrBundle(group);
endBusOrBundle();
in_bundle_ = false;
}
}

View File

@ -190,8 +190,8 @@ public:
virtual void beginBundle(LibertyGroup *group);
virtual void endBundle(LibertyGroup *group);
virtual void beginBusOrBundle(LibertyGroup *group);
virtual void endBusOrBundle(LibertyGroup *group);
virtual void endPorts(LibertyGroup *group);
virtual void endBusOrBundle();
virtual void endPorts();
virtual void setPortCapDefault(LibertyPort *port);
virtual void setPortDefaults(LibertyPort *port);
virtual void visitMembers(LibertyAttr *attr);

View File

@ -595,7 +595,7 @@ ConcreteCellPortBitIterator::findNext()
if (member_iter_ == NULL) {
if (port_iter_.hasNext()) {
next_ = port_iter_.next();
if (next_->hasMembers()) {
if (next_->isBus()) {
member_iter_ = next_->memberIterator();
next_ = member_iter_->next();
}

View File

@ -66,7 +66,7 @@ CycleAccting::findDelays(StaState *sta)
tgt_max_cycle = 100;
else {
int ratio = std::ceil(src_period / tgt_period);
tgt_max_cycle = std::max(ratio, 100);
tgt_max_cycle = std::max(ratio, 1000);
}
bool tgt_past_src = false;
bool src_past_tgt = false;

View File

@ -89,7 +89,8 @@ InputDrive::driveResistanceMinMaxEqual(const TransRiseFall *tr)
}
void
InputDrive::setDriveCell(LibertyCell *cell,
InputDrive::setDriveCell(LibertyLibrary *library,
LibertyCell *cell,
LibertyPort *from_port,
float *from_slews,
LibertyPort *to_port,
@ -106,13 +107,15 @@ InputDrive::setDriveCell(LibertyCell *cell,
int mm_index = mm->index();
InputDriveCell *drive = drive_cells_[tr_index][mm_index];
if (drive) {
drive->setLibrary(library);
drive->setCell(cell);
drive->setFromPort(from_port);
drive->setFromSlews(from_slews);
drive->setToPort(to_port);
}
else {
drive = new InputDriveCell(cell, from_port, from_slews, to_port);
drive = new InputDriveCell(library, cell, from_port,
from_slews, to_port);
drive_cells_[tr_index][mm_index] = drive;
}
}
@ -179,10 +182,12 @@ InputDrive::slew(const TransRiseFall *tr,
////////////////////////////////////////////////////////////////
InputDriveCell::InputDriveCell(LibertyCell *cell,
InputDriveCell::InputDriveCell(LibertyLibrary *library,
LibertyCell *cell,
LibertyPort *from_port,
float *from_slews,
LibertyPort *to_port) :
library_(library),
cell_(cell),
from_port_(from_port),
to_port_(to_port)
@ -190,6 +195,12 @@ InputDriveCell::InputDriveCell(LibertyCell *cell,
setFromSlews(from_slews);
}
void
InputDriveCell::setLibrary(LibertyLibrary *library)
{
library_ = library;
}
void
InputDriveCell::setCell(LibertyCell *cell)
{

View File

@ -49,7 +49,8 @@ public:
bool hasDriveResistance(const TransRiseFall *tr,
const MinMax *min_max);
bool driveResistanceMinMaxEqual(const TransRiseFall *tr);
void setDriveCell(LibertyCell *cell,
void setDriveCell(LibertyLibrary *library,
LibertyCell *cell,
LibertyPort *from_port,
float *from_slews,
LibertyPort *to_port,
@ -86,10 +87,13 @@ private:
class InputDriveCell
{
public:
InputDriveCell(LibertyCell *cell,
InputDriveCell(LibertyLibrary *library,
LibertyCell *cell,
LibertyPort *from_port,
float *from_slews,
LibertyPort *to_port);
LibertyLibrary *library() const { return library_; }
void setLibrary(LibertyLibrary *library);
LibertyCell *cell() const { return cell_; }
void setCell(LibertyCell *cell);
LibertyPort *fromPort() const { return from_port_; }
@ -103,6 +107,7 @@ public:
private:
DISALLOW_COPY_AND_ASSIGN(InputDriveCell);
LibertyLibrary *library_;
LibertyCell *cell_;
LibertyPort *from_port_;
float from_slews_[TransRiseFall::index_count];

View File

@ -756,16 +756,17 @@ Sdc::deleteDeratingFactors()
////////////////////////////////////////////////////////////////
void
Sdc::setDriveCell(Port *port,
Sdc::setDriveCell(LibertyLibrary *library,
LibertyCell *cell,
Port *port,
LibertyPort *from_port,
float *from_slews,
LibertyPort *to_port,
const TransRiseFallBoth *tr,
const MinMaxAll *min_max)
{
ensureInputDrive(port)->setDriveCell(cell, from_port, from_slews, to_port,
tr, min_max);
ensureInputDrive(port)->setDriveCell(library, cell, from_port, from_slews,
to_port, tr, min_max);
}
void
@ -2071,6 +2072,12 @@ Sdc::makeClockGroup(ClockGroups *clk_groups,
clk_groups->makeClockGroup(clks);
}
ClockGroupIterator *
Sdc::clockGroupIterator()
{
return new ClockGroupIterator(clk_groups_name_map_);
}
void
Sdc::ensureClkGroupExclusions()
{
@ -5990,15 +5997,6 @@ Sdc::setWireloadMode(WireloadMode mode)
WireloadMode
Sdc::wireloadMode()
{
if (wireload_mode_ == wire_load_mode_unknown) {
// Look for a default.
LibertyLibrary *lib = network_->defaultLibertyLibrary();
if (lib) {
WireloadMode default_mode = lib->defaultWireloadMode();
if (default_mode != wire_load_mode_unknown)
wireload_mode_ = default_mode;
}
}
return wireload_mode_;
}

View File

@ -155,6 +155,7 @@ typedef Map<const LibertyCell*, DeratingFactorsCell*> CellDeratingFactorsMap;
typedef Set<ClockGroups*> ClockGroupsSet;
typedef Map<const Clock*, ClockGroupsSet*> ClockGroupsClkMap;
typedef Map<const char*, ClockGroups*, CharPtrLess> ClockGroupsNameMap;
typedef ClockGroupsNameMap::Iterator ClockGroupIterator;
typedef Map<PinClockPair*, ClockSense, PinClockPairLess> ClockSenseMap;
typedef Set<ClkHpinDisable*, ClkHpinDisableLess> ClkHpinDisables;
typedef Set<GroupPath*> GroupPathSet;
@ -238,8 +239,9 @@ public:
float res);
// Set the drive on design port using external cell timing arcs of
// cell driven by from_slews between from_port and to_port.
void setDriveCell(Port *port,
void setDriveCell(LibertyLibrary *library,
LibertyCell *cell,
Port *port,
LibertyPort *from_port,
float *from_slews,
LibertyPort *to_port,
@ -488,9 +490,10 @@ public:
void removeClockGroupsAsynchronous(const char *name);
bool sameClockGroup(const Clock *clk1,
const Clock *clk2);
// Clocks explicitly excluded by set_clock_group.
// Clocks explicitly excluded by set_clock_group.
bool sameClockGroupExplicit(const Clock *clk1,
const Clock *clk2);
ClockGroupIterator *clockGroupIterator();
void setClockSense(PinSet *pins,
ClockSet *clks,
ClockSense sense);

View File

@ -280,12 +280,12 @@ void
writeSdc(Instance *instance,
const char *filename,
const char *creator,
bool native,
bool compatible,
bool no_timestamp,
int digits,
Sdc *sdc)
{
WriteSdc writer(instance, filename, creator, native, digits,
WriteSdc writer(instance, filename, creator, compatible, digits,
no_timestamp, sdc);
writer.write();
}
@ -293,7 +293,7 @@ writeSdc(Instance *instance,
WriteSdc::WriteSdc(Instance *instance,
const char *filename,
const char *creator,
bool native,
bool compatible,
int digits,
bool no_timestamp,
Sdc *sdc) :
@ -301,7 +301,7 @@ WriteSdc::WriteSdc(Instance *instance,
instance_(instance),
filename_(filename),
creator_(creator),
native_( native),
compatible_(compatible),
digits_(digits),
no_timestamp_(no_timestamp),
top_instance_(instance == sdc_network_->topInstance()),
@ -986,11 +986,12 @@ ClockGroupLess::operator()(const ClockGroup *clk_group1,
void
WriteSdc::writeClockGroups() const
{
ClockGroupsNameMap::Iterator groups_iter(sdc_->clk_groups_name_map_);
while (groups_iter.hasNext()) {
ClockGroups *clk_groups = groups_iter.next();
ClockGroupIterator *groups_iter = sdc_->clockGroupIterator();
while (groups_iter->hasNext()) {
ClockGroups *clk_groups = groups_iter->next();
writeClockGroups(clk_groups);
}
delete groups_iter;
}
void
@ -1737,15 +1738,16 @@ WriteSdc::writeDrivingCell(Port *port,
LibertyPort *from_port = drive_cell->fromPort();
LibertyPort *to_port = drive_cell->toPort();
float *from_slews = drive_cell->fromSlews();
LibertyLibrary *lib = cell->libertyLibrary();
LibertyLibrary *lib = drive_cell->library();
fprintf(stream_, "set_driving_cell");
if (tr)
fprintf(stream_, " %s", transRiseFallFlag(tr));
if (min_max)
fprintf(stream_, " %s", minMaxFlag(min_max));
fprintf(stream_, " -library %s -lib_cell %s",
lib->name(),
cell->name());
// Only write -library if it was specified in the sdc.
if (lib)
fprintf(stream_, " -library %s", lib->name());
fprintf(stream_, " -lib_cell %s", cell->name());
if (from_port)
fprintf(stream_, " -from_pin {%s}",
from_port->name());
@ -2434,16 +2436,16 @@ void
WriteSdc::writeVariables() const
{
if (sdc_->propagateAllClocks()) {
if (native_)
fprintf(stream_, "set sta_propagate_all_clocks 1\n");
else
if (compatible_)
fprintf(stream_, "set timing_all_clocks_propagated true\n");
else
fprintf(stream_, "set sta_propagate_all_clocks 1\n");
}
if (sdc_->presetClrArcsEnabled()) {
if (native_)
fprintf(stream_, "set sta_preset_clear_arcs_enabled 1\n");
else
if (compatible_)
fprintf(stream_, "set timing_enable_preset_clear_arcs true\n");
else
fprintf(stream_, "set sta_preset_clear_arcs_enabled 1\n");
}
}
@ -2481,7 +2483,7 @@ WriteSdc::writeGetTimingArcs(Edge *edge,
const char *
WriteSdc::getTimingArcsCmd() const
{
return native_ ? "get_timing_edges" : "get_timing_arcs";
return compatible_ ? "get_timing_arcs" : "get_timing_edges";
}
////////////////////////////////////////////////////////////////

View File

@ -28,7 +28,7 @@ void
writeSdc(Instance *instance,
const char *filename,
const char *creator,
bool native,
bool compatible,
bool no_timestamp,
int digits,
Sdc *sdc);

View File

@ -29,7 +29,7 @@ public:
WriteSdc(Instance *instance,
const char *filename,
const char *creator,
bool native,
bool compatible,
int digits,
bool no_timestamp,
Sdc *sdc);
@ -239,7 +239,7 @@ protected:
Instance *instance_;
const char *filename_;
const char *creator_;
bool native_;
bool compatible_;
int digits_;
bool no_timestamp_;
bool top_instance_;

View File

@ -18,7 +18,7 @@
#include <time.h>
#include "Machine.hh"
#include "Zlib.hh"
#include "config.h" // VERSION
#include "StaConfig.hh" // STA_VERSION
#include "Fuzzy.hh"
#include "StringUtil.hh"
#include "MinMaxValues.hh"
@ -208,7 +208,7 @@ SdfWriter::writeHeader(LibertyLibrary *default_lib,
gzprintf(stream_, " (VENDOR \"Parallax\")\n");
gzprintf(stream_, " (PROGRAM \"STA\")\n");
if (!no_version)
gzprintf(stream_, " (VERSION \"%s\")\n", VERSION);
gzprintf(stream_, " (VERSION \"%s\")\n", STA_VERSION);
gzprintf(stream_, " (DIVIDER %c)\n", sdf_divider_);
OperatingConditions *cond_min =

View File

@ -241,18 +241,16 @@ BfsIterator::visitParallel(Level to_level,
{
int visit_count = 0;
if (!empty()) {
int thread_count = threadCount();
if (thread_count <= 1)
if (thread_count_ <= 1)
visit_count = visit(to_level, visitor);
else {
ForEachArg<BfsListIterator, VertexVisitor> *args =
new ForEachArg<BfsListIterator,VertexVisitor>[thread_count];
Thread *threads = new Thread[thread_count];
ForEachArg<BfsListIterator, VertexVisitor> args[thread_count_];
Thread threads[thread_count_];
Mutex lock;
for (int i = 0; i < thread_count; i++) {
ForEachArg<BfsListIterator,VertexVisitor> *arg = &args[i];
arg->lock_ = &lock;
arg->func_ = visitor->copy();
for (int i = 0; i < thread_count_; i++) {
ForEachArg<BfsListIterator,VertexVisitor> &arg = args[i];
arg.lock_ = &lock;
arg.func_ = visitor->copy();
}
Level level = first_level_;
@ -265,17 +263,17 @@ BfsIterator::visitParallel(Level to_level,
incrLevel(first_level_);
BfsListIterator iter(level_vertices, this, bfs_index_);
for (int i = 0; i < thread_count; i++) {
ForEachArg<BfsListIterator,VertexVisitor> *arg = &args[i];
for (int i = 0; i < thread_count_; i++) {
ForEachArg<BfsListIterator,VertexVisitor> &arg = args[i];
// Initialize the iterator for this level's vertices.
arg->iter_ = &iter;
arg.iter_ = &iter;
threads[i].beginTask(forEachBegin<BfsListIterator,
VertexVisitor, Vertex*>,
reinterpret_cast<void*>(arg));
reinterpret_cast<void*>(&arg));
}
// Wait for all threads working on this level before moving on.
for (int i = 0; i < thread_count; i++)
for (int i = 0; i < thread_count_; i++)
threads[i].wait();
visit_count += iter.count();
@ -287,12 +285,10 @@ BfsIterator::visitParallel(Level to_level,
}
}
for (int i = 0; i < thread_count; i++) {
for (int i = 0; i < thread_count_; i++) {
ForEachArg<BfsListIterator,VertexVisitor> *arg = &args[i];
delete arg->func_;
}
delete [] threads;
delete [] args;
}
}
return visit_count;

View File

@ -36,6 +36,8 @@
namespace sta {
int PathGroup::group_count_max = std::numeric_limits<int>::max();
PathGroup *
PathGroup::makePathGroupSlack(const char *name,
int group_count,
@ -119,7 +121,7 @@ PathGroup::insert(PathEnd *path_end)
{
lock_.lock();
path_ends_.push_back(path_end);
if (group_count_ < std::numeric_limits<int>::max()
if (group_count_ != group_count_max
&& static_cast<int>(path_ends_.size()) > group_count_ * 2)
prune();
lock_.unlock();

View File

@ -65,7 +65,8 @@ public:
PathGroupIterator *iterator();
// This does NOT delete the path ends.
void clear();
static int group_count_max;
protected:
PathGroup(const char *name,
int group_count,

View File

@ -87,7 +87,6 @@ ReportField::setProperties(const char *title,
setWidth(width);
}
void
ReportField::setWidth(int width)
{
@ -95,9 +94,9 @@ ReportField::setWidth(int width)
if (blank_)
stringDelete(blank_);
blank_ = new char[width + 1];
blank_ = new char[width_ + 1];
int i;
for (i = 0; i < width; i++)
for (i = 0; i < width_; i++)
blank_[i] = ' ';
blank_[i] = '\0';
}
@ -114,20 +113,19 @@ const float ReportPath::field_blank_ = -1.0;
ReportPath::ReportPath(StaState *sta) :
StaState(sta),
start_end_pt_width_(78),
format_(report_path_full),
no_split_(false),
start_end_pt_width_(80),
plus_zero_(NULL),
minus_zero_(NULL)
{
makeFields();
setPathFormat(report_path_full);
setReportFields(false, false, false, false);
setDigits(2);
setNoSplit(false);
makeFields();
setReportFields(false, false, false, false);
}
ReportPath::~ReportPath()
{
delete fields_;
delete field_description_;
delete field_total_;
delete field_incr_;
@ -144,16 +142,19 @@ ReportPath::~ReportPath()
void
ReportPath::makeFields()
{
fields_ = new ReportFieldSeq;
field_fanout_ = makeField("fanout", "Fanout", 10, false, NULL, true);
field_capacitance_ = makeField("capacitance", "Cap", 10, false,
field_fanout_ = makeField("fanout", "Fanout", 5, false, NULL, true);
field_capacitance_ = makeField("capacitance", "Cap", 6, false,
units_->capacitanceUnit(), true);
field_slew_ = makeField("slew", "Slew", 10, false, units_->timeUnit(), true);
field_incr_ = makeField("incr", "Delay", 10, false, units_->timeUnit(), true);
field_total_ = makeField("total", "Time", 10, false, units_->timeUnit(), true);
field_slew_ = makeField("slew", "Slew", 6, false, units_->timeUnit(),
true);
field_incr_ = makeField("incr", "Delay", 6, false, units_->timeUnit(),
true);
field_total_ = makeField("total", "Time", 6, false, units_->timeUnit(),
true);
field_edge_ = makeField("edge", "", 1, false, NULL, true);
field_case_ = makeField("case", "case", 10, false, NULL, false);
field_description_ = makeField("description", "Description", 36, true, NULL, true);
field_case_ = makeField("case", "case", 11, false, NULL, false);
field_description_ = makeField("description", "Description", 36,
true, NULL, true);
}
ReportField *
@ -166,7 +167,7 @@ ReportPath::makeField(const char *name,
{
ReportField *field = new ReportField(name, title, width, left_justify,
unit, enabled);
fields_->push_back(field);
fields_.push_back(field);
return field;
}
@ -192,12 +193,12 @@ ReportPath::setReportFieldOrder(StringSeq *field_names)
field->setEnabled(false);
}
ReportFieldSeq *next_fields = new ReportFieldSeq;
ReportFieldSeq next_fields;
StringSeq::Iterator name_iter(field_names);
while (name_iter.hasNext()) {
const char *field_name = name_iter.next();
ReportField *field = findField(field_name);
next_fields->push_back(field);
next_fields.push_back(field);
field->setEnabled(true);
}
// Push remaining disabled fields on the end.
@ -205,10 +206,15 @@ ReportPath::setReportFieldOrder(StringSeq *field_names)
while (field_iter2.hasNext()) {
ReportField *field = field_iter2.next();
if (!field->enabled())
next_fields->push_back(field);
next_fields.push_back(field);
}
fields_.clear();
ReportFieldSeq::Iterator field_iter3(next_fields);
while (field_iter3.hasNext()) {
ReportField *field = field_iter3.next();
fields_.push_back(field);
}
delete fields_;
fields_ = next_fields;
}
void
@ -2982,18 +2988,18 @@ ReportPath::reportLine(const char *what,
string &result)
{
ReportFieldSeq::Iterator field_iter(fields_);
bool first_field = true;
int field_index = 0;
while (field_iter.hasNext()) {
ReportField *field = field_iter.next();
bool first_field = field_index == 0;
bool last_field = field_index == fields_.size() - 1;
if (field->enabled()) {
if (!first_field
// Compatibility kludge; suppress trailing whitespace for edge.
&& field != field_edge_)
if (!first_field)
result += ' ';
first_field = false;
if (field == field_description_)
reportDescription(what, result);
reportDescription(what, first_field, last_field, result);
else if (field == field_fanout_) {
if (fanout == field_blank_)
reportFieldBlank(field, result);
@ -3027,7 +3033,9 @@ ReportPath::reportLine(const char *what,
}
else if (field == field_case_ && line_case)
result += line_case;
}
field_index++;
}
reportEndOfLine(result);
}
@ -3083,15 +3091,26 @@ ReportPath::reportDashLineTotal(string &result)
void
ReportPath::reportDescription(const char *what,
string &result)
{
reportDescription(what, false, false, result);
}
void
ReportPath::reportDescription(const char *what,
bool first_field,
bool last_field,
string &result)
{
result += what;
int length = strlen(what);
if (!no_split_ && length > field_description_->width()) {
if (!no_split_
&& first_field
&& length > field_description_->width()) {
reportEndOfLine(result);
for (int i = 0; i < field_description_->width(); i++)
result += ' ';
}
else {
else if (!last_field) {
for (int i = length; i < field_description_->width(); i++)
result += ' ';
}

View File

@ -28,42 +28,10 @@ namespace sta {
class Corner;
class DcalcAnalysisPt;
class PathExpanded;
class ReportField;
using std::string;
class ReportField
{
public:
ReportField(const char *name,
const char *title,
int width,
bool left_justify,
Unit *unit,
bool enabled);
~ReportField();
void setProperties(const char *title,
int width,
bool left_justify);
const char *name() const { return name_; }
const char *title() const { return title_; }
int width() const { return width_; }
void setWidth(int width);
bool leftJustify() const { return left_justify_; }
Unit *unit() const { return unit_; }
const char *blank() { return blank_; }
void setEnabled(bool enabled);
bool enabled() const { return enabled_; }
protected:
const char *name_;
const char *title_;
int width_;
bool left_justify_;
Unit *unit_;
bool enabled_;
char *blank_;
};
typedef Vector<ReportField*> ReportFieldSeq;
class ReportPath : public StaState
@ -77,6 +45,7 @@ public:
bool report_net,
bool report_cap,
bool report_slew);
int digits() const { return digits_; }
void setDigits(int digits);
void setNoSplit(bool no_split);
ReportField *findField(const char *name);
@ -451,6 +420,10 @@ protected:
void reportDashLineTotal(string &result);
void reportDescription(const char *what,
string &result);
void reportDescription(const char *what,
bool first_field,
bool last_field,
string &result);
void reportFieldTime(float value,
ReportField *field,
string &result);
@ -535,7 +508,7 @@ protected:
// Path options.
ReportPathFormat format_;
ReportFieldSeq *fields_;
ReportFieldSeq fields_;
bool report_input_pin_;
bool report_net_;
bool no_split_;
@ -562,5 +535,39 @@ private:
DISALLOW_COPY_AND_ASSIGN(ReportPath);
};
class ReportField
{
public:
ReportField(const char *name,
const char *title,
int width,
bool left_justify,
Unit *unit,
bool enabled);
~ReportField();
void setProperties(const char *title,
int width,
bool left_justify);
const char *name() const { return name_; }
const char *title() const { return title_; }
int width() const { return width_; }
void setWidth(int width);
bool leftJustify() const { return left_justify_; }
Unit *unit() const { return unit_; }
const char *blank() { return blank_; }
void setEnabled(bool enabled);
bool enabled() const { return enabled_; }
protected:
const char *name_;
const char *title_;
int width_;
bool left_justify_;
Unit *unit_;
bool enabled_;
char *blank_;
ReportPath *report_path_;
};
} // namespace
#endif

View File

@ -698,7 +698,7 @@ Search::arrivalInvalid(Vertex *vertex)
debugPrint1(debug_, "search", 2, "arrival invalid %s\n",
vertex->name(sdc_network_));
if (!arrival_iter_->inQueue(vertex)) {
// Lock for DelayCalcObserveRequired called by GraphDelayCalc threads.
// Lock for StaDelayCalcObserver called by delay calc threads.
invalid_arrivals_lock_.lock();
invalid_arrivals_.insert(vertex);
invalid_arrivals_lock_.unlock();
@ -769,7 +769,7 @@ Search::requiredInvalid(Vertex *vertex)
debugPrint1(debug_, "search", 2, "required invalid %s\n",
vertex->name(sdc_network_));
if (!required_iter_->inQueue(vertex)) {
// Lock for DelayCalcObserveRequired called by GraphDelayCalc threads.
// Lock for StaDelayCalcObserver called by delay calc threads.
invalid_arrivals_lock_.lock();
invalid_requireds_.insert(vertex);
invalid_arrivals_lock_.unlock();
@ -2908,7 +2908,7 @@ Search::findTag(const TransRiseFall *tr,
InputDelay *input_delay,
bool is_segment_start,
ExceptionStateSet *states,
bool own_states) const
bool own_states)
{
Tag probe(0, tr->index(), path_ap->index(), clk_info, is_clk, input_delay,
is_segment_start, states, false, this);

View File

@ -295,7 +295,7 @@ public:
InputDelay *input_delay,
bool is_segment_start,
ExceptionStateSet *states,
bool own_states) const;
bool own_states);
void reportTags() const;
void reportClkInfos() const;
virtual ClkInfo *findClkInfo(ClockEdge *clk_edge,
@ -557,24 +557,24 @@ protected:
SlackSeq tns_;
// Indexed by path_ap->index().
VertexSlackMapSeq tns_slacks_;
mutable Mutex tns_lock_;
Mutex tns_lock_;
// Indexed by path_ap->index().
WorstSlacks *worst_slacks_;
// Use pointer to clk_info set so Tag.hh does not need to be included.
ClkInfoSet *clk_info_set_;
Mutex clk_info_lock_;
// Use pointer to tag set so Tag.hh does not need to be included.
mutable TagHashSet *tag_set_;
TagHashSet *tag_set_;
// Entries in tags_ may be missing where previous filter tags were deleted.
mutable TagIndex tag_capacity_;
mutable Tag **tags_;
mutable TagIndex tag_count_;
mutable Mutex tag_lock_;
mutable TagGroupSet *tag_group_set_;
mutable TagGroup **tag_groups_;
mutable TagGroupIndex tag_group_count_;
TagIndex tag_capacity_;
Tag **tags_;
TagIndex tag_count_;
Mutex tag_lock_;
TagGroupSet *tag_group_set_;
TagGroup **tag_groups_;
TagGroupIndex tag_group_count_;
// Capacity of tag_groups_.
mutable TagGroupIndex tag_group_capacity_;
TagGroupIndex tag_group_capacity_;
Mutex tag_group_lock_;
// Latches data outputs to queue on the next search pass.
VertexSet pending_latch_outputs_;

View File

@ -15,6 +15,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "Machine.hh"
#include "StaConfig.hh" // CUDD
#include "Error.hh"
#include "Debug.hh"
#include "Report.hh"
@ -29,7 +30,7 @@
#include "Graph.hh"
#include "Sim.hh"
#ifdef CUDD
#if CUDD
#include "cudd.h"
#endif // CUDD
@ -39,7 +40,7 @@ static Pin *
findDrvrPin(const Pin *pin,
Network *network);
#ifdef CUDD
#if CUDD
Sim::Sim(StaState *sta) :
StaState(sta),
@ -55,11 +56,6 @@ Sim::Sim(StaState *sta) :
Sim::~Sim()
{
delete observer_;
BddSymbolTable::Iterator sym_iter(symtab_);
while (sym_iter.hasNext()) {
DdNode *sym_node = sym_iter.next();
Cudd_RecursiveDeref(cudd_manager_, sym_node);
}
if (Cudd_CheckZeroRef(cudd_manager_) > 0)
internalErrorNoThrow("non-zero cudd reference counts");
Cudd_Quit(cudd_manager_);
@ -83,6 +79,7 @@ Sim::functionSense(const FuncExpr *expr,
bool decreasing = (Cudd_Decreasing(cudd_manager_, bdd, input_index)
== Cudd_ReadOne(cudd_manager_));
Cudd_RecursiveDeref(cudd_manager_, bdd);
clearSymtab();
cudd_lock_.unlock();
TimingSense sense;
if (increasing && decreasing)
@ -97,6 +94,17 @@ Sim::functionSense(const FuncExpr *expr,
return sense;
}
void
Sim::clearSymtab() const
{
BddSymbolTable::Iterator sym_iter(symtab_);
while (sym_iter.hasNext()) {
DdNode *sym_node = sym_iter.next();
Cudd_RecursiveDeref(cudd_manager_, sym_node);
}
symtab_.clear();
}
LogicValue
Sim::evalExpr(const FuncExpr *expr,
const Instance *inst) const
@ -108,8 +116,10 @@ Sim::evalExpr(const FuncExpr *expr,
value = logic_zero;
else if (bdd == Cudd_ReadOne(cudd_manager_))
value = logic_one;
if (bdd)
if (bdd) {
Cudd_RecursiveDeref(cudd_manager_, bdd);
clearSymtab();
}
cudd_lock_.unlock();
return value;
}

View File

@ -18,7 +18,7 @@
#define STA_SIM_H
#include <queue>
#include "config.h" // CUDD
#include "StaConfig.hh" // CUDD
#include "DisallowCopyAssign.hh"
#include "Map.hh"
#include "Mutex.hh"
@ -131,6 +131,7 @@ protected:
DdNode *funcBdd(const FuncExpr *expr,
const Instance *inst) const;
DdNode *ensureNode(LibertyPort *port) const;
void clearSymtab() const;
DdManager *cudd_manager_;
mutable BddSymbolTable symtab_;

View File

@ -852,16 +852,17 @@ Sta::setInputSlew(Port *port,
}
void
Sta::setDriveCell(Port *port,
Sta::setDriveCell(LibertyLibrary *library,
LibertyCell *cell,
Port *port,
LibertyPort *from_port,
float *from_slews,
LibertyPort *to_port,
const TransRiseFallBoth *tr,
const MinMaxAll *min_max)
{
sdc_->setDriveCell(port, cell, from_port, from_slews, to_port,
tr, min_max);
sdc_->setDriveCell(library, cell, port, from_port, from_slews, to_port,
tr, min_max);
delaysInvalidFrom(port);
}
@ -2076,12 +2077,12 @@ Sta::constraintsChanged()
void
Sta::writeSdc(const char *filename,
bool native,
bool compatible,
bool no_timestamp,
int digits)
{
sta::writeSdc(network_->topInstance(), filename, "write_sdc",
native, no_timestamp, digits, sdc_);
compatible, no_timestamp, digits, sdc_);
}
////////////////////////////////////////////////////////////////

View File

@ -204,8 +204,9 @@ public:
void setResistance(Net *net,
const MinMaxAll *min_max,
float res);
void setDriveCell(Port *port,
void setDriveCell(LibertyLibrary *library,
LibertyCell *cell,
Port *port,
LibertyPort *from_port,
float *from_slews,
LibertyPort *to_port,

View File

@ -100,7 +100,7 @@ proc delete_objects_from_list_cmd { list objects } {
} elseif {$list_type == "LibertyPort"} {
set obj [get_lib_pins $obj]
} else {
sta_error "remove_from_collection unsupported object type $list_type."
sta_error "unsupported object type $list_type."
}
}
set index [lsearch $list $obj]
@ -1955,7 +1955,7 @@ proc write_path_spice { args } {
sta_error "No -lib_subckt_file specified.\n"
}
if { [info exists keys(-lib_subckt_file)] } {
if { [info exists keys(-model_file)] } {
set model_file [file_expand_tilde $keys(-model_file)]
if { ![file readable $model_file] } {
sta_error "-model_file $model_file is not readable.\n"

View File

@ -24,7 +24,7 @@ namespace eval sta {
define_cmd_args "report_power" \
{ [-instances instances]\
[-corner corner_name]]\
[-corner corner_name]\
[-digits digits]\
[> filename] [>> filename] }

View File

@ -127,7 +127,7 @@ define_cmd_args "write_sdc" \
proc write_sdc { args } {
parse_key_args "write_sdc" args keys {-digits -significant_digits} \
flags {-native -no_timestamp}
flags {-compatible -no_timestamp}
check_argc_eq1 "write_sdc" $args
set digits 4
@ -141,8 +141,8 @@ proc write_sdc { args } {
set filename [file nativename [lindex $args 0]]
set no_timestamp [info exists flags(-no_timestamp)]
set native [info exists flags(-native)]
write_sdc_cmd $filename $native $no_timestamp $digits
set compatible [info exists flags(-native)]
write_sdc_cmd $filename $compatible $no_timestamp $digits
}
################################################################
@ -2223,21 +2223,22 @@ proc set_driving_cell { args } {
set min_max [parse_min_max_all_flags flags]
# -cell is an undocumented non-sdc alias for -lib_cell.
if [info exists keys(-cell)] {
if { [info exists keys(-cell)] } {
set keys(-lib_cell) $keys(-cell)
}
if [info exists keys(-lib_cell)] {
if { [info exists keys(-lib_cell)] } {
set cell_name $keys(-lib_cell)
if [info exists keys(-library)] {
set liberty [get_liberty_error "library" $keys(-library)]
set liberty_cell [$liberty find_liberty_cell $cell_name]
if { $liberty_cell == "NULL" } {
if { [info exists keys(-library)] } {
set library [get_liberty_error "library" $keys(-library)]
set cell [$library find_liberty_cell $cell_name]
if { $cell == "NULL" } {
sta_error "cell '$lib_name:$cell_name' not found."
}
} else {
set liberty_cell [find_liberty_cell $cell_name]
if { $liberty_cell == "NULL" } {
set library "NULL"
set cell [find_liberty_cell $cell_name]
if { $cell == "NULL" } {
sta_error "'$cell_name' not found."
}
}
@ -2248,12 +2249,12 @@ proc set_driving_cell { args } {
set to_port "NULL"
if [info exists keys(-pin)] {
set to_port_name $keys(-pin)
set to_port [$liberty_cell find_liberty_port $to_port_name]
set to_port [$cell find_liberty_port $to_port_name]
if { $to_port == "NULL" } {
sta_error "port '$to_port_name' not found."
}
} else {
set port_iter [$liberty_cell liberty_port_iterator]
set port_iter [$cell liberty_port_iterator]
set output_count 0
while {[$port_iter has_next]} {
set port [$port_iter next]
@ -2275,7 +2276,7 @@ proc set_driving_cell { args } {
set from_port "NULL"
if [info exists keys(-from_pin)] {
set from_port_name $keys(-from_pin)
set from_port [$liberty_cell find_liberty_port $from_port_name]
set from_port [$cell find_liberty_port $from_port_name]
if { $from_port == "NULL" } {
sta_error "port '$from_port_name' not found."
}
@ -2308,7 +2309,7 @@ proc set_driving_cell { args } {
set ports [get_ports_error "ports" [lindex $args 0]]
foreach port $ports {
set_drive_cell_cmd $port $liberty_cell $from_port \
set_drive_cell_cmd $library $cell $port $from_port \
$from_slew_rise $from_slew_fall $to_port $tr $min_max
}
}

View File

@ -213,6 +213,7 @@ proc parse_rise_fall_arg { arg } {
proc parse_report_path_options { cmd args_var default_format
unknown_key_is_error } {
variable path_options
variable report_path_field_width_extra
global sta_report_default_digits
upvar 1 $args_var args
@ -242,6 +243,11 @@ proc parse_report_path_options { cmd args_var default_format
}
set path_options(num_fmt) "%.${digits}f"
set_report_path_digits $digits
# Numberic field width expands with digits.
set field_width [expr $digits + $report_path_field_width_extra]
foreach field {total incr capacitance slew} {
set_report_path_field_width $field $field_width
}
if { [info exists path_options(-fields)] } {
set fields $path_options(-fields)

View File

@ -35,17 +35,20 @@ proc define_sta_cmds {} {
}
proc define_report_path_fields {} {
variable report_path_field_width_extra
set_rise_fall_short_names "^" "v"
set_report_path_field_order { fanout capacitance slew \
incr total edge case description }
set_report_path_field_properties "description" "Description" 36 1
set_report_path_field_properties "total" "Time" 10 0
set_report_path_field_properties "incr" "Delay" 10 0
set_report_path_field_properties "capacitance" "Cap" 10 0
set_report_path_field_properties "slew" "Slew" 10 0
set_report_path_field_properties "fanout" "Fanout" 10 0
set_report_path_field_properties "description" "Deescription" 36 1
set width $report_path_field_width_extra
set_report_path_field_properties "total" "Time" $width 0
set_report_path_field_properties "incr" "Delay" $width 0
set_report_path_field_properties "capacitance" "Cap" $width 0
set_report_path_field_properties "slew" "Slew" $width 0
set_report_path_field_properties "fanout" "Fanout" 5 0
set_report_path_field_properties "edge" "" 1 0
set_report_path_field_properties "case" "" 10 0
set_report_path_field_properties "case" "" 11 0
}
################################################################
@ -415,7 +418,7 @@ proc_redirect report_check_types {
set path_min_max "min"
}
if { $all_violators } {
set group_count $sta::int_max
set group_count $sta::group_count_max
set slack_min [expr -$sta::float_inf]
set slack_max 0.0
} else {
@ -772,9 +775,9 @@ proc set_assigned_transition { args } {
#
################################################################
define_sta_cmd_args "delete_objects_from_list" {list objs}
define_sta_cmd_args "delete_from_list" {list objs}
proc delete_objects_from_list { list objects } {
proc delete_from_list { list objects } {
delete_objects_from_list_cmd $list $objects
}

View File

@ -35,7 +35,7 @@
#include <limits>
#include "Machine.hh"
#include "config.h" // VERSION
#include "StaConfig.hh" // STA_VERSION
#include "Stats.hh"
#include "Report.hh"
#include "Error.hh"
@ -1991,12 +1991,12 @@ private:
%inline %{
float float_inf = INF;
int int_max = std::numeric_limits<int>::max();
int group_count_max = PathGroup::group_count_max;
const char *
version()
{
return VERSION;
return STA_VERSION;
}
void
@ -3512,8 +3512,9 @@ set_input_slew_cmd(Port *port,
}
void
set_drive_cell_cmd(Port *port,
set_drive_cell_cmd(LibertyLibrary *library,
LibertyCell *cell,
Port *port,
LibertyPort *from_port,
float from_slew_rise,
float from_slew_fall,
@ -3524,7 +3525,7 @@ set_drive_cell_cmd(Port *port,
float from_slews[TransRiseFall::index_count];
from_slews[TransRiseFall::riseIndex()] = from_slew_rise;
from_slews[TransRiseFall::fallIndex()] = from_slew_fall;
Sta::sta()->setDriveCell(port, cell, from_port, from_slews,
Sta::sta()->setDriveCell(library, cell, port, from_port, from_slews,
to_port, tr, min_max);
}
@ -4249,6 +4250,18 @@ set_report_path_field_properties(const char *field_name,
sta->report()->print("Error: unknown report path field %s\n", field_name);
}
void
set_report_path_field_width(const char *field_name,
int width)
{
Sta *sta = Sta::sta();
ReportField *field = sta->findReportPathField(field_name);
if (field)
field->setWidth(width);
else
sta->report()->print("Error: unknown report path field %s\n", field_name);
}
void
set_report_path_digits(int digits)
{
@ -4639,12 +4652,12 @@ disabled_edges_sorted()
void
write_sdc_cmd(const char *filename,
bool native,
bool compatible,
bool no_timestamp,
int digits)
{
cmdLinkedNetwork();
Sta::sta()->writeSdc(filename, native, no_timestamp, digits);
Sta::sta()->writeSdc(filename, compatible, no_timestamp, digits);
}
void

View File

@ -168,6 +168,9 @@ proc trace_pocv_enabled { name1 name2 op } {
pocv_enabled set_pocv_enabled
}
# Report path numeric field width is digits + extra.
set report_path_field_width_extra 5
################################################################
proc trace_boolean_var { op var_name get_proc set_proc } {

View File

@ -19,7 +19,7 @@
#include <stdio.h>
#include <windows.h> // GetSystemInfo
#include "Machine.hh"
#include "config.h"
#include "StaConfig.hh"
namespace sta {
@ -95,7 +95,7 @@ memoryUsage()
#include <sys/time.h>
#include <sys/resource.h>
#include "Machine.hh"
#include "config.h"
#include "StaConfig.hh"
#include "StringUtil.hh"
namespace sta {

View File

@ -14,9 +14,9 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "config.h"
#include "StaConfig.hh"
#if !HAVE_PTHREAD_H
#if !PTHREADS
#include "Pthread.hh"

View File

@ -17,9 +17,9 @@
#ifndef STA_PTHREAD_H
#define STA_PTHREAD_H
#include "config.h"
#include "StaConfig.hh"
#if HAVE_PTHREAD_H
#if PTHREADS
#include <pthread.h>
#define STA_PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_SYSTEM
#else
@ -88,5 +88,5 @@ int
pthread_rwlock_unlock(pthread_rwlock_t *);
} // namespace
#endif // HAVE_PTHREAD_H
#endif // PTHREAD
#endif // STA_PTHREAD_H

9
util/StaConfig.hh.cmake Normal file
View File

@ -0,0 +1,9 @@
#define STA_VERSION "${STA_VERSION}"
#define PTHREADS ${PTHREADS}
#define ZLIB ${ZLIB}
#define CUDD ${CUDD}
#define SSTA ${SSTA}

View File

@ -27,7 +27,9 @@ template<class Iterator, class Func>
class ForEachArg {
public:
ForEachArg() {}
ForEachArg(Iterator *iter, Mutex *lock, Func *func) :
ForEachArg(Iterator *iter,
Mutex *lock,
Func *func) :
iter_(iter),
lock_(lock),
func_(func)
@ -64,7 +66,9 @@ forEachBegin(void *arg)
// Parallel version of STL for_each.
template<class Iterator, class Func, class FuncArg>
void
forEach(Iterator *iter, Func *func, int thread_count)
forEach(Iterator *iter,
Func *func,
int thread_count)
{
if (thread_count <= 1) {
while (iter->hasNext())
@ -90,7 +94,9 @@ forEach(Iterator *iter, Func *func, int thread_count)
// Func::copy() must be defined.
template<class Iterator, class Func, class FuncArg>
void
forEach2(Iterator *iter, Func *func, int thread_count)
forEach2(Iterator *iter,
Func *func,
int thread_count)
{
if (thread_count <= 1) {
while (iter->hasNext())

View File

@ -20,9 +20,9 @@
// The zlib package is optional.
// Define stdio based macros if it is missing.
#include "config.h" // ZLIB
#include "StaConfig.hh" // ZLIB
#ifdef ZLIB
#if ZLIB
#include <zlib.h>