cmake support for /opt/local CUDD install

This commit is contained in:
James Cherry 2019-03-24 19:41:05 -07:00
parent 20ab0a1f23
commit 37df007eca
3 changed files with 352 additions and 338 deletions

View File

@ -53,7 +53,7 @@ set(STA_SOURCE
app/StaApp_wrap.cc app/StaApp_wrap.cc
app/TclInitVar.cc app/TclInitVar.cc
app/StaApp_wrap.cc app/StaApp_wrap.cc
dcalc/ArcDelayCalc.cc dcalc/ArcDelayCalc.cc
dcalc/ArnoldiDelayCalc.cc dcalc/ArnoldiDelayCalc.cc
dcalc/ArnoldiReduce.cc dcalc/ArnoldiReduce.cc
@ -68,7 +68,7 @@ set(STA_SOURCE
dcalc/RCDelayCalc.cc dcalc/RCDelayCalc.cc
dcalc/SimpleRCDelayCalc.cc dcalc/SimpleRCDelayCalc.cc
dcalc/UnitDelayCalc.cc dcalc/UnitDelayCalc.cc
graph/DelayFloat.cc graph/DelayFloat.cc
graph/DelayNormal1.cc graph/DelayNormal1.cc
graph/DelayNormal2.cc graph/DelayNormal2.cc
@ -98,7 +98,7 @@ set(STA_SOURCE
liberty/Transition.cc liberty/Transition.cc
liberty/Units.cc liberty/Units.cc
liberty/Wireload.cc liberty/Wireload.cc
network/ConcreteLibrary.cc network/ConcreteLibrary.cc
network/ConcreteNetwork.cc network/ConcreteNetwork.cc
network/HpinDrvrLoad.cc network/HpinDrvrLoad.cc
@ -119,7 +119,7 @@ set(STA_SOURCE
parasitics/SpefParse.cc parasitics/SpefParse.cc
parasitics/SpefReader.cc parasitics/SpefReader.cc
parasitics/SpefReaderPvt.hh parasitics/SpefReaderPvt.hh
sdc/Clock.cc sdc/Clock.cc
sdc/ClockGatingCheck.cc sdc/ClockGatingCheck.cc
sdc/ClockGroups.cc sdc/ClockGroups.cc
@ -145,7 +145,7 @@ set(STA_SOURCE
sdf/SdfParse.cc sdf/SdfParse.cc
sdf/SdfLex.cc sdf/SdfLex.cc
sdf/SdfWriter.cc sdf/SdfWriter.cc
search/Bfs.cc search/Bfs.cc
search/CheckMaxSkews.cc search/CheckMaxSkews.cc
search/CheckMinPeriods.cc search/CheckMinPeriods.cc
@ -186,7 +186,7 @@ set(STA_SOURCE
search/VisitPathGroupVertices.cc search/VisitPathGroupVertices.cc
search/WorstSlack.cc search/WorstSlack.cc
search/WritePathSpice.cc search/WritePathSpice.cc
util/Debug.cc util/Debug.cc
util/Error.cc util/Error.cc
util/Fuzzy.cc util/Fuzzy.cc
@ -201,217 +201,218 @@ set(STA_SOURCE
util/StringSet.cc util/StringSet.cc
util/StringUtil.cc util/StringUtil.cc
util/TokenParser.cc util/TokenParser.cc
verilog/VerilogReader.cc verilog/VerilogReader.cc
verilog/VerilogLex.cc verilog/VerilogLex.cc
verilog/VerilogParse.cc verilog/VerilogParse.cc
) )
set(STA_HEADERS set(STA_HEADERS
app/StaMain.hh app/StaMain.hh
dcalc/ArcDelayCalc.hh dcalc/ArcDelayCalc.hh
dcalc/Arnoldi.hh dcalc/Arnoldi.hh
dcalc/ArnoldiDelayCalc.hh dcalc/ArnoldiDelayCalc.hh
dcalc/ArnoldiReduce.hh dcalc/ArnoldiReduce.hh
dcalc/DelayCalc.hh dcalc/DelayCalc.hh
dcalc/DcalcAnalysisPt.hh dcalc/DcalcAnalysisPt.hh
dcalc/DmpCeff.hh dcalc/DmpCeff.hh
dcalc/DmpDelayCalc.hh dcalc/DmpDelayCalc.hh
dcalc/GraphDelayCalc.hh dcalc/GraphDelayCalc.hh
dcalc/GraphDelayCalc1.hh dcalc/GraphDelayCalc1.hh
dcalc/LumpedCapDelayCalc.hh dcalc/LumpedCapDelayCalc.hh
dcalc/NetCaps.hh dcalc/NetCaps.hh
dcalc/RCDelayCalc.hh dcalc/RCDelayCalc.hh
dcalc/SimpleRCDelayCalc.hh dcalc/SimpleRCDelayCalc.hh
dcalc/UnitDelayCalc.hh dcalc/UnitDelayCalc.hh
graph/Delay.hh graph/Delay.hh
graph/DelayFloat.hh graph/DelayFloat.hh
graph/DelayNormal1.hh graph/DelayNormal1.hh
graph/DelayNormal2.hh graph/DelayNormal2.hh
graph/Graph.hh graph/Graph.hh
graph/GraphClass.hh graph/GraphClass.hh
graph/GraphCmp.hh graph/GraphCmp.hh
liberty/EquivCells.hh liberty/EquivCells.hh
liberty/FuncExpr.hh liberty/FuncExpr.hh
liberty/InternalPower.hh liberty/InternalPower.hh
liberty/LeakagePower.hh liberty/LeakagePower.hh
liberty/Liberty.hh liberty/Liberty.hh
liberty/LibertyBuilder.hh liberty/LibertyBuilder.hh
liberty/LibertyClass.hh liberty/LibertyClass.hh
liberty/LibertyParser.hh liberty/LibertyParser.hh
liberty/LibertyReader.hh liberty/LibertyReader.hh
liberty/LibertyReaderPvt.hh liberty/LibertyReaderPvt.hh
liberty/LinearModel.hh liberty/LinearModel.hh
liberty/Sequential.hh liberty/Sequential.hh
liberty/TableModel.hh liberty/TableModel.hh
liberty/TimingArc.hh liberty/TimingArc.hh
liberty/TimingModel.hh liberty/TimingModel.hh
liberty/TimingRole.hh liberty/TimingRole.hh
liberty/Transition.hh liberty/Transition.hh
liberty/Units.hh liberty/Units.hh
liberty/Wireload.hh liberty/Wireload.hh
network/ConcreteLibrary.hh network/ConcreteLibrary.hh
network/ConcreteNetwork.hh network/ConcreteNetwork.hh
network/HpinDrvrLoad.hh network/HpinDrvrLoad.hh
network/MakeConcreteNetwork.hh network/MakeConcreteNetwork.hh
network/Network.hh network/Network.hh
network/NetworkClass.hh network/NetworkClass.hh
network/NetworkCmp.hh network/NetworkCmp.hh
network/ParseBus.hh network/ParseBus.hh
network/PortDirection.hh network/PortDirection.hh
network/SdcNetwork.hh network/SdcNetwork.hh
network/VerilogNamespace.hh network/VerilogNamespace.hh
parasitics/ConcreteParasitics.hh parasitics/ConcreteParasitics.hh
parasitics/ConcreteParasiticsPvt.hh parasitics/ConcreteParasiticsPvt.hh
parasitics/EstimateParasitics.hh parasitics/EstimateParasitics.hh
parasitics/MakeConcreteParasitics.hh parasitics/MakeConcreteParasitics.hh
parasitics/NullParasitics.hh parasitics/NullParasitics.hh
parasitics/Parasitics.hh parasitics/Parasitics.hh
parasitics/ParasiticsClass.hh parasitics/ParasiticsClass.hh
parasitics/ReduceParasitics.hh parasitics/ReduceParasitics.hh
parasitics/SpefNamespace.hh parasitics/SpefNamespace.hh
parasitics/SpefReader.hh parasitics/SpefReader.hh
sdc/Clock.hh sdc/Clock.hh
sdc/ClockGatingCheck.hh sdc/ClockGatingCheck.hh
sdc/ClockGroups.hh sdc/ClockGroups.hh
sdc/ClockInsertion.hh sdc/ClockInsertion.hh
sdc/ClockLatency.hh sdc/ClockLatency.hh
sdc/CycleAccting.hh sdc/CycleAccting.hh
sdc/DataCheck.hh sdc/DataCheck.hh
sdc/DeratingFactors.hh sdc/DeratingFactors.hh
sdc/DisabledPorts.hh sdc/DisabledPorts.hh
sdc/ExceptionPath.hh sdc/ExceptionPath.hh
sdc/InputDrive.hh sdc/InputDrive.hh
sdc/MinMaxValues.hh sdc/MinMaxValues.hh
sdc/PinPair.hh sdc/PinPair.hh
sdc/PortDelay.hh sdc/PortDelay.hh
sdc/PortExtCap.hh sdc/PortExtCap.hh
sdc/RiseFallMinMax.hh sdc/RiseFallMinMax.hh
sdc/RiseFallValues.hh sdc/RiseFallValues.hh
sdc/Sdc.hh sdc/Sdc.hh
sdc/SdcClass.hh sdc/SdcClass.hh
sdc/SdcCmdComment.hh sdc/SdcCmdComment.hh
sdc/WriteSdc.hh sdc/WriteSdc.hh
sdc/WriteSdcPvt.hh sdc/WriteSdcPvt.hh
sdf/ReportAnnotation.hh sdf/ReportAnnotation.hh
sdf/Sdf.hh sdf/Sdf.hh
sdf/SdfReader.hh sdf/SdfReader.hh
sdf/SdfWriter.hh sdf/SdfWriter.hh
search/Bfs.hh search/Bfs.hh
search/CheckMaxSkews.hh search/CheckMaxSkews.hh
search/CheckMinPeriods.hh search/CheckMinPeriods.hh
search/CheckMinPulseWidths.hh search/CheckMinPulseWidths.hh
search/CheckSlewLimits.hh search/CheckSlewLimits.hh
search/CheckTiming.hh search/CheckTiming.hh
search/ClkInfo.hh search/ClkInfo.hh
search/ClkSkew.hh search/ClkSkew.hh
search/Corner.hh search/Corner.hh
search/Crpr.hh search/Crpr.hh
search/FindRegister.hh search/FindRegister.hh
search/GatedClk.hh search/GatedClk.hh
search/Genclks.hh search/Genclks.hh
search/Latches.hh search/Latches.hh
search/Levelize.hh search/Levelize.hh
search/Path.hh search/Path.hh
search/PathAnalysisPt.hh search/PathAnalysisPt.hh
search/PathEnd.hh search/PathEnd.hh
search/PathEnum.hh search/PathEnum.hh
search/PathEnumed.hh search/PathEnumed.hh
search/PathExpanded.hh search/PathExpanded.hh
search/PathRef.hh search/PathRef.hh
search/PathGroup.hh search/PathGroup.hh
search/PathVertex.hh search/PathVertex.hh
search/PathVertexRep.hh search/PathVertexRep.hh
search/Power.hh search/Power.hh
search/Property.hh search/Property.hh
search/ReportPath.hh search/ReportPath.hh
search/Search.hh search/Search.hh
search/SearchClass.hh search/SearchClass.hh
search/SearchPred.hh search/SearchPred.hh
search/Sim.hh search/Sim.hh
search/Sta.hh search/Sta.hh
search/StaState.hh search/StaState.hh
search/Tag.hh search/Tag.hh
search/TagGroup.hh search/TagGroup.hh
search/VertexVisitor.hh search/VertexVisitor.hh
search/VisitPathEnds.hh search/VisitPathEnds.hh
search/VisitPathGroupVertices.hh search/VisitPathGroupVertices.hh
search/WorstSlack.hh search/WorstSlack.hh
search/WritePathSpice.hh search/WritePathSpice.hh
util/Debug.hh util/Debug.hh
util/DisallowCopyAssign.hh util/DisallowCopyAssign.hh
util/EnumNameMap.hh util/EnumNameMap.hh
util/Error.hh util/Error.hh
util/Fuzzy.hh util/Fuzzy.hh
util/Hash.hh util/Hash.hh
util/HashSet.hh util/HashSet.hh
util/Iterator.hh util/Iterator.hh
util/Machine.hh util/Machine.hh
util/Map.hh util/Map.hh
util/MinMax.hh util/MinMax.hh
util/Mutex.hh util/Mutex.hh
util/ObjectIndex.hh util/ObjectIndex.hh
util/PatternMatch.hh util/PatternMatch.hh
util/Pool.hh util/Pool.hh
util/Report.hh util/Report.hh
util/ReportStd.hh util/ReportStd.hh
util/ReportTcl.hh util/ReportTcl.hh
util/Set.hh util/Set.hh
util/Stats.hh util/Stats.hh
util/StringSeq.hh util/StringSeq.hh
util/StringSet.hh util/StringSet.hh
util/StringUtil.hh util/StringUtil.hh
util/ThreadForEach.hh util/ThreadForEach.hh
util/TokenParser.hh util/TokenParser.hh
util/UnorderedMap.hh util/UnorderedMap.hh
util/UnorderedSet.hh util/UnorderedSet.hh
util/Vector.hh util/Vector.hh
util/Zlib.hh util/Zlib.hh
verilog/Verilog.hh verilog/Verilog.hh
verilog/VerilogReader.hh verilog/VerilogReader.hh
) )
# Source files. # Source files.
set(STA_TCL_FILES set(STA_TCL_FILES
tcl/Util.tcl tcl/Util.tcl
tcl/Graph.tcl tcl/Graph.tcl
tcl/Liberty.tcl tcl/Liberty.tcl
tcl/Link.tcl tcl/Link.tcl
tcl/Network.tcl tcl/Network.tcl
tcl/NetworkEdit.tcl tcl/NetworkEdit.tcl
tcl/Sdc.tcl tcl/Sdc.tcl
tcl/Search.tcl tcl/Search.tcl
tcl/Cmds.tcl tcl/Cmds.tcl
tcl/Variables.tcl tcl/Variables.tcl
tcl/Sta.tcl tcl/Sta.tcl
tcl/Power.tcl tcl/Power.tcl
tcl/Splash.tcl tcl/Splash.tcl
dcalc/DelayCalc.tcl dcalc/DelayCalc.tcl
parasitics/Parasitics.tcl parasitics/Parasitics.tcl
sdf/Sdf.tcl sdf/Sdf.tcl
verilog/Verilog.tcl tcl/Compatibility.tcl
) verilog/Verilog.tcl
)
set(STA_SWIG_FILES set(STA_SWIG_FILES
tcl/NetworkEdit.i tcl/NetworkEdit.i
tcl/StaException.i tcl/StaException.i
sdf/Sdf.i sdf/Sdf.i
dcalc/DelayCalc.i dcalc/DelayCalc.i
parasitics/Parasitics.i parasitics/Parasitics.i
verilog/Verilog.i verilog/Verilog.i
tcl/StaTcl.i tcl/StaTcl.i
app/StaApp.i app/StaApp.i
) )
################################################################ ################################################################
# #
@ -431,12 +432,10 @@ endif()
################################################################ ################################################################
# #
# Locate CUDD bdd packagte # Locate CUDD bdd packagte
# -DCUDD=0 to not use CUDD.
# CUDD variable has precidence over environment variable. # Look for library in CUDD/lib, CUDD/cudd/lib
if("${CUDD}" STREQUAL "") # Look for header in CUDD/include, CUDD/cudd/include
set(CUDD $ENV{CUDD}) #
endif()
if("${CUDD}" STREQUAL "" OR "${CUDD}" STREQUAL "0") if("${CUDD}" STREQUAL "" OR "${CUDD}" STREQUAL "0")
set(CUDD_INCLUDE "") set(CUDD_INCLUDE "")
set(CUDD_LIB "") set(CUDD_LIB "")
@ -444,12 +443,28 @@ if("${CUDD}" STREQUAL "" OR "${CUDD}" STREQUAL "0")
set(CUDD 0) set(CUDD 0)
message(STATUS "CUDD library: not found") message(STATUS "CUDD library: not found")
else() else()
set(CUDD_INCLUDE ${CUDD}/include) find_library(CUDD_LIB NAMES cudd PATHS ${CUDD}/lib ${CUDD}/lib/cudd)
find_library(CUDD_LIB NAMES cudd PATHS ${CUDD}/lib)
if (CUDD_LIB) if (CUDD_LIB)
# CUDD referenced by StaConfig.hh.cmake
set(CUDD 1)
message(STATUS "CUDD library: ${CUDD_LIB}") message(STATUS "CUDD library: ${CUDD_LIB}")
get_filename_component(CUDD_LIB_DIR "${CUDD_LIB}" PATH)
get_filename_component(CUDD_LIB_PARENT1 "${CUDD_LIB_DIR}" PATH)
get_filename_component(CUDD_LIB_PARENT2 "${CUDD_LIB_PARENT1}" PATH)
find_file(CUDD_HEADER cudd.h
PATHS ${CUDD}/include ${CUDD_LIB_PARENT2}/include/cudd)
if (CUDD_HEADER)
get_filename_component(CUDD_INCLUDE "${CUDD_HEADER}" PATH)
message(STATUS "CUDD header: ${CUDD_HEADER}")
# CUDD referenced by StaConfig.hh.cmake
set(CUDD 1)
else()
message(STATUS "CUDD header: not found")
endif()
else()
set(CUDD_INCLUDE "")
set(CUDD_LIB "")
set(CUDD_FOUND FALSE)
set(CUDD 0)
message(STATUS "CUDD library: not found")
endif() endif()
endif() endif()
@ -460,8 +475,8 @@ message(STATUS "SSTA: ${SSTA}")
# configure a header file to pass some of the CMake settins # configure a header file to pass some of the CMake settins
configure_file(${STA_HOME}/util/StaConfig.hh.cmake configure_file(${STA_HOME}/util/StaConfig.hh.cmake
${STA_HOME}/util/StaConfig.hh ${STA_HOME}/util/StaConfig.hh
) )
################################################################ ################################################################
@ -473,40 +488,40 @@ configure_file(${STA_HOME}/util/StaConfig.hh.cmake
# searching OSX system directories before unix directories. # searching OSX system directories before unix directories.
set(TCL_POSSIBLE_NAMES tcl87 tcl8.7 set(TCL_POSSIBLE_NAMES tcl87 tcl8.7
tcl86 tcl8.6 tcl86 tcl8.6
tcl85 tcl8.5 tcl85 tcl8.5
tcl84 tcl8.4 tcl84 tcl8.4
tcl83 tcl8.3 tcl83 tcl8.3
tcl82 tcl8.2 tcl82 tcl8.2
) )
# tcl lib path guesses. # tcl lib path guesses.
if (NOT TCL_LIB_PATHS) if (NOT TCL_LIB_PATHS)
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin") if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(TCL_LIB_PATHS /usr/local/lib) set(TCL_LIB_PATHS /usr/local/lib)
set(TCL_NO_DEFAULT_PATH TRUE) set(TCL_NO_DEFAULT_PATH TRUE)
endif() endif()
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux") elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(TCL_LIB_PATHS /usr/lib set(TCL_LIB_PATHS /usr/lib
/usr/local/lib /usr/local/lib
) )
set(TCL_NO_DEFAULT_PATH FALSE) set(TCL_NO_DEFAULT_PATH FALSE)
endif() endif()
if (NOT TCL_LIB) if (NOT TCL_LIB)
# bagbiter cmake doesn't have a way to pass NO_DEFAULT_PATH as a parameter. # bagbiter cmake doesn't have a way to pass NO_DEFAULT_PATH as a parameter.
if (TCL_NO_DEFAULT_PATH) if (TCL_NO_DEFAULT_PATH)
find_library(TCL_LIB find_library(TCL_LIB
NAMES tcl ${TCL_POSSIBLE_NAMES} NAMES tcl ${TCL_POSSIBLE_NAMES}
PATHS ${TCL_LIB_PATHS} PATHS ${TCL_LIB_PATHS}
NO_DEFAULT_PATH NO_DEFAULT_PATH
) )
else() else()
find_library(TCL_LIB find_library(TCL_LIB
NAMES tcl ${TCL_POSSIBLE_NAMES} NAMES tcl ${TCL_POSSIBLE_NAMES}
PATHS ${TCL_LIB_PATHS} PATHS ${TCL_LIB_PATHS}
) )
endif() endif()
endif() endif()
message(STATUS "TCL lib: ${TCL_LIB}") message(STATUS "TCL lib: ${TCL_LIB}")
@ -536,66 +551,66 @@ find_package(BISON)
# LibertyExpr scan/parse. # LibertyExpr scan/parse.
bison_target(LibertyExprParser liberty/LibertyExprParse.yy ${STA_HOME}/liberty/LibertyExprParse.cc bison_target(LibertyExprParser liberty/LibertyExprParse.yy ${STA_HOME}/liberty/LibertyExprParse.cc
DEFINES_FILE ${STA_HOME}/liberty/LibertyExprParse.hh DEFINES_FILE ${STA_HOME}/liberty/LibertyExprParse.hh
COMPILE_FLAGS --name-prefix=LibertyExprParse_ COMPILE_FLAGS --name-prefix=LibertyExprParse_
) )
flex_target(LibertyExprLex liberty/LibertyExprLex.ll ${STA_HOME}/liberty/LibertyExprLex.cc flex_target(LibertyExprLex liberty/LibertyExprLex.ll ${STA_HOME}/liberty/LibertyExprLex.cc
DEFINES_FILE ${STA_HOME}/liberty/LibertyExprLex.hh DEFINES_FILE ${STA_HOME}/liberty/LibertyExprLex.hh
COMPILE_FLAGS --prefix=LibertyExprLex_ COMPILE_FLAGS --prefix=LibertyExprLex_
) )
add_flex_bison_dependency(LibertyExprLex LibertyExprParser) add_flex_bison_dependency(LibertyExprLex LibertyExprParser)
# Liberty scan/parse. # Liberty scan/parse.
bison_target(LibertyParser liberty/LibertyParse.yy ${STA_HOME}/liberty/LibertyParse.cc bison_target(LibertyParser liberty/LibertyParse.yy ${STA_HOME}/liberty/LibertyParse.cc
DEFINES_FILE ${STA_HOME}/liberty/LibertyParse.hh DEFINES_FILE ${STA_HOME}/liberty/LibertyParse.hh
COMPILE_FLAGS --name-prefix=LibertyParse_ COMPILE_FLAGS --name-prefix=LibertyParse_
) )
flex_target(LibertyLex liberty/LibertyLex.ll ${STA_HOME}/liberty/LibertyLex.cc flex_target(LibertyLex liberty/LibertyLex.ll ${STA_HOME}/liberty/LibertyLex.cc
DEFINES_FILE ${STA_HOME}/liberty/LibertyLex.hh DEFINES_FILE ${STA_HOME}/liberty/LibertyLex.hh
COMPILE_FLAGS --prefix=LibertyLex_ COMPILE_FLAGS --prefix=LibertyLex_
) )
add_flex_bison_dependency(LibertyLex LibertyParser) add_flex_bison_dependency(LibertyLex LibertyParser)
# Spef scan/parse. # Spef scan/parse.
bison_target(SpefParser parasitics/SpefParse.yy ${STA_HOME}/parasitics/SpefParse.cc bison_target(SpefParser parasitics/SpefParse.yy ${STA_HOME}/parasitics/SpefParse.cc
DEFINES_FILE ${STA_HOME}/parasitics/SpefParse.hh DEFINES_FILE ${STA_HOME}/parasitics/SpefParse.hh
COMPILE_FLAGS --name-prefix=SpefParse_ COMPILE_FLAGS --name-prefix=SpefParse_
) )
flex_target(SpefLex parasitics/SpefLex.ll ${STA_HOME}/parasitics/SpefLex.cc flex_target(SpefLex parasitics/SpefLex.ll ${STA_HOME}/parasitics/SpefLex.cc
DEFINES_FILE ${STA_HOME}/parasitics/SpefLex.hh DEFINES_FILE ${STA_HOME}/parasitics/SpefLex.hh
COMPILE_FLAGS --prefix=SpefLex_ COMPILE_FLAGS --prefix=SpefLex_
) )
add_flex_bison_dependency(SpefLex SpefParser) add_flex_bison_dependency(SpefLex SpefParser)
# Verilog scan/parse. # Verilog scan/parse.
bison_target(VerilogParser verilog/VerilogParse.yy ${STA_HOME}/verilog/VerilogParse.cc bison_target(VerilogParser verilog/VerilogParse.yy ${STA_HOME}/verilog/VerilogParse.cc
DEFINES_FILE ${STA_HOME}/verilog/VerilogParse.hh DEFINES_FILE ${STA_HOME}/verilog/VerilogParse.hh
COMPILE_FLAGS --name-prefix=VerilogParse_ COMPILE_FLAGS --name-prefix=VerilogParse_
) )
flex_target(VerilogLex verilog/VerilogLex.ll ${STA_HOME}/verilog/VerilogLex.cc flex_target(VerilogLex verilog/VerilogLex.ll ${STA_HOME}/verilog/VerilogLex.cc
DEFINES_FILE ${STA_HOME}/verilog/VerilogLex.hh DEFINES_FILE ${STA_HOME}/verilog/VerilogLex.hh
COMPILE_FLAGS --prefix=VerilogLex_ COMPILE_FLAGS --prefix=VerilogLex_
) )
add_flex_bison_dependency(VerilogLex VerilogParser) add_flex_bison_dependency(VerilogLex VerilogParser)
# Sdf scan/parse. # Sdf scan/parse.
bison_target(SdfParser sdf/SdfParse.yy ${STA_HOME}/sdf/SdfParse.cc bison_target(SdfParser sdf/SdfParse.yy ${STA_HOME}/sdf/SdfParse.cc
DEFINES_FILE ${STA_HOME}/sdf/SdfParse.hh DEFINES_FILE ${STA_HOME}/sdf/SdfParse.hh
COMPILE_FLAGS --name-prefix=SdfParse_ COMPILE_FLAGS --name-prefix=SdfParse_
) )
flex_target(SdfLex sdf/SdfLex.ll ${STA_HOME}/sdf/SdfLex.cc flex_target(SdfLex sdf/SdfLex.ll ${STA_HOME}/sdf/SdfLex.cc
DEFINES_FILE ${STA_HOME}/sdf/SdfLex.hh DEFINES_FILE ${STA_HOME}/sdf/SdfLex.hh
COMPILE_FLAGS --prefix=SdfLex_ COMPILE_FLAGS --prefix=SdfLex_
) )
add_flex_bison_dependency(SdfLex SdfParser) add_flex_bison_dependency(SdfLex SdfParser)
@ -605,11 +620,11 @@ add_flex_bison_dependency(SdfLex SdfParser)
include(FindSWIG) include(FindSWIG)
add_custom_command(OUTPUT ${STA_HOME}/app/StaApp_wrap.cc add_custom_command(OUTPUT ${STA_HOME}/app/StaApp_wrap.cc
COMMAND ${SWIG_EXECUTABLE} -tcl8 -c++ -namespace -prefix sta -o ${STA_HOME}/app/StaApp_wrap.cc ${STA_HOME}/app/StaApp.i COMMAND ${SWIG_EXECUTABLE} -tcl8 -c++ -namespace -prefix sta -o ${STA_HOME}/app/StaApp_wrap.cc ${STA_HOME}/app/StaApp.i
COMMAND ${STA_HOME}/etc/SwigCleanup.tcl ${STA_HOME}/app/StaApp_wrap.cc COMMAND ${STA_HOME}/etc/SwigCleanup.tcl ${STA_HOME}/app/StaApp_wrap.cc
WORKING_DIRECTORY ${STA_HOME} WORKING_DIRECTORY ${STA_HOME}
DEPENDS ${STA_SWIG_FILES} DEPENDS ${STA_SWIG_FILES}
) )
################################################################ ################################################################
@ -617,29 +632,29 @@ add_custom_command(OUTPUT ${STA_HOME}/app/StaApp_wrap.cc
# These files are encoded and shipped as part of the executable # These files are encoded and shipped as part of the executable
# so that they do not have to be installed on the client host. # so that they do not have to be installed on the client host.
add_custom_command(OUTPUT ${STA_HOME}/app/TclInitVar.cc add_custom_command(OUTPUT ${STA_HOME}/app/TclInitVar.cc
COMMAND etc/TclEncode.tcl app/TclInitVar.cc tcl_inits ${STA_TCL_FILES} COMMAND etc/TclEncode.tcl app/TclInitVar.cc tcl_inits ${STA_TCL_FILES}
WORKING_DIRECTORY ${STA_HOME} WORKING_DIRECTORY ${STA_HOME}
DEPENDS ${STA_TCL_FILES} etc/TclEncode.tcl DEPENDS ${STA_TCL_FILES} etc/TclEncode.tcl
) )
################################################################ ################################################################
set(STA_INCLUDE_DIRS set(STA_INCLUDE_DIRS
app app
dcalc dcalc
dcalc/verilog dcalc/verilog
graph graph
liberty liberty
network network
parasitics parasitics
sdc sdc
sdf sdf
search search
util util
verilog verilog
${TCL_HEADER_DIR} ${TCL_HEADER_DIR}
${CUDD_INCLUDE} ${CUDD_INCLUDE}
) )
########################################################### ###########################################################
# Library # Library
@ -653,8 +668,8 @@ add_library(OpenSTA ${STA_SOURCE})
target_include_directories(OpenSTA PUBLIC ${STA_INCLUDE_DIRS}) target_include_directories(OpenSTA PUBLIC ${STA_INCLUDE_DIRS})
target_compile_features(OpenSTA target_compile_features(OpenSTA
PUBLIC cxx_auto_type PUBLIC cxx_auto_type
) )
########################################################### ###########################################################
# Executable # Executable
@ -668,12 +683,12 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${STA_HOME}/app)
# lib name results in "No rule to make target ../depend. # lib name results in "No rule to make target ../depend.
add_executable(sta app/Main.cc) add_executable(sta app/Main.cc)
target_link_libraries(sta target_link_libraries(sta
OpenSTA OpenSTA
${TCL_LIB} ${TCL_LIB}
${CUDD_LIB} ${CUDD_LIB}
) )
if (ZLIB_FOUND) if (ZLIB_FOUND)
target_link_libraries(sta ${ZLIB_LIBRARIES}) target_link_libraries(sta ${ZLIB_LIBRARIES})
endif() endif()
message(STATUS "STA executable: ${STA_HOME}/app/sta") message(STATUS "STA executable: ${STA_HOME}/app/sta")
@ -682,16 +697,16 @@ set(STA_COMPILE_OPTIONS -Wall -Wcast-qual -Wunused-parameter -Wno-deprecated-reg
# Compiler specific options. # Compiler specific options.
if (CMAKE_CXX_COMPILER_ID MATCHES AppleClang|Clang|GNU) if (CMAKE_CXX_COMPILER_ID MATCHES AppleClang|Clang|GNU)
target_compile_options(OpenSTA PUBLIC ${STA_COMPILE_OPTIONS}) target_compile_options(OpenSTA PUBLIC ${STA_COMPILE_OPTIONS})
target_compile_options(sta PUBLIC ${STA_COMPILE_OPTIONS}) target_compile_options(sta PUBLIC ${STA_COMPILE_OPTIONS})
message(STATUS "Compiler options: ${STA_COMPILE_OPTIONS}") message(STATUS "Compiler options: ${STA_COMPILE_OPTIONS}")
endif() endif()
# g++ still needs -pthreads when using std::thread # g++ still needs -pthreads when using std::thread
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_link_libraries(sta -pthread) target_link_libraries(sta -pthread)
endif() endif()
################################################################ ################################################################
# Install # Install
# cmake .. -DCMAKE_INSTALL_PREFIX=<prefix_path> # cmake .. -DCMAKE_INSTALL_PREFIX=<prefix_path>
@ -708,6 +723,6 @@ install(FILES ${STA_HEADERS} DESTINATION include)
################################################################ ################################################################
add_custom_target(tags etags -o TAGS ${STA_SOURCE} ${STA_HEADERS} ${STA_TCL_FILES} ${SWIG_TCL_FILES} add_custom_target(tags etags -o TAGS ${STA_SOURCE} ${STA_HEADERS} ${STA_TCL_FILES} ${SWIG_TCL_FILES}
WORKING_DIRECTORY ${STA_HOME} WORKING_DIRECTORY ${STA_HOME}
DEPENDS ${STA_SOURCE} ${STA_HEADERS} ${STA_TCL_FILES} ${SWIG_TCL_FILES} DEPENDS ${STA_SOURCE} ${STA_HEADERS} ${STA_TCL_FILES} ${SWIG_TCL_FILES}
) )

View File

@ -86,20 +86,20 @@ bison 1.35 3.0.4 2.3
flex 2.5.4 2.6.4 2.5.35 flex 2.5.4 2.6.4 2.5.35
``` ```
These packages are optional: These packages are **optional**:
``` ```
libz 1.1.4 1.2.5 1.2.8 libz 1.1.4 1.2.5 1.2.8
cudd 2.4.1 3.0.0 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/). CUDD is a binary decision diageram (BDD) package that is used to improve conditional timing arc handling. OpenSTA does not require it to be installed. 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. Note that the file hierarchy of the CUDD installation changed with version 3.0.
Some changes to the CMake are required to support older versions. Some changes to CMakeLists.txt are required to support older versions.
You may use the `--prefix ` option to `configure` to install in a location other than When building CUDD you may use the `--prefix ` option to `configure` to
the default (`/usr/local/lib`). install in a location other than the default (`/usr/local/lib`).
``` ```
cd $HOME/cudd-3.0.0 cd $HOME/cudd-3.0.0
mkdir $HOME/cudd mkdir $HOME/cudd
@ -107,6 +107,21 @@ mkdir $HOME/cudd
make make
make install make install
``` ```
To not use CUDD specify `CUDD=0`.
Cmake looks for the CUDD library in `CUDD/lib, CUDD/cudd/lib`
and for the header in `CUDD/include, CUDD/cudd/include`.
```
# equivalent to -DCUDD=0
cmake ..
or
cmake .. -DCUDD=0
or
# look in ~/cudd/lib, ~/cudd/include
cmake .. -DCUDD=$HOME/cudd
or
# look in /usr/local/lib/cudd, /usr/local/include/cudd
cmake .. -DCUDD=/usr/local
```
The Zlib library is an optional. If CMake finds libz, OpenSTA can The Zlib library is an optional. If CMake finds libz, OpenSTA can
read Verilog, SDF, SPF, and SPEF files compressed with gzip. read Verilog, SDF, SPF, and SPEF files compressed with gzip.
@ -121,7 +136,7 @@ git clone https://xp-dev.com/git/opensta
cd opensta cd opensta
mkdir build mkdir build
cd build cd build
cmake .. -DCUDD=$HOME/cudd cmake ..
make make
``` ```
The default build type is release to compile optimized code. The default build type is release to compile optimized code.
@ -135,7 +150,7 @@ CMAKE_BUILD_TYPE DEBUG|RELEASE
CMAKE_CXX_FLAGS - additional compiler flags CMAKE_CXX_FLAGS - additional compiler flags
TCL_LIB - path to tcl library TCL_LIB - path to tcl library
TCL_HEADER - path to tcl.h TCL_HEADER - path to tcl.h
CUDD - path to cudd installation ($HOME/cudd if following install shown above) CUDD - path to cudd installation
ZLIB_ROOT - path to zlib ZLIB_ROOT - path to zlib
CMAKE_INSTALL_PREFIX CMAKE_INSTALL_PREFIX
``` ```

View File

@ -14,22 +14,6 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
// 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/>.
#ifndef STA_GENCLKS_H #ifndef STA_GENCLKS_H
#define STA_GENCLKS_H #define STA_GENCLKS_H