├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── def ├── .gitignore ├── LICENSE.TXT ├── Makefile ├── TEST │ ├── Makefile │ ├── complete.5.8.def │ └── complete.5.8.def.au ├── bin │ ├── .gitignore │ └── lefdefdiff ├── cdef │ ├── Makefile │ ├── cdef_vc14.vcxproj │ ├── cdef_vc14.vcxproj.filters │ ├── defMsgTable.h │ ├── defiAlias.h │ ├── defiAssertion.h │ ├── defiBlockage.h │ ├── defiComponent.h │ ├── defiDebug.h │ ├── defiDefs.h │ ├── defiFPC.h │ ├── defiFill.h │ ├── defiGroup.h │ ├── defiIOTiming.h │ ├── defiKRDefs.h │ ├── defiMisc.h │ ├── defiNet.h │ ├── defiNonDefault.h │ ├── defiPartition.h │ ├── defiPath.h │ ├── defiPinCap.h │ ├── defiPinProp.h │ ├── defiProp.h │ ├── defiPropType.h │ ├── defiRegion.h │ ├── defiRowTrack.h │ ├── defiScanchain.h │ ├── defiSite.h │ ├── defiSlot.h │ ├── defiTimingDisable.h │ ├── defiTypedefs.h │ ├── defiUser.h │ ├── defiVia.h │ ├── defrReader.h │ ├── defwWriter.h │ ├── defwWriterCalls.h │ ├── xdefiAssertion.cpp │ ├── xdefiBlockage.cpp │ ├── xdefiComponent.cpp │ ├── xdefiDebug.cpp │ ├── xdefiFPC.cpp │ ├── xdefiFill.cpp │ ├── xdefiGroup.cpp │ ├── xdefiIOTiming.cpp │ ├── xdefiMisc.cpp │ ├── xdefiNet.cpp │ ├── xdefiNonDefault.cpp │ ├── xdefiPartition.cpp │ ├── xdefiPath.cpp │ ├── xdefiPinCap.cpp │ ├── xdefiPinProp.cpp │ ├── xdefiProp.cpp │ ├── xdefiPropType.cpp │ ├── xdefiRegion.cpp │ ├── xdefiRowTrack.cpp │ ├── xdefiScanchain.cpp │ ├── xdefiSite.cpp │ ├── xdefiSlot.cpp │ ├── xdefiTimingDisable.cpp │ ├── xdefiVia.cpp │ ├── xdefrReader.cpp │ ├── xdefwWriter.cpp │ └── xdefwWriterCalls.cpp ├── cdefzlib │ ├── Makefile │ ├── cdefzlib.c │ ├── cdefzlib_vc14.vcxproj │ ├── cdefzlib_vc14.vcxproj.filters │ └── defzlib.h ├── def │ ├── .gitignore │ ├── Makefile │ ├── def.msg │ ├── def.y │ ├── def_keywords.cpp │ ├── def_objs.defs │ ├── def_vc14.vcxproj │ ├── def_vc14.vcxproj.filters │ ├── defiAlias.cpp │ ├── defiAlias.hpp │ ├── defiAssertion.cpp │ ├── defiAssertion.hpp │ ├── defiBlockage.cpp │ ├── defiBlockage.hpp │ ├── defiComponent.cpp │ ├── defiComponent.hpp │ ├── defiDebug.cpp │ ├── defiDebug.hpp │ ├── defiDefs.hpp │ ├── defiFPC.cpp │ ├── defiFPC.hpp │ ├── defiFill.cpp │ ├── defiFill.hpp │ ├── defiGroup.cpp │ ├── defiGroup.hpp │ ├── defiIOTiming.cpp │ ├── defiIOTiming.hpp │ ├── defiKRDefs.hpp │ ├── defiMisc.cpp │ ├── defiMisc.hpp │ ├── defiNet.cpp │ ├── defiNet.hpp │ ├── defiNonDefault.cpp │ ├── defiNonDefault.hpp │ ├── defiPartition.cpp │ ├── defiPartition.hpp │ ├── defiPath.cpp │ ├── defiPath.hpp │ ├── defiPinCap.cpp │ ├── defiPinCap.hpp │ ├── defiPinProp.cpp │ ├── defiPinProp.hpp │ ├── defiProp.cpp │ ├── defiProp.hpp │ ├── defiPropType.cpp │ ├── defiPropType.hpp │ ├── defiRegion.cpp │ ├── defiRegion.hpp │ ├── defiRowTrack.cpp │ ├── defiRowTrack.hpp │ ├── defiScanchain.cpp │ ├── defiScanchain.hpp │ ├── defiSite.cpp │ ├── defiSite.hpp │ ├── defiSlot.cpp │ ├── defiSlot.hpp │ ├── defiTimingDisable.cpp │ ├── defiTimingDisable.hpp │ ├── defiUser.hpp │ ├── defiUtil.cpp │ ├── defiUtil.hpp │ ├── defiVia.cpp │ ├── defiVia.hpp │ ├── defrCallBacks.hpp │ ├── defrCallbacks.cpp │ ├── defrData.cpp │ ├── defrData.hpp │ ├── defrReader.cpp │ ├── defrReader.hpp │ ├── defrSettings.cpp │ ├── defrSettings.hpp │ ├── defwWriter.cpp │ ├── defwWriter.hpp │ ├── defwWriterCalls.cpp │ ├── defwWriterCalls.hpp │ └── lex.h ├── defdiff │ ├── .gitignore │ ├── Makefile │ ├── defdiff_vc14.vcxproj │ ├── defdiff_vc14.vcxproj.filters │ ├── diffDefRW.cpp │ ├── diffDefRW.hpp │ └── differDef.cpp ├── defrw │ ├── .gitignore │ ├── Makefile │ ├── defrw.cpp │ ├── defrw_vc14.vcxproj │ └── defrw_vc14.vcxproj.filters ├── defwrite │ ├── .gitignore │ ├── Makefile │ ├── defwrite.cpp │ ├── defwriteCbs.cpp │ ├── defwrite_vc14.vcxproj │ └── defwrite_vc14.vcxproj.filters ├── defzlib │ ├── Makefile │ ├── defzlib.cpp │ ├── defzlib.hpp │ ├── defzlib_vc14.vcxproj │ └── defzlib_vc14.vcxproj.filters ├── doc │ ├── defapi.pdf │ └── defapiWN.pdf └── template.mk ├── lef ├── .gitignore ├── LICENSE.TXT ├── Makefile ├── TEST │ ├── Makefile │ ├── complete.5.8.lef │ └── complete.5.8.lef.au ├── bin │ ├── .gitignore │ └── lefdefdiff ├── clef │ ├── Makefile │ ├── clef_vc14.vcxproj │ ├── clef_vc14.vcxproj.filters │ ├── lefMsgTable.h │ ├── lefiArray.h │ ├── lefiCrossTalk.h │ ├── lefiDebug.h │ ├── lefiEncryptExt.c │ ├── lefiEncryptInt.h │ ├── lefiLayer.h │ ├── lefiMacro.h │ ├── lefiMisc.h │ ├── lefiNonDefault.h │ ├── lefiProp.h │ ├── lefiPropType.h │ ├── lefiTBInt.c │ ├── lefiTypedefs.h │ ├── lefiUnits.h │ ├── lefiUser.h │ ├── lefiUtil.h │ ├── lefiVia.h │ ├── lefiViaRule.h │ ├── lefrReader.h │ ├── lefwWriter.h │ ├── lefwWriterCalls.h │ ├── xlefiArray.cpp │ ├── xlefiCrossTalk.cpp │ ├── xlefiDebug.cpp │ ├── xlefiEncryptInt.cpp │ ├── xlefiLayer.cpp │ ├── xlefiMacro.cpp │ ├── xlefiMisc.cpp │ ├── xlefiNonDefault.cpp │ ├── xlefiProp.cpp │ ├── xlefiPropType.cpp │ ├── xlefiUnits.cpp │ ├── xlefiUtil.cpp │ ├── xlefiVia.cpp │ ├── xlefiViaRule.cpp │ ├── xlefrReader.cpp │ ├── xlefwWriter.cpp │ └── xlefwWriterCalls.cpp ├── clefzlib │ ├── Makefile │ ├── clefzlib.c │ ├── clefzlib_vc14.vcxproj │ ├── clefzlib_vc14.vcxproj.filters │ └── lefzlib.h ├── doc │ ├── lefapi.pdf │ └── lefapiWN.pdf ├── lef │ ├── .gitignore │ ├── Makefile │ ├── crypt.cpp │ ├── crypt.hpp │ ├── lef.msg │ ├── lef.y │ ├── lef_keywords.cpp │ ├── lef_vc14.vcxproj │ ├── lef_vc14.vcxproj.filters │ ├── lefiArray.cpp │ ├── lefiArray.hpp │ ├── lefiCrossTalk.cpp │ ├── lefiCrossTalk.hpp │ ├── lefiDebug.cpp │ ├── lefiDebug.hpp │ ├── lefiDefs.hpp │ ├── lefiEncryptInt.cpp │ ├── lefiEncryptInt.hpp │ ├── lefiKRDefs.hpp │ ├── lefiLayer.cpp │ ├── lefiLayer.hpp │ ├── lefiMacro.cpp │ ├── lefiMacro.hpp │ ├── lefiMisc.cpp │ ├── lefiMisc.hpp │ ├── lefiNonDefault.cpp │ ├── lefiNonDefault.hpp │ ├── lefiProp.cpp │ ├── lefiProp.hpp │ ├── lefiPropType.cpp │ ├── lefiPropType.hpp │ ├── lefiTBExt.cpp │ ├── lefiUnits.cpp │ ├── lefiUnits.hpp │ ├── lefiUser.hpp │ ├── lefiUtil.hpp │ ├── lefiVia.cpp │ ├── lefiVia.hpp │ ├── lefiViaRule.cpp │ ├── lefiViaRule.hpp │ ├── lefrCallBacks.hpp │ ├── lefrCallbacks.cpp │ ├── lefrData.cpp │ ├── lefrData.hpp │ ├── lefrReader.cpp │ ├── lefrReader.hpp │ ├── lefrSettings.cpp │ ├── lefrSettings.hpp │ ├── lefwWriter.cpp │ ├── lefwWriter.hpp │ ├── lefwWriterCalls.cpp │ ├── lefwWriterCalls.hpp │ └── lex.h ├── lefdiff │ ├── .gitignore │ ├── Makefile │ ├── diffLefRW.cpp │ ├── diffLefRW.hpp │ ├── differLef.cpp │ ├── lefdiff_vc14.vcxproj │ └── lefdiff_vc14.vcxproj.filters ├── lefrw │ ├── .gitignore │ ├── Makefile │ ├── lefrw.cpp │ ├── lefrw_vc14.vcxproj │ └── lefrw_vc14.vcxproj.filters ├── lefwrite │ ├── .gitignore │ ├── Makefile │ ├── lefwrite.cpp │ ├── lefwriteCbs.cpp │ ├── lefwrite_vc14.vcxproj │ └── lefwrite_vc14.vcxproj.filters ├── lefzlib │ ├── Makefile │ ├── lefzlib.cpp │ ├── lefzlib.hpp │ ├── lefzlib_vc14.vcxproj │ └── lefzlib_vc14.vcxproj.filters └── template.mk └── lefdefReadme.txt /.gitignore: -------------------------------------------------------------------------------- 1 | ~ 2 | *.o 3 | lib*.a 4 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------- 2 | # 3 | # Copyright (c) 2021 Rajit Manohar 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | #------------------------------------------------------------------------- 18 | 19 | all: 20 | (cd lef; make) 21 | (cd def; make) 22 | 23 | INST=$(ACT_HOME)/scripts/install 24 | 25 | install: 26 | @if [ ! -d $(ACT_HOME)/include/lef ]; then mkdir $(ACT_HOME)/include/lef; fi 27 | @if [ ! -d $(ACT_HOME)/include/def ]; then mkdir $(ACT_HOME)/include/def; fi 28 | @(cd lef/include; for i in *; do $(INST) $$i $(ACT_HOME)/include/lef/$$i; done) 29 | @(cd def/include; for i in *; do $(INST) $$i $(ACT_HOME)/include/def/$$i; done) 30 | @(cd lef/lib; for i in *; do $(INST) $$i $(ACT_HOME)/lib/$$i; done) 31 | @(cd def/lib; for i in *; do $(INST) $$i $(ACT_HOME)/lib/$$i; done) 32 | 33 | clean: 34 | (cd lef; make clean) 35 | (cd def; make clean) 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Mirror of the Si2 LEF/DEF parser (v5.8) 2 | 3 | This repository mirrors the LEF/DEF source code from Si2 (v5.8, p007). 4 | * The `lef/` directory contains the umodified contents of `lef_5.8-p007.tar.Z` 5 | * The `def/` directory contains the umodified contents of `def_5.8-p007.tar.Z` 6 | 7 | In addition, there is a top-level Makefile that assumes that `$ACT_HOME` is set. 8 | Running `make` followed by `make install` installs the LEF/DEF libraries and header 9 | files to the appropriate directories used by the rest of the ACT tools. 10 | A few `.gitignore` files are added as well. 11 | 12 | -------------------------------------------------------------------------------- /def/.gitignore: -------------------------------------------------------------------------------- 1 | include 2 | -------------------------------------------------------------------------------- /def/LICENSE.TXT: -------------------------------------------------------------------------------- 1 | Copyright 2012 - 2017, Cadence Design Systems 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /def/Makefile: -------------------------------------------------------------------------------- 1 | # $Source: /usr1/mfg/3.4C/solaris_bld/group/util/makefiles/RCS/dir.mk,v $ 2 | # 3 | # $Author: wanda $ 4 | # $Revision: #3 $ 5 | # $Date: 2004/09/29 $ 6 | # $State: Exp $ 7 | # 8 | 9 | .PHONY: all 10 | all: install release 11 | 12 | BUILD_ORDER = \ 13 | def \ 14 | cdef \ 15 | cdefzlib \ 16 | defzlib \ 17 | defrw \ 18 | defwrite \ 19 | defdiff 20 | 21 | ## HP-UX 9.0.X 22 | OS_TYPE := $(shell uname) 23 | ifeq ($(OS_TYPE),HP-UX) 24 | OPTIMIZE_FLAG = +O2 25 | else 26 | OS_VER := $(shell uname -r) 27 | ifeq ($(findstring 4.1,$(OS_VER)),4.1) 28 | OPTIMIZE_FLAG = -O 29 | else 30 | OPTIMIZE_FLAG = -O 31 | endif 32 | endif 33 | 34 | install: 35 | @$(MAKE) $(MFLAGS) installhdrs installlib installbin 36 | 37 | release: 38 | @$(MAKE) "DEBUG=$(OPTIMIZE_FLAG)" install 39 | 40 | test: 41 | @$(MAKE) "BUILD_ORDER=TEST" dotest 42 | 43 | .PHONY: clean 44 | clean: 45 | @$(MAKE) "BUILD_ORDER += TEST" doclean; 46 | echo $(BUILD_ORDER); 47 | @$(MAKE) doclean; 48 | 49 | .DEFAULT: 50 | @for i in $(BUILD_ORDER) ;do \ 51 | echo $(MAKE) $@ in $$i ; \ 52 | cd $$i ; \ 53 | $(MAKE) $(MFLAGS) $@ || exit ; \ 54 | cd .. ; \ 55 | done 56 | 57 | .DELETE_ON_ERROR: 58 | -------------------------------------------------------------------------------- /def/TEST/Makefile: -------------------------------------------------------------------------------- 1 | FAKE_ALL: all 2 | 3 | all: test 4 | 5 | install: test 6 | 7 | dotest: test 8 | 9 | clean doclean: 10 | rm -f run.output run.stderr diff.out 11 | 12 | TEST_FILE = complete.5.8.def 13 | 14 | TEST_GOLD = complete.5.8.def.au 15 | 16 | test: ../bin/defrw 17 | ../bin/defrw $(TEST_FILE) > run.output 2> run.stderr 18 | diff run.output $(TEST_GOLD) && echo TEST PASSED 19 | -------------------------------------------------------------------------------- /def/TEST/complete.5.8.def: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncvlsi/lefdef/2577884c1219368e9cdb642f341ec0dcd95ed99b/def/TEST/complete.5.8.def -------------------------------------------------------------------------------- /def/bin/.gitignore: -------------------------------------------------------------------------------- 1 | defrw 2 | defwrite 3 | defdiff 4 | -------------------------------------------------------------------------------- /def/cdef/Makefile: -------------------------------------------------------------------------------- 1 | DEF_TABNAME = def 2 | DEF_BISON_SRCS = def.y 3 | 4 | FAKE_ALL: all 5 | 6 | LIBTARGET = libcdef.a 7 | 8 | PUBLIC_HDRS = \ 9 | defiAssertion.h \ 10 | defiBlockage.h \ 11 | defiComponent.h \ 12 | defiDebug.h \ 13 | defiDefs.h \ 14 | defiFPC.h \ 15 | defiFill.h \ 16 | defiGroup.h \ 17 | defiIOTiming.h \ 18 | defiKRDefs.h \ 19 | defiMisc.h \ 20 | defiNet.h \ 21 | defiNonDefault.h \ 22 | defiPartition.h \ 23 | defiPath.h \ 24 | defiPinCap.h \ 25 | defiPinProp.h \ 26 | defiProp.h \ 27 | defiPropType.h \ 28 | defiRegion.h \ 29 | defiRowTrack.h \ 30 | defiScanchain.h \ 31 | defiSite.h \ 32 | defiSlot.h \ 33 | defiTimingDisable.h \ 34 | defiTypedefs.h \ 35 | defiUser.h \ 36 | defiVia.h \ 37 | defrReader.h \ 38 | defwWriter.h \ 39 | defwWriterCalls.h 40 | 41 | LIBSRCS = \ 42 | xdefiAssertion.cpp \ 43 | xdefiBlockage.cpp \ 44 | xdefiComponent.cpp \ 45 | xdefiDebug.cpp \ 46 | xdefiFPC.cpp \ 47 | xdefiFill.cpp \ 48 | xdefiGroup.cpp \ 49 | xdefiIOTiming.cpp \ 50 | xdefiMisc.cpp \ 51 | xdefiNet.cpp \ 52 | xdefiNonDefault.cpp \ 53 | xdefiPartition.cpp \ 54 | xdefiPath.cpp \ 55 | xdefiPinCap.cpp \ 56 | xdefiPinProp.cpp \ 57 | xdefiProp.cpp \ 58 | xdefiPropType.cpp \ 59 | xdefiRegion.cpp \ 60 | xdefiRowTrack.cpp \ 61 | xdefiScanchain.cpp \ 62 | xdefiSite.cpp \ 63 | xdefiSlot.cpp \ 64 | xdefiTimingDisable.cpp \ 65 | xdefiVia.cpp \ 66 | xdefrReader.cpp \ 67 | xdefwWriter.cpp \ 68 | xdefwWriterCalls.cpp 69 | 70 | include ../template.mk 71 | -------------------------------------------------------------------------------- /def/cdef/defiAlias.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* ************************************************************************** */ 3 | /* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! */ 4 | /* ************************************************************************** */ 5 | /* ************************************************************************** */ 6 | /* Copyright 2013, Cadence Design Systems */ 7 | /* */ 8 | /* This file is part of the Cadence LEF/DEF Open Source */ 9 | /* Distribution, Product Version 5.8. */ 10 | /* */ 11 | /* Licensed under the Apache License, Version 2.0 (the "License"); */ 12 | /* you may not use this file except in compliance with the License. */ 13 | /* You may obtain a copy of the License at */ 14 | /* */ 15 | /* http://www.apache.org/licenses/LICENSE-2.0 */ 16 | /* */ 17 | /* Unless required by applicable law or agreed to in writing, software */ 18 | /* distributed under the License is distributed on an "AS IS" BASIS, */ 19 | /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ 20 | /* implied. See the License for the specific language governing */ 21 | /* permissions and limitations under the License. */ 22 | /* */ 23 | /* For updates, support, or to become part of the LEF/DEF Community, */ 24 | /* check www.openeda.org for details. */ 25 | /* */ 26 | /* $Author: arakhman $ */ 27 | /* $Revision: #4 $ */ 28 | /* $Date: 2014/04/30 $ */ 29 | /* $State: $ */ 30 | /* ************************************************************************** */ 31 | /* ************************************************************************** */ 32 | 33 | 34 | #ifndef CDEFIALIAS_H 35 | #define CDEFIALIAS_H 36 | 37 | #include 38 | #include "defiTypedefs.h" 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /def/cdef/defiDebug.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* ************************************************************************** */ 3 | /* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! */ 4 | /* ************************************************************************** */ 5 | /* ************************************************************************** */ 6 | /* Copyright 2013, Cadence Design Systems */ 7 | /* */ 8 | /* This file is part of the Cadence LEF/DEF Open Source */ 9 | /* Distribution, Product Version 5.8. */ 10 | /* */ 11 | /* Licensed under the Apache License, Version 2.0 (the "License"); */ 12 | /* you may not use this file except in compliance with the License. */ 13 | /* You may obtain a copy of the License at */ 14 | /* */ 15 | /* http://www.apache.org/licenses/LICENSE-2.0 */ 16 | /* */ 17 | /* Unless required by applicable law or agreed to in writing, software */ 18 | /* distributed under the License is distributed on an "AS IS" BASIS, */ 19 | /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ 20 | /* implied. See the License for the specific language governing */ 21 | /* permissions and limitations under the License. */ 22 | /* */ 23 | /* For updates, support, or to become part of the LEF/DEF Community, */ 24 | /* check www.openeda.org for details. */ 25 | /* */ 26 | /* $Author: icftcm $ */ 27 | /* $Revision: #8 $ */ 28 | /* $Date: 2016/10/13 $ */ 29 | /* $State: $ */ 30 | /* ************************************************************************** */ 31 | /* ************************************************************************** */ 32 | 33 | 34 | #ifndef CDEFIDEBUG_H 35 | #define CDEFIDEBUG_H 36 | 37 | #include 38 | #include "defiTypedefs.h" 39 | 40 | /* Set flag */ 41 | EXTERN void defiSetDebug (int num, int value); 42 | 43 | /* Read flag */ 44 | EXTERN int defiDebug (int num); 45 | 46 | /* Error loggin function */ 47 | EXTERN void defiError (int check, int msgNum, const char* message); 48 | 49 | /* for auto upshifting names in case insensitive files */ 50 | EXTERN const char* upperCase (const char* c); 51 | EXTERN const char* DEFCASE (const char* ch); 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /def/cdef/defiDefs.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * Copyright 2012, Cadence Design Systems 3 | * 4 | * This file is part of the Cadence LEF/DEF Open Source Distribution, 5 | * Product Version 5.8. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 16 | * implied. 17 | * 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * For updates, support, or to become part of the LEF/DEF Community, 22 | * check www.openeda.org for details. 23 | * 24 | *************************************************************************/ 25 | 26 | /************************************************************************* 27 | * THE FILE WAS OBSOLETED IN LEF/DEF 5.8 28 | *************************************************************************/ 29 | -------------------------------------------------------------------------------- /def/cdef/defiKRDefs.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * Copyright 2012, Cadence Design Systems 3 | * 4 | * This file is part of the Cadence LEF/DEF Open Source Distribution, 5 | * Product Version 5.8. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 16 | * implied. 17 | * 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * For updates, support, or to become part of the LEF/DEF Community, 22 | * check www.openeda.org for details. 23 | * 24 | *************************************************************************/ 25 | 26 | /************************************************************************* 27 | * THE FILE WAS OBSOLETED IN LEF/DEF 5.8 28 | *************************************************************************/ 29 | -------------------------------------------------------------------------------- /def/cdef/defiMisc.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* ************************************************************************** */ 3 | /* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! */ 4 | /* ************************************************************************** */ 5 | /* ************************************************************************** */ 6 | /* Copyright 2013, Cadence Design Systems */ 7 | /* */ 8 | /* This file is part of the Cadence LEF/DEF Open Source */ 9 | /* Distribution, Product Version 5.8. */ 10 | /* */ 11 | /* Licensed under the Apache License, Version 2.0 (the "License"); */ 12 | /* you may not use this file except in compliance with the License. */ 13 | /* You may obtain a copy of the License at */ 14 | /* */ 15 | /* http://www.apache.org/licenses/LICENSE-2.0 */ 16 | /* */ 17 | /* Unless required by applicable law or agreed to in writing, software */ 18 | /* distributed under the License is distributed on an "AS IS" BASIS, */ 19 | /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ 20 | /* implied. See the License for the specific language governing */ 21 | /* permissions and limitations under the License. */ 22 | /* */ 23 | /* For updates, support, or to become part of the LEF/DEF Community, */ 24 | /* check www.openeda.org for details. */ 25 | /* */ 26 | /* $Author: dell $ */ 27 | /* $Revision: #7 $ */ 28 | /* $Date: 2015/01/27 $ */ 29 | /* $State: $ */ 30 | /* ************************************************************************** */ 31 | /* ************************************************************************** */ 32 | 33 | 34 | #ifndef CDEFIMISC_H 35 | #define CDEFIMISC_H 36 | 37 | #include 38 | #include "defiTypedefs.h" 39 | 40 | EXTERN int defiGeometries_numPoints (const defiGeometries* obj); 41 | EXTERN void defiGeometries_points (const defiGeometries* obj, int index, int* x, int* y); 42 | 43 | EXTERN int defiStyles_style (const defiStyles* obj); 44 | EXTERN struct defiPoints defiStyles_getPolygon (const defiStyles* obj); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /def/cdef/defiPinProp.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* ************************************************************************** */ 3 | /* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! */ 4 | /* ************************************************************************** */ 5 | /* ************************************************************************** */ 6 | /* Copyright 2013, Cadence Design Systems */ 7 | /* */ 8 | /* This file is part of the Cadence LEF/DEF Open Source */ 9 | /* Distribution, Product Version 5.8. */ 10 | /* */ 11 | /* Licensed under the Apache License, Version 2.0 (the "License"); */ 12 | /* you may not use this file except in compliance with the License. */ 13 | /* You may obtain a copy of the License at */ 14 | /* */ 15 | /* http://www.apache.org/licenses/LICENSE-2.0 */ 16 | /* */ 17 | /* Unless required by applicable law or agreed to in writing, software */ 18 | /* distributed under the License is distributed on an "AS IS" BASIS, */ 19 | /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ 20 | /* implied. See the License for the specific language governing */ 21 | /* permissions and limitations under the License. */ 22 | /* */ 23 | /* For updates, support, or to become part of the LEF/DEF Community, */ 24 | /* check www.openeda.org for details. */ 25 | /* */ 26 | /* $Author: dell $ */ 27 | /* $Revision: #7 $ */ 28 | /* $Date: 2015/01/27 $ */ 29 | /* $State: $ */ 30 | /* ************************************************************************** */ 31 | /* ************************************************************************** */ 32 | 33 | 34 | #ifndef CDEFIPINPROP_H 35 | #define CDEFIPINPROP_H 36 | 37 | #include 38 | #include "defiTypedefs.h" 39 | 40 | EXTERN int defiPinProp_isPin (const defiPinProp* obj); 41 | EXTERN const char* defiPinProp_instName (const defiPinProp* obj); 42 | EXTERN const char* defiPinProp_pinName (const defiPinProp* obj); 43 | 44 | EXTERN int defiPinProp_numProps (const defiPinProp* obj); 45 | EXTERN const char* defiPinProp_propName (const defiPinProp* obj, int index); 46 | EXTERN const char* defiPinProp_propValue (const defiPinProp* obj, int index); 47 | EXTERN double defiPinProp_propNumber (const defiPinProp* obj, int index); 48 | EXTERN const char defiPinProp_propType (const defiPinProp* obj, int index); 49 | EXTERN int defiPinProp_propIsNumber (const defiPinProp* obj, int index); 50 | EXTERN int defiPinProp_propIsString (const defiPinProp* obj, int index); 51 | 52 | EXTERN void defiPinProp_print (const defiPinProp* obj, FILE* f); 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /def/cdef/defiProp.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* ************************************************************************** */ 3 | /* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! */ 4 | /* ************************************************************************** */ 5 | /* ************************************************************************** */ 6 | /* Copyright 2013, Cadence Design Systems */ 7 | /* */ 8 | /* This file is part of the Cadence LEF/DEF Open Source */ 9 | /* Distribution, Product Version 5.8. */ 10 | /* */ 11 | /* Licensed under the Apache License, Version 2.0 (the "License"); */ 12 | /* you may not use this file except in compliance with the License. */ 13 | /* You may obtain a copy of the License at */ 14 | /* */ 15 | /* http://www.apache.org/licenses/LICENSE-2.0 */ 16 | /* */ 17 | /* Unless required by applicable law or agreed to in writing, software */ 18 | /* distributed under the License is distributed on an "AS IS" BASIS, */ 19 | /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ 20 | /* implied. See the License for the specific language governing */ 21 | /* permissions and limitations under the License. */ 22 | /* */ 23 | /* For updates, support, or to become part of the LEF/DEF Community, */ 24 | /* check www.openeda.org for details. */ 25 | /* */ 26 | /* $Author: dell $ */ 27 | /* $Revision: #7 $ */ 28 | /* $Date: 2015/01/27 $ */ 29 | /* $State: $ */ 30 | /* ************************************************************************** */ 31 | /* ************************************************************************** */ 32 | 33 | 34 | #ifndef CDEFIPROP_H 35 | #define CDEFIPROP_H 36 | 37 | #include 38 | #include "defiTypedefs.h" 39 | 40 | /* Struct holds the data for one property. */ 41 | 42 | EXTERN const char* defiProp_string (const defiProp* obj); 43 | EXTERN const char* defiProp_propType (const defiProp* obj); 44 | EXTERN const char* defiProp_propName (const defiProp* obj); 45 | EXTERN char defiProp_dataType (const defiProp* obj); 46 | /* either I:integer R:real S:string Q:quotedstring N:nameMapString */ 47 | EXTERN int defiProp_hasNumber (const defiProp* obj); 48 | EXTERN int defiProp_hasRange (const defiProp* obj); 49 | EXTERN int defiProp_hasString (const defiProp* obj); 50 | EXTERN int defiProp_hasNameMapString (const defiProp* obj); 51 | EXTERN double defiProp_number (const defiProp* obj); 52 | EXTERN double defiProp_left (const defiProp* obj); 53 | EXTERN double defiProp_right (const defiProp* obj); 54 | 55 | EXTERN void defiProp_print (const defiProp* obj, FILE* f); 56 | 57 | /* N:nameMapString */ 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /def/cdef/defiPropType.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* ************************************************************************** */ 3 | /* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! */ 4 | /* ************************************************************************** */ 5 | /* ************************************************************************** */ 6 | /* Copyright 2013, Cadence Design Systems */ 7 | /* */ 8 | /* This file is part of the Cadence LEF/DEF Open Source */ 9 | /* Distribution, Product Version 5.8. */ 10 | /* */ 11 | /* Licensed under the Apache License, Version 2.0 (the "License"); */ 12 | /* you may not use this file except in compliance with the License. */ 13 | /* You may obtain a copy of the License at */ 14 | /* */ 15 | /* http://www.apache.org/licenses/LICENSE-2.0 */ 16 | /* */ 17 | /* Unless required by applicable law or agreed to in writing, software */ 18 | /* distributed under the License is distributed on an "AS IS" BASIS, */ 19 | /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ 20 | /* implied. See the License for the specific language governing */ 21 | /* permissions and limitations under the License. */ 22 | /* */ 23 | /* For updates, support, or to become part of the LEF/DEF Community, */ 24 | /* check www.openeda.org for details. */ 25 | /* */ 26 | /* $Author: dell $ */ 27 | /* $Revision: #7 $ */ 28 | /* $Date: 2015/01/27 $ */ 29 | /* $State: $ */ 30 | /* ************************************************************************** */ 31 | /* ************************************************************************** */ 32 | 33 | 34 | #ifndef CDEFIPROPTYPE_H 35 | #define CDEFIPROPTYPE_H 36 | 37 | #include 38 | #include "defiTypedefs.h" 39 | 40 | /* Struct holds the data type for one property, if the property is */ 41 | /* either REAL or INTEGER. */ 42 | 43 | EXTERN const char defiPropType_propType (const defiPropType* obj, char* name); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /def/cdef/defiSlot.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* ************************************************************************** */ 3 | /* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! */ 4 | /* ************************************************************************** */ 5 | /* ************************************************************************** */ 6 | /* Copyright 2013, Cadence Design Systems */ 7 | /* */ 8 | /* This file is part of the Cadence LEF/DEF Open Source */ 9 | /* Distribution, Product Version 5.8. */ 10 | /* */ 11 | /* Licensed under the Apache License, Version 2.0 (the "License"); */ 12 | /* you may not use this file except in compliance with the License. */ 13 | /* You may obtain a copy of the License at */ 14 | /* */ 15 | /* http://www.apache.org/licenses/LICENSE-2.0 */ 16 | /* */ 17 | /* Unless required by applicable law or agreed to in writing, software */ 18 | /* distributed under the License is distributed on an "AS IS" BASIS, */ 19 | /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ 20 | /* implied. See the License for the specific language governing */ 21 | /* permissions and limitations under the License. */ 22 | /* */ 23 | /* For updates, support, or to become part of the LEF/DEF Community, */ 24 | /* check www.openeda.org for details. */ 25 | /* */ 26 | /* $Author: dell $ */ 27 | /* $Revision: #7 $ */ 28 | /* $Date: 2015/01/27 $ */ 29 | /* $State: $ */ 30 | /* ************************************************************************** */ 31 | /* ************************************************************************** */ 32 | 33 | 34 | #ifndef CDEFISLOT_H 35 | #define CDEFISLOT_H 36 | 37 | #include 38 | #include "defiTypedefs.h" 39 | 40 | EXTERN int defiSlot_hasLayer (const defiSlot* obj); 41 | EXTERN const char* defiSlot_layerName (const defiSlot* obj); 42 | 43 | EXTERN int defiSlot_numRectangles (const defiSlot* obj); 44 | EXTERN int defiSlot_xl (const defiSlot* obj, int index); 45 | EXTERN int defiSlot_yl (const defiSlot* obj, int index); 46 | EXTERN int defiSlot_xh (const defiSlot* obj, int index); 47 | EXTERN int defiSlot_yh (const defiSlot* obj, int index); 48 | 49 | EXTERN int defiSlot_numPolygons (const defiSlot* obj); 50 | EXTERN struct defiPoints defiSlot_getPolygon (const defiSlot* obj, int index); 51 | 52 | EXTERN void defiSlot_print (const defiSlot* obj, FILE* f); 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /def/cdef/xdefiDebug.cpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! 4 | // ***************************************************************************** 5 | // ***************************************************************************** 6 | // Copyright 2012, Cadence Design Systems 7 | // 8 | // This file is part of the Cadence LEF/DEF Open Source 9 | // Distribution, Product Version 5.8. 10 | // 11 | // Licensed under the Apache License, Version 2.0 (the \"License\"); 12 | // you may not use this file except in compliance with the License. 13 | // You may obtain a copy of the License at 14 | // 15 | // http://www.apache.org/licenses/LICENSE-2.0 16 | // 17 | // Unless required by applicable law or agreed to in writing, software 18 | // distributed under the License is distributed on an \"AS IS\" BASIS, 19 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 20 | // implied. See the License for the specific language governing 21 | // permissions and limitations under the License. 22 | // 23 | // 24 | // For updates, support, or to become part of the LEF/DEF Community, 25 | // check www.openeda.org for details. 26 | // 27 | // $Author: xxx $ 28 | // $Revision: xxx $ 29 | // $Date: xxx $ 30 | // $State: xxx $ 31 | // ***************************************************************************** 32 | // ***************************************************************************** 33 | 34 | #define EXTERN extern "C" 35 | 36 | #include "defiDebug.h" 37 | #include "defiDebug.hpp" 38 | 39 | // Wrappers definitions. 40 | void defiSetDebug (int num, int value) { 41 | LefDefParser::defiSetDebug(num, value); 42 | } 43 | 44 | int defiDebug (int num) { 45 | return LefDefParser::defiDebug(num); 46 | } 47 | 48 | void defiError (int check, int msgNum, const char* message) { 49 | LefDefParser::defiError(check, msgNum, message); 50 | } 51 | 52 | const char* upperCase (const char* c) { 53 | return LefDefParser::upperCase(c); 54 | } 55 | 56 | const char* DEFCASE (const char* ch) { 57 | return LefDefParser::DEFCASE(ch); 58 | } 59 | 60 | -------------------------------------------------------------------------------- /def/cdef/xdefiFPC.cpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! 4 | // ***************************************************************************** 5 | // ***************************************************************************** 6 | // Copyright 2012, Cadence Design Systems 7 | // 8 | // This file is part of the Cadence LEF/DEF Open Source 9 | // Distribution, Product Version 5.8. 10 | // 11 | // Licensed under the Apache License, Version 2.0 (the \"License\"); 12 | // you may not use this file except in compliance with the License. 13 | // You may obtain a copy of the License at 14 | // 15 | // http://www.apache.org/licenses/LICENSE-2.0 16 | // 17 | // Unless required by applicable law or agreed to in writing, software 18 | // distributed under the License is distributed on an \"AS IS\" BASIS, 19 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 20 | // implied. See the License for the specific language governing 21 | // permissions and limitations under the License. 22 | // 23 | // 24 | // For updates, support, or to become part of the LEF/DEF Community, 25 | // check www.openeda.org for details. 26 | // 27 | // $Author: xxx $ 28 | // $Revision: xxx $ 29 | // $Date: xxx $ 30 | // $State: xxx $ 31 | // ***************************************************************************** 32 | // ***************************************************************************** 33 | 34 | #define EXTERN extern "C" 35 | 36 | #include "defiFPC.h" 37 | #include "defiFPC.hpp" 38 | 39 | // Wrappers definitions. 40 | const char* defiFPC_name (const ::defiFPC* obj) { 41 | return ((const LefDefParser::defiFPC*)obj)->name(); 42 | } 43 | 44 | int defiFPC_isVertical (const ::defiFPC* obj) { 45 | return ((LefDefParser::defiFPC*)obj)->isVertical(); 46 | } 47 | 48 | int defiFPC_isHorizontal (const ::defiFPC* obj) { 49 | return ((LefDefParser::defiFPC*)obj)->isHorizontal(); 50 | } 51 | 52 | int defiFPC_hasAlign (const ::defiFPC* obj) { 53 | return ((LefDefParser::defiFPC*)obj)->hasAlign(); 54 | } 55 | 56 | int defiFPC_hasMax (const ::defiFPC* obj) { 57 | return ((LefDefParser::defiFPC*)obj)->hasMax(); 58 | } 59 | 60 | int defiFPC_hasMin (const ::defiFPC* obj) { 61 | return ((LefDefParser::defiFPC*)obj)->hasMin(); 62 | } 63 | 64 | int defiFPC_hasEqual (const ::defiFPC* obj) { 65 | return ((LefDefParser::defiFPC*)obj)->hasEqual(); 66 | } 67 | 68 | double defiFPC_alignMax (const ::defiFPC* obj) { 69 | return ((LefDefParser::defiFPC*)obj)->alignMax(); 70 | } 71 | 72 | double defiFPC_alignMin (const ::defiFPC* obj) { 73 | return ((LefDefParser::defiFPC*)obj)->alignMin(); 74 | } 75 | 76 | double defiFPC_equal (const ::defiFPC* obj) { 77 | return ((LefDefParser::defiFPC*)obj)->equal(); 78 | } 79 | 80 | int defiFPC_numParts (const ::defiFPC* obj) { 81 | return ((LefDefParser::defiFPC*)obj)->numParts(); 82 | } 83 | 84 | void defiFPC_getPart (const ::defiFPC* obj, int index, int* corner, int* typ, char** name) { 85 | ((LefDefParser::defiFPC*)obj)->getPart(index, corner, typ, name); 86 | } 87 | 88 | void defiFPC_print (const ::defiFPC* obj, FILE* f) { 89 | ((LefDefParser::defiFPC*)obj)->print(f); 90 | } 91 | 92 | -------------------------------------------------------------------------------- /def/cdef/xdefiMisc.cpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! 4 | // ***************************************************************************** 5 | // ***************************************************************************** 6 | // Copyright 2012, Cadence Design Systems 7 | // 8 | // This file is part of the Cadence LEF/DEF Open Source 9 | // Distribution, Product Version 5.8. 10 | // 11 | // Licensed under the Apache License, Version 2.0 (the \"License\"); 12 | // you may not use this file except in compliance with the License. 13 | // You may obtain a copy of the License at 14 | // 15 | // http://www.apache.org/licenses/LICENSE-2.0 16 | // 17 | // Unless required by applicable law or agreed to in writing, software 18 | // distributed under the License is distributed on an \"AS IS\" BASIS, 19 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 20 | // implied. See the License for the specific language governing 21 | // permissions and limitations under the License. 22 | // 23 | // 24 | // For updates, support, or to become part of the LEF/DEF Community, 25 | // check www.openeda.org for details. 26 | // 27 | // $Author: xxx $ 28 | // $Revision: xxx $ 29 | // $Date: xxx $ 30 | // $State: xxx $ 31 | // ***************************************************************************** 32 | // ***************************************************************************** 33 | 34 | #define EXTERN extern "C" 35 | 36 | #include "defiMisc.h" 37 | #include "defiMisc.hpp" 38 | 39 | union udefiPoints { 40 | LefDefParser::defiPoints cpp; 41 | ::defiPoints c; 42 | }; 43 | 44 | // Wrappers definitions. 45 | int defiGeometries_numPoints (const ::defiGeometries* obj) { 46 | return ((LefDefParser::defiGeometries*)obj)->numPoints(); 47 | } 48 | 49 | void defiGeometries_points (const ::defiGeometries* obj, int index, int* x, int* y) { 50 | ((LefDefParser::defiGeometries*)obj)->points(index, x, y); 51 | } 52 | 53 | int defiStyles_style (const ::defiStyles* obj) { 54 | return ((LefDefParser::defiStyles*)obj)->style(); 55 | } 56 | 57 | ::defiPoints defiStyles_getPolygon (const ::defiStyles* obj) { 58 | udefiPoints tmp; 59 | tmp.cpp = ((LefDefParser::defiStyles*)obj)->getPolygon(); 60 | return tmp.c; 61 | } 62 | 63 | -------------------------------------------------------------------------------- /def/cdef/xdefiPinProp.cpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! 4 | // ***************************************************************************** 5 | // ***************************************************************************** 6 | // Copyright 2012, Cadence Design Systems 7 | // 8 | // This file is part of the Cadence LEF/DEF Open Source 9 | // Distribution, Product Version 5.8. 10 | // 11 | // Licensed under the Apache License, Version 2.0 (the \"License\"); 12 | // you may not use this file except in compliance with the License. 13 | // You may obtain a copy of the License at 14 | // 15 | // http://www.apache.org/licenses/LICENSE-2.0 16 | // 17 | // Unless required by applicable law or agreed to in writing, software 18 | // distributed under the License is distributed on an \"AS IS\" BASIS, 19 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 20 | // implied. See the License for the specific language governing 21 | // permissions and limitations under the License. 22 | // 23 | // 24 | // For updates, support, or to become part of the LEF/DEF Community, 25 | // check www.openeda.org for details. 26 | // 27 | // $Author: xxx $ 28 | // $Revision: xxx $ 29 | // $Date: xxx $ 30 | // $State: xxx $ 31 | // ***************************************************************************** 32 | // ***************************************************************************** 33 | 34 | #define EXTERN extern "C" 35 | 36 | #include "defiPinProp.h" 37 | #include "defiPinProp.hpp" 38 | 39 | // Wrappers definitions. 40 | int defiPinProp_isPin (const ::defiPinProp* obj) { 41 | return ((LefDefParser::defiPinProp*)obj)->isPin(); 42 | } 43 | 44 | const char* defiPinProp_instName (const ::defiPinProp* obj) { 45 | return ((const LefDefParser::defiPinProp*)obj)->instName(); 46 | } 47 | 48 | const char* defiPinProp_pinName (const ::defiPinProp* obj) { 49 | return ((const LefDefParser::defiPinProp*)obj)->pinName(); 50 | } 51 | 52 | int defiPinProp_numProps (const ::defiPinProp* obj) { 53 | return ((LefDefParser::defiPinProp*)obj)->numProps(); 54 | } 55 | 56 | const char* defiPinProp_propName (const ::defiPinProp* obj, int index) { 57 | return ((const LefDefParser::defiPinProp*)obj)->propName(index); 58 | } 59 | 60 | const char* defiPinProp_propValue (const ::defiPinProp* obj, int index) { 61 | return ((const LefDefParser::defiPinProp*)obj)->propValue(index); 62 | } 63 | 64 | double defiPinProp_propNumber (const ::defiPinProp* obj, int index) { 65 | return ((LefDefParser::defiPinProp*)obj)->propNumber(index); 66 | } 67 | 68 | const char defiPinProp_propType (const ::defiPinProp* obj, int index) { 69 | return ((const LefDefParser::defiPinProp*)obj)->propType(index); 70 | } 71 | 72 | int defiPinProp_propIsNumber (const ::defiPinProp* obj, int index) { 73 | return ((LefDefParser::defiPinProp*)obj)->propIsNumber(index); 74 | } 75 | 76 | int defiPinProp_propIsString (const ::defiPinProp* obj, int index) { 77 | return ((LefDefParser::defiPinProp*)obj)->propIsString(index); 78 | } 79 | 80 | void defiPinProp_print (const ::defiPinProp* obj, FILE* f) { 81 | ((LefDefParser::defiPinProp*)obj)->print(f); 82 | } 83 | 84 | -------------------------------------------------------------------------------- /def/cdef/xdefiProp.cpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! 4 | // ***************************************************************************** 5 | // ***************************************************************************** 6 | // Copyright 2012, Cadence Design Systems 7 | // 8 | // This file is part of the Cadence LEF/DEF Open Source 9 | // Distribution, Product Version 5.8. 10 | // 11 | // Licensed under the Apache License, Version 2.0 (the \"License\"); 12 | // you may not use this file except in compliance with the License. 13 | // You may obtain a copy of the License at 14 | // 15 | // http://www.apache.org/licenses/LICENSE-2.0 16 | // 17 | // Unless required by applicable law or agreed to in writing, software 18 | // distributed under the License is distributed on an \"AS IS\" BASIS, 19 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 20 | // implied. See the License for the specific language governing 21 | // permissions and limitations under the License. 22 | // 23 | // 24 | // For updates, support, or to become part of the LEF/DEF Community, 25 | // check www.openeda.org for details. 26 | // 27 | // $Author: xxx $ 28 | // $Revision: xxx $ 29 | // $Date: xxx $ 30 | // $State: xxx $ 31 | // ***************************************************************************** 32 | // ***************************************************************************** 33 | 34 | #define EXTERN extern "C" 35 | 36 | #include "defiProp.h" 37 | #include "defiProp.hpp" 38 | 39 | // Wrappers definitions. 40 | const char* defiProp_string (const ::defiProp* obj) { 41 | return ((const LefDefParser::defiProp*)obj)->string(); 42 | } 43 | 44 | const char* defiProp_propType (const ::defiProp* obj) { 45 | return ((const LefDefParser::defiProp*)obj)->propType(); 46 | } 47 | 48 | const char* defiProp_propName (const ::defiProp* obj) { 49 | return ((const LefDefParser::defiProp*)obj)->propName(); 50 | } 51 | 52 | char defiProp_dataType (const ::defiProp* obj) { 53 | return ((LefDefParser::defiProp*)obj)->dataType(); 54 | } 55 | 56 | int defiProp_hasNumber (const ::defiProp* obj) { 57 | return ((LefDefParser::defiProp*)obj)->hasNumber(); 58 | } 59 | 60 | int defiProp_hasRange (const ::defiProp* obj) { 61 | return ((LefDefParser::defiProp*)obj)->hasRange(); 62 | } 63 | 64 | int defiProp_hasString (const ::defiProp* obj) { 65 | return ((LefDefParser::defiProp*)obj)->hasString(); 66 | } 67 | 68 | int defiProp_hasNameMapString (const ::defiProp* obj) { 69 | return ((LefDefParser::defiProp*)obj)->hasNameMapString(); 70 | } 71 | 72 | double defiProp_number (const ::defiProp* obj) { 73 | return ((LefDefParser::defiProp*)obj)->number(); 74 | } 75 | 76 | double defiProp_left (const ::defiProp* obj) { 77 | return ((LefDefParser::defiProp*)obj)->left(); 78 | } 79 | 80 | double defiProp_right (const ::defiProp* obj) { 81 | return ((LefDefParser::defiProp*)obj)->right(); 82 | } 83 | 84 | void defiProp_print (const ::defiProp* obj, FILE* f) { 85 | ((LefDefParser::defiProp*)obj)->print(f); 86 | } 87 | 88 | -------------------------------------------------------------------------------- /def/cdef/xdefiPropType.cpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! 4 | // ***************************************************************************** 5 | // ***************************************************************************** 6 | // Copyright 2012, Cadence Design Systems 7 | // 8 | // This file is part of the Cadence LEF/DEF Open Source 9 | // Distribution, Product Version 5.8. 10 | // 11 | // Licensed under the Apache License, Version 2.0 (the \"License\"); 12 | // you may not use this file except in compliance with the License. 13 | // You may obtain a copy of the License at 14 | // 15 | // http://www.apache.org/licenses/LICENSE-2.0 16 | // 17 | // Unless required by applicable law or agreed to in writing, software 18 | // distributed under the License is distributed on an \"AS IS\" BASIS, 19 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 20 | // implied. See the License for the specific language governing 21 | // permissions and limitations under the License. 22 | // 23 | // 24 | // For updates, support, or to become part of the LEF/DEF Community, 25 | // check www.openeda.org for details. 26 | // 27 | // $Author: xxx $ 28 | // $Revision: xxx $ 29 | // $Date: xxx $ 30 | // $State: xxx $ 31 | // ***************************************************************************** 32 | // ***************************************************************************** 33 | 34 | #define EXTERN extern "C" 35 | 36 | #include "defiPropType.h" 37 | #include "defiPropType.hpp" 38 | 39 | // Wrappers definitions. 40 | const char defiPropType_propType (const ::defiPropType* obj, char* name) { 41 | return ((const LefDefParser::defiPropType*)obj)->propType(name); 42 | } 43 | 44 | -------------------------------------------------------------------------------- /def/cdef/xdefiSlot.cpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! 4 | // ***************************************************************************** 5 | // ***************************************************************************** 6 | // Copyright 2012, Cadence Design Systems 7 | // 8 | // This file is part of the Cadence LEF/DEF Open Source 9 | // Distribution, Product Version 5.8. 10 | // 11 | // Licensed under the Apache License, Version 2.0 (the \"License\"); 12 | // you may not use this file except in compliance with the License. 13 | // You may obtain a copy of the License at 14 | // 15 | // http://www.apache.org/licenses/LICENSE-2.0 16 | // 17 | // Unless required by applicable law or agreed to in writing, software 18 | // distributed under the License is distributed on an \"AS IS\" BASIS, 19 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 20 | // implied. See the License for the specific language governing 21 | // permissions and limitations under the License. 22 | // 23 | // 24 | // For updates, support, or to become part of the LEF/DEF Community, 25 | // check www.openeda.org for details. 26 | // 27 | // $Author: xxx $ 28 | // $Revision: xxx $ 29 | // $Date: xxx $ 30 | // $State: xxx $ 31 | // ***************************************************************************** 32 | // ***************************************************************************** 33 | 34 | #define EXTERN extern "C" 35 | 36 | #include "defiSlot.h" 37 | #include "defiSlot.hpp" 38 | 39 | union udefiPoints { 40 | LefDefParser::defiPoints cpp; 41 | ::defiPoints c; 42 | }; 43 | 44 | // Wrappers definitions. 45 | int defiSlot_hasLayer (const ::defiSlot* obj) { 46 | return ((LefDefParser::defiSlot*)obj)->hasLayer(); 47 | } 48 | 49 | const char* defiSlot_layerName (const ::defiSlot* obj) { 50 | return ((const LefDefParser::defiSlot*)obj)->layerName(); 51 | } 52 | 53 | int defiSlot_numRectangles (const ::defiSlot* obj) { 54 | return ((LefDefParser::defiSlot*)obj)->numRectangles(); 55 | } 56 | 57 | int defiSlot_xl (const ::defiSlot* obj, int index) { 58 | return ((LefDefParser::defiSlot*)obj)->xl(index); 59 | } 60 | 61 | int defiSlot_yl (const ::defiSlot* obj, int index) { 62 | return ((LefDefParser::defiSlot*)obj)->yl(index); 63 | } 64 | 65 | int defiSlot_xh (const ::defiSlot* obj, int index) { 66 | return ((LefDefParser::defiSlot*)obj)->xh(index); 67 | } 68 | 69 | int defiSlot_yh (const ::defiSlot* obj, int index) { 70 | return ((LefDefParser::defiSlot*)obj)->yh(index); 71 | } 72 | 73 | int defiSlot_numPolygons (const ::defiSlot* obj) { 74 | return ((LefDefParser::defiSlot*)obj)->numPolygons(); 75 | } 76 | 77 | ::defiPoints defiSlot_getPolygon (const ::defiSlot* obj, int index) { 78 | udefiPoints tmp; 79 | tmp.cpp = ((LefDefParser::defiSlot*)obj)->getPolygon(index); 80 | return tmp.c; 81 | } 82 | 83 | void defiSlot_print (const ::defiSlot* obj, FILE* f) { 84 | ((LefDefParser::defiSlot*)obj)->print(f); 85 | } 86 | 87 | -------------------------------------------------------------------------------- /def/cdefzlib/Makefile: -------------------------------------------------------------------------------- 1 | LEF_TABNAME = cdefzlib 2 | 3 | FAKE_ALL: all 4 | 5 | DIRNAME = cdefzlib 6 | 7 | LIBTARGET = libcdefzlib.a 8 | 9 | PUBLIC_HDRS = defzlib.h 10 | 11 | LIBSRCS = cdefzlib.c 12 | 13 | include ../template.mk 14 | -------------------------------------------------------------------------------- /def/cdefzlib/cdefzlib.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | ******************************************************************************* 3 | * Copyright 2014, Cadence Design Systems 4 | * 5 | * This file is part of the Cadence LEF/DEF Open Source 6 | * Distribution, Product Version 5.8. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | * implied. See the License for the specific language governing 18 | * permissions and limitations under the License. 19 | * 20 | * For updates, support, or to become part of the LEF/DEF Community, 21 | * check www.openeda.org for details. 22 | ******************************************************************************* 23 | ******************************************************************************/ 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include "zlib.h" 32 | #include "defzlib.h" 33 | #include "defrReader.h" 34 | 35 | /* 36 | * Private functions: 37 | */ 38 | size_t defGZip_read(FILE* file, char* buf, size_t len) { 39 | return gzread((gzFile)file, buf, (unsigned int)len); 40 | } 41 | 42 | /* 43 | * Public functions: 44 | */ 45 | defGZFile 46 | defGZipOpen(const char *gzipPath, const char* mode) { 47 | defGZFile fptr; 48 | 49 | if (!gzipPath) 50 | return NULL; 51 | 52 | fptr = gzopen(gzipPath, mode); 53 | 54 | if (fptr) { 55 | /* successfully open the gzip file */ 56 | /* set the read function to read from a compressed file */ 57 | defrSetReadFunction(defGZip_read); 58 | return (defGZFile)fptr; 59 | } else 60 | return NULL; 61 | } 62 | 63 | int defGZipClose(defGZFile filePtr) { 64 | return (gzclose((gzFile)filePtr)); 65 | } 66 | 67 | int defrReadGZip(defGZFile file, const char* gzipFile, defiUserData uData) { 68 | return defrRead((FILE*)file, gzipFile, uData, 1); 69 | } 70 | -------------------------------------------------------------------------------- /def/cdefzlib/cdefzlib_vc14.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {aeafd166-99c9-4db0-980e-075fa5f41e06} 6 | 7 | 8 | {a6f2e3ed-ea59-4cda-afe8-7504fa2a0ba3} 9 | 10 | 11 | 12 | 13 | Source Files 14 | 15 | 16 | Public Header Files 17 | 18 | 19 | -------------------------------------------------------------------------------- /def/cdefzlib/defzlib.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | ******************************************************************************* 3 | * Copyright 2012, Cadence Design Systems 4 | * 5 | * This file is part of the Cadence LEF/DEF Open Source 6 | * Distribution, Product Version 5.8. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | * implied. See the License for the specific language governing 18 | * permissions and limitations under the License. 19 | * 20 | * For updates, support, or to become part of the LEF/DEF Community, 21 | * check www.openeda.org for details. 22 | ******************************************************************************* 23 | ******************************************************************************/ 24 | 25 | #ifndef CLEFDEFZIP_H 26 | #define CLEFDEFZIP_H 27 | 28 | typedef void* defGZFile; 29 | 30 | /* 31 | * Name: defGZipOpen 32 | * Description: Open a gzip file 33 | * Returns: A file pointer 34 | */ 35 | extern defGZFile defGZipOpen(const char* gzipFile, const char* mode); 36 | 37 | /* 38 | * Name: defGZipClose 39 | * Description: Close a gzip file 40 | * Returns: 0 if no errors 41 | */ 42 | extern int defGZipClose(defGZFile filePtr); 43 | 44 | /* 45 | * Name: defrReadGZip 46 | * Description: Parse a def gzip file 47 | * Returns: 0 if no errors 48 | */ 49 | extern int defrReadGZip(defGZFile file, const char* gzipFile, void* uData); 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /def/def/.gitignore: -------------------------------------------------------------------------------- 1 | def.output 2 | def.tab.* 3 | -------------------------------------------------------------------------------- /def/def/Makefile: -------------------------------------------------------------------------------- 1 | DEF_TABNAME = def 2 | DEF_BISON_SRCS = def.y 3 | 4 | FAKE_ALL: all 5 | 6 | LIBTARGET = libdef.a 7 | 8 | HEADERS = \ 9 | def.tab.h \ 10 | lex.h \ 11 | lex.cpph 12 | 13 | PUBLIC_HDRS = \ 14 | defiAlias.hpp \ 15 | defiAssertion.hpp \ 16 | defiBlockage.hpp \ 17 | defiComponent.hpp \ 18 | defiDebug.hpp \ 19 | defiDefs.hpp \ 20 | defiFPC.hpp \ 21 | defiFill.hpp \ 22 | defiGroup.hpp \ 23 | defiIOTiming.hpp \ 24 | defiKRDefs.hpp \ 25 | defiMisc.hpp \ 26 | defiNet.hpp \ 27 | defiNonDefault.hpp \ 28 | defiPartition.hpp \ 29 | defiPath.hpp \ 30 | defiPinCap.hpp \ 31 | defiPinProp.hpp \ 32 | defiProp.hpp \ 33 | defiPropType.hpp \ 34 | defiRegion.hpp \ 35 | defiRowTrack.hpp \ 36 | defiScanchain.hpp \ 37 | defiSite.hpp \ 38 | defiSlot.hpp \ 39 | defiTimingDisable.hpp \ 40 | defiUser.hpp \ 41 | defiUtil.hpp \ 42 | defiVia.hpp \ 43 | defrCallBacks.hpp \ 44 | defrData.hpp \ 45 | defrReader.hpp \ 46 | defrSettings.hpp \ 47 | defwWriter.hpp \ 48 | defwWriterCalls.hpp 49 | 50 | LIBSRCS = \ 51 | def.tab.cpp \ 52 | def_keywords.cpp \ 53 | defiAlias.cpp \ 54 | defiAssertion.cpp \ 55 | defiBlockage.cpp \ 56 | defiComponent.cpp \ 57 | defiDebug.cpp \ 58 | defiFPC.cpp \ 59 | defiFill.cpp \ 60 | defiGroup.cpp \ 61 | defiIOTiming.cpp \ 62 | defiMisc.cpp \ 63 | defiNet.cpp \ 64 | defiNonDefault.cpp \ 65 | defiPartition.cpp \ 66 | defiPath.cpp \ 67 | defiPinCap.cpp \ 68 | defiPinProp.cpp \ 69 | defiProp.cpp \ 70 | defiPropType.cpp \ 71 | defiRegion.cpp \ 72 | defiRowTrack.cpp \ 73 | defiScanchain.cpp \ 74 | defiSite.cpp \ 75 | defiSlot.cpp \ 76 | defiTimingDisable.cpp \ 77 | defiUtil.cpp \ 78 | defiVia.cpp \ 79 | defrCallbacks.cpp \ 80 | defrData.cpp \ 81 | defrReader.cpp \ 82 | defrSettings.cpp \ 83 | defwWriter.cpp \ 84 | defwWriterCalls.cpp 85 | 86 | def.tab.cpp : $(DEF_BISON_SRCS) 87 | bison -v -p$(DEF_TABNAME)yy -d $(DEF_BISON_SRCS) 88 | mv $(DEF_TABNAME).tab.c $(DEF_TABNAME).tab.cpp ; 89 | 90 | include ../template.mk 91 | -------------------------------------------------------------------------------- /def/def/def_objs.defs: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | # 3 | # def_objs.defs 4 | # 5 | 6 | DEF_SRCS = \ 7 | $(DEF_SRC_DIR)/DFEF_malloc.cpp \ 8 | $(DEF_SRC_DIR)/DFEF_stringhash.cpp \ 9 | $(DEF_SRC_DIR)/def.tab.cpp \ 10 | $(DEF_SRC_DIR)/def_keywords.cpp \ 11 | $(DEF_SRC_DIR)/defiAlias.cpp \ 12 | $(DEF_SRC_DIR)/defiAssertion.cpp \ 13 | $(DEF_SRC_DIR)/defiBlockage.cpp \ 14 | $(DEF_SRC_DIR)/defiComponent.cpp \ 15 | $(DEF_SRC_DIR)/defiDebug.cpp \ 16 | $(DEF_SRC_DIR)/defiFill.cpp \ 17 | $(DEF_SRC_DIR)/defiFPC.cpp \ 18 | $(DEF_SRC_DIR)/defiGroup.cpp \ 19 | $(DEF_SRC_DIR)/defiIOTiming.cpp \ 20 | $(DEF_SRC_DIR)/defiMisc.cpp \ 21 | $(DEF_SRC_DIR)/defiNet.cpp \ 22 | $(DEF_SRC_DIR)/defiNonDefault.cpp \ 23 | $(DEF_SRC_DIR)/defiPartition.cpp \ 24 | $(DEF_SRC_DIR)/defiPath.cpp \ 25 | $(DEF_SRC_DIR)/defiPinCap.cpp \ 26 | $(DEF_SRC_DIR)/defiPinProp.cpp \ 27 | $(DEF_SRC_DIR)/defiProp.cpp \ 28 | $(DEF_SRC_DIR)/defiPropType.cpp \ 29 | $(DEF_SRC_DIR)/defiRegion.cpp \ 30 | $(DEF_SRC_DIR)/defiRowTrack.cpp \ 31 | $(DEF_SRC_DIR)/defiScanchain.cpp \ 32 | $(DEF_SRC_DIR)/defiSite.cpp \ 33 | $(DEF_SRC_DIR)/defiSlot.cpp \ 34 | $(DEF_SRC_DIR)/defiTimingDisable.cpp \ 35 | $(DEF_SRC_DIR)/defiUtil.cpp \ 36 | $(DEF_SRC_DIR)/defiVia.cpp \ 37 | $(DEF_SRC_DIR)/defrReader.cpp \ 38 | $(DEF_SRC_DIR)/defwWriter.cpp \ 39 | $(DEF_SRC_DIR)/defwWriterCalls.cpp 40 | 41 | DEF_BISON_SRCS = $(DEF_SRC_DIR)/def.y 42 | 43 | DEF_OBJS = $(DEF_SRCS:.cpp=.o) 44 | 45 | -------------------------------------------------------------------------------- /def/def/defiAlias.cpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2013 - 2014, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: icftcm $ 24 | // $Revision: #9 $ 25 | // $Date: 2016/10/13 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #include "defiAlias.hpp" 31 | #include "defrData.hpp" 32 | 33 | BEGIN_LEFDEF_PARSER_NAMESPACE 34 | 35 | extern defrContext defContext; 36 | 37 | class defAliasIterator { 38 | public: 39 | std::map::iterator me; 40 | }; 41 | 42 | defiAlias_itr::defiAlias_itr(defrData *data) 43 | : first(1), 44 | iterator(NULL), 45 | defData(data ? data : defContext.data) 46 | { 47 | defiAlias_itr::Init(); 48 | } 49 | 50 | 51 | void defiAlias_itr::Init() { 52 | first = 1; 53 | iterator = new defAliasIterator(); 54 | } 55 | 56 | 57 | void defiAlias_itr::Destroy() { 58 | delete iterator; 59 | iterator = NULL; 60 | } 61 | 62 | 63 | defiAlias_itr::~defiAlias_itr() { 64 | defiAlias_itr::Destroy(); 65 | } 66 | 67 | 68 | int defiAlias_itr::Next() { 69 | if (first) { 70 | first = 0; 71 | iterator->me = defData->def_alias_set.begin(); 72 | } else { 73 | iterator->me++; 74 | } 75 | 76 | if (iterator->me == defData->def_alias_set.end()) { 77 | return 0; 78 | } 79 | 80 | return 1; 81 | } 82 | 83 | 84 | const char* defiAlias_itr::Key() { 85 | if (iterator->me == defData->def_alias_set.end()) { 86 | return NULL; 87 | } 88 | 89 | return iterator->me->first.c_str(); 90 | } 91 | 92 | 93 | const char* defiAlias_itr::Data() { 94 | if (iterator->me == defData->def_alias_set.end()) { 95 | return NULL; 96 | } 97 | 98 | // First char is reserved for 'marked' symbol ('0' or '1') 99 | return iterator->me->second.c_str() + 1; 100 | } 101 | 102 | 103 | int defiAlias_itr::Marked() { 104 | const char *value = iterator->me->second.c_str(); 105 | 106 | if ((value == NULL) || (value[0] == '0')) { 107 | return 0; 108 | }else { 109 | return 1; 110 | } 111 | } 112 | 113 | END_LEFDEF_PARSER_NAMESPACE 114 | 115 | -------------------------------------------------------------------------------- /def/def/defiAlias.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2013 - 2014, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: icftcm $ 24 | // $Revision: #9 $ 25 | // $Date: 2016/10/13 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef defiALIAS_h 31 | #define defiALIAS_h 32 | 33 | #include "defiKRDefs.hpp" 34 | 35 | BEGIN_LEFDEF_PARSER_NAMESPACE 36 | 37 | class defAliasIterator; 38 | class defrData; 39 | 40 | class defiAlias_itr { 41 | public: 42 | defiAlias_itr(defrData *defData = 0); 43 | void Init(); 44 | 45 | void Destroy(); 46 | ~defiAlias_itr(); 47 | 48 | int Next(); 49 | const char* Key(); 50 | const char* Data(); 51 | int Marked(); 52 | 53 | protected: 54 | defAliasIterator *iterator; 55 | int first; 56 | defrData *defData; 57 | }; 58 | 59 | END_LEFDEF_PARSER_NAMESPACE 60 | 61 | USE_LEFDEF_PARSER_NAMESPACE 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /def/def/defiDebug.cpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2013 - 2015, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: icftcm $ 24 | // $Revision: #9 $ 25 | // $Date: 2016/10/13 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #include 31 | #include 32 | #include 33 | #include "lex.h" 34 | #include "defiDebug.hpp" 35 | 36 | 37 | #include "defrData.hpp" 38 | #include "defrSettings.hpp" 39 | 40 | BEGIN_LEFDEF_PARSER_NAMESPACE 41 | 42 | extern defrContext defContext; 43 | 44 | /******************* 45 | * Debug flags: 46 | * 0 - 47 | * 1 - malloc debug 48 | * 2 - print each history size bump up. 49 | * 3 - print each call to CatchAll 50 | * 4 - 51 | * 5 - 52 | * 6 - 53 | * 7 - 54 | * 8 - 55 | * 9 - 56 | * 10 - 57 | * 11 - lexer debug 58 | * 59 | ******************************/ 60 | 61 | /* Set flag */ 62 | void defiSetDebug(int, int) { 63 | } 64 | 65 | /* Read flag */ 66 | int defiDebug(int) { 67 | return 0; 68 | } 69 | 70 | void defiError(int check, int msgNum, const char* mess, defrData *defData) { 71 | /* check is 1 if the caller function has checked totalMsgLimit, etc. */ 72 | if (!defData) { 73 | defData = defContext.data; 74 | } 75 | 76 | return defData->defiError(check, msgNum, mess); 77 | } 78 | 79 | const char* upperCase(const char* str, defrData *defData) { 80 | if (!defData) { 81 | defData = defContext.data; 82 | } 83 | 84 | return defData->upperCase(str); 85 | } 86 | 87 | const char* DEFCASE(const char* ch, defrData *defData) { 88 | if (!defData) { 89 | defData = defContext.data; 90 | } 91 | 92 | return defData->DEFCASE(ch); 93 | } 94 | 95 | END_LEFDEF_PARSER_NAMESPACE 96 | 97 | -------------------------------------------------------------------------------- /def/def/defiDebug.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: icftcm $ 24 | // $Revision: #8 $ 25 | // $Date: 2016/10/13 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef defiDebug_h 31 | #define defiDebug_h 32 | 33 | #include "defiKRDefs.hpp" 34 | 35 | BEGIN_LEFDEF_PARSER_NAMESPACE 36 | 37 | class defrData; 38 | 39 | /* Set flag */ 40 | extern void defiSetDebug (int num, int value) ; 41 | 42 | /* Read flag */ 43 | extern int defiDebug (int num) ; 44 | 45 | /* Error loggin function */ 46 | extern void defiError(int check, int msgNum, const char* message, defrData *defData = NULL); 47 | 48 | /* for auto upshifting names in case insensitive files */ 49 | extern const char* upperCase(const char* c, defrData *defData = NULL); 50 | extern const char* DEFCASE(const char* ch, defrData *defData = NULL); 51 | 52 | END_LEFDEF_PARSER_NAMESPACE 53 | 54 | USE_LEFDEF_PARSER_NAMESPACE 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /def/def/defiFPC.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: icftcm $ 24 | // $Revision: #8 $ 25 | // $Date: 2016/10/13 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef defiFPC_h 31 | #define defiFPC_h 32 | 33 | #include 34 | #include "defiKRDefs.hpp" 35 | 36 | BEGIN_LEFDEF_PARSER_NAMESPACE 37 | 38 | class defrData; 39 | 40 | class defiFPC { 41 | public: 42 | defiFPC(defrData *data); 43 | void Init(); 44 | 45 | void Destroy(); 46 | ~defiFPC(); 47 | 48 | void clear(); 49 | 50 | void setName(const char* name, const char* direction); 51 | void setAlign(); 52 | void setMax(double num); 53 | void setMin(double num); 54 | void setEqual(double num); 55 | void setDoingBottomLeft(); 56 | void setDoingTopRight(); 57 | void addRow(const char* name); 58 | void addComps(const char* name); 59 | void addItem(char typ, const char* name); 60 | 61 | const char* name() const; 62 | int isVertical() const; 63 | int isHorizontal() const; 64 | int hasAlign() const; 65 | int hasMax() const; 66 | int hasMin() const; 67 | int hasEqual() const; 68 | double alignMax() const; 69 | double alignMin() const; 70 | double equal() const; 71 | 72 | int numParts() const; 73 | 74 | // Return the constraint number "index" where index is 75 | // from 0 to numParts() 76 | // The returned corner is 'B' for bottom left 'T' for topright 77 | // The returned typ is 'R' for rows 'C' for comps 78 | // The returned char* points to name of the item. 79 | void getPart(int index, int* corner, int* typ, char** name) const; 80 | 81 | // debug print 82 | void print(FILE* f) const; 83 | 84 | protected: 85 | char* name_; 86 | int nameLength_; 87 | char direction_; // H or V 88 | char hasAlign_; 89 | char hasMin_; 90 | char hasMax_; 91 | char hasEqual_; 92 | char corner_; // Bottomleft or Topright 93 | double minMaxEqual_; 94 | int namesAllocated_; // allocated size of names_ and rowOrComp_ 95 | int namesUsed_; // number of entries used in the arrays 96 | char* rowOrComp_; 97 | char** names_; 98 | 99 | defrData *defData; 100 | }; 101 | 102 | 103 | END_LEFDEF_PARSER_NAMESPACE 104 | 105 | USE_LEFDEF_PARSER_NAMESPACE 106 | 107 | #endif 108 | -------------------------------------------------------------------------------- /def/def/defiGroup.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: icftcm $ 24 | // $Revision: #8 $ 25 | // $Date: 2016/10/13 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef defiGroup_h 31 | #define defiGroup_h 32 | 33 | #include 34 | #include "defiKRDefs.hpp" 35 | 36 | BEGIN_LEFDEF_PARSER_NAMESPACE 37 | 38 | class defrData; 39 | 40 | // Struct holds the data for one property. 41 | 42 | class defiGroup { 43 | public: 44 | defiGroup(defrData *data); 45 | void Init(); 46 | 47 | void Destroy(); 48 | ~defiGroup(); 49 | 50 | void clear(); 51 | 52 | void setup(const char* name); 53 | void addProperty(const char* name, const char* value, const char type); 54 | void addNumProperty(const char* name, const double d, 55 | const char* value, const char type); 56 | void addRegionRect(int xl, int yl, int xh, int yh); 57 | void setRegionName(const char* name); 58 | void setMaxX(int x); 59 | void setMaxY(int y); 60 | void setPerim(int p); 61 | 62 | const char* name() const; 63 | const char* regionName() const; 64 | int hasRegionBox() const; 65 | int hasRegionName() const; 66 | int hasMaxX() const; 67 | int hasMaxY() const; 68 | int hasPerim() const; 69 | void regionRects(int* size, int** xl, int**yl, int** xh, int** yh) const; 70 | int maxX() const; 71 | int maxY() const; 72 | int perim() const; 73 | 74 | int numProps() const; 75 | const char* propName(int index) const; 76 | const char* propValue(int index) const; 77 | double propNumber(int index) const; 78 | const char propType(int index) const; 79 | int propIsNumber(int index) const; 80 | int propIsString(int index) const; 81 | 82 | // debug print 83 | void print(FILE* f) const; 84 | 85 | protected: 86 | char* name_; 87 | int nameLength_; 88 | char* region_; 89 | int regionLength_; 90 | 91 | int rectsAllocated_; 92 | int numRects_; 93 | int* xl_; 94 | int* yl_; 95 | int* xh_; 96 | int* yh_; 97 | 98 | int maxX_; 99 | int maxY_; 100 | int perim_; 101 | char hasRegionBox_; 102 | char hasRegionName_; 103 | char hasPerim_; 104 | char hasMaxX_; 105 | char hasMaxY_; 106 | 107 | int numProps_; 108 | int propsAllocated_; 109 | char** propNames_; 110 | char** propValues_; 111 | double* propDValues_; 112 | char* propTypes_; 113 | 114 | defrData *defData; 115 | }; 116 | 117 | 118 | END_LEFDEF_PARSER_NAMESPACE 119 | 120 | USE_LEFDEF_PARSER_NAMESPACE 121 | 122 | #endif 123 | -------------------------------------------------------------------------------- /def/def/defiKRDefs.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: dell $ 24 | // $Revision: #7 $ 25 | // $Date: 2015/01/27 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef defiKRDEFS_h 31 | #define defiKRDEFS_h 32 | 33 | #define BEGIN_LEFDEF_PARSER_NAMESPACE namespace LefDefParser { 34 | #define END_LEFDEF_PARSER_NAMESPACE } 35 | #define USE_LEFDEF_PARSER_NAMESPACE using namespace LefDefParser; 36 | 37 | #endif /* defiKRDEFS_h */ 38 | -------------------------------------------------------------------------------- /def/def/defiMisc.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: icftcm $ 24 | // $Revision: #8 $ 25 | // $Date: 2016/10/13 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef defiMisc_h 31 | #define defiMisc_h 32 | 33 | #include 34 | #include "defiKRDefs.hpp" 35 | 36 | BEGIN_LEFDEF_PARSER_NAMESPACE 37 | 38 | class defrData; 39 | 40 | struct defiPoints { 41 | int numPoints; 42 | int* x; 43 | int* y; 44 | }; 45 | 46 | class defiGeometries { 47 | public: 48 | defiGeometries(defrData *data); 49 | void Init(); 50 | void Reset(); 51 | 52 | void Destroy(); 53 | ~defiGeometries(); 54 | 55 | void startList(int x, int y); 56 | void addToList(int x, int y); 57 | 58 | int numPoints() const; 59 | void points(int index, int* x, int* y) const; 60 | 61 | protected: 62 | int numPoints_; 63 | int pointsAllocated_; 64 | int* x_; 65 | int* y_; 66 | 67 | defrData *defData; 68 | }; 69 | 70 | class defiStyles { 71 | public: 72 | defiStyles(); 73 | void Init(); 74 | 75 | void Destroy(); 76 | ~defiStyles(); 77 | 78 | void clear(); 79 | 80 | void setStyle(int styleNum); 81 | void setPolygon(defiGeometries* geom); 82 | 83 | int style() const; 84 | struct defiPoints getPolygon() const; 85 | 86 | protected: 87 | int styleNum_; 88 | struct defiPoints* polygon_; 89 | int numPointAlloc_; 90 | }; 91 | 92 | END_LEFDEF_PARSER_NAMESPACE 93 | 94 | USE_LEFDEF_PARSER_NAMESPACE 95 | 96 | #endif 97 | -------------------------------------------------------------------------------- /def/def/defiPinProp.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: icftcm $ 24 | // $Revision: #8 $ 25 | // $Date: 2016/10/13 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef defiPinProp_h 31 | #define defiPinProp_h 32 | 33 | #include "defiKRDefs.hpp" 34 | #include 35 | 36 | BEGIN_LEFDEF_PARSER_NAMESPACE 37 | 38 | class defrData; 39 | 40 | class defiPinProp { 41 | public: 42 | defiPinProp(defrData *data); 43 | void Init(); 44 | 45 | ~defiPinProp(); 46 | void Destroy(); 47 | 48 | void clear(); 49 | 50 | void setName(const char* inst, const char* pin); 51 | void addProperty(const char* name, const char* value, const char type); 52 | void addNumProperty(const char* name, const double d, 53 | const char* value, const char type); 54 | 55 | int isPin() const; 56 | const char* instName() const; 57 | const char* pinName() const; 58 | 59 | int numProps() const; 60 | const char* propName(int index) const; 61 | const char* propValue(int index) const; 62 | double propNumber(int index) const; 63 | const char propType(int index) const; 64 | int propIsNumber(int index) const; 65 | int propIsString(int index) const; 66 | 67 | void print(FILE* f) const; 68 | 69 | protected: 70 | char isPin_; 71 | int instNameSize_; 72 | char* instName_; 73 | int pinNameSize_; 74 | char* pinName_; 75 | 76 | int numProps_; 77 | int propsAllocated_; 78 | char** propNames_; 79 | char** propValues_; 80 | double* propDValues_; 81 | char* propTypes_; 82 | 83 | defrData *defData; 84 | }; 85 | 86 | 87 | END_LEFDEF_PARSER_NAMESPACE 88 | 89 | USE_LEFDEF_PARSER_NAMESPACE 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /def/def/defiProp.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: icftcm $ 24 | // $Revision: #8 $ 25 | // $Date: 2016/10/13 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef defiProp_h 31 | #define defiProp_h 32 | 33 | #include "defiKRDefs.hpp" 34 | #include 35 | 36 | BEGIN_LEFDEF_PARSER_NAMESPACE 37 | 38 | class defrData; 39 | 40 | // Struct holds the data for one property. 41 | class defiProp { 42 | public: 43 | defiProp(defrData *data); 44 | void Init(); 45 | 46 | void Destroy(); 47 | ~defiProp(); 48 | 49 | void setPropType(const char* typ, const char* string); 50 | void setRange(double left, double right); 51 | void setNumber(double num); 52 | void setPropInteger(); 53 | void setPropReal(); 54 | void setPropString(); 55 | void setPropQString(const char* string); 56 | void setPropNameMapString(const char* string); 57 | void clear(); 58 | 59 | const char* string() const; 60 | const char* propType() const; 61 | const char* propName() const; 62 | char dataType() const; 63 | // either I:integer R:real S:string Q:quotedstring N:nameMapString 64 | int hasNumber() const; 65 | int hasRange() const; 66 | int hasString() const; 67 | int hasNameMapString() const; 68 | double number() const; 69 | double left() const; 70 | double right() const; 71 | 72 | void bumpSize(int size); 73 | void bumpName(int size); 74 | 75 | void print(FILE* f) const; 76 | 77 | protected: 78 | char* propType_; // "design" ... 79 | char* propName_; // name. 80 | int nameSize_; // allocated size of name. 81 | char hasRange_; // either 0:NO or 1:YES. 82 | char hasNumber_; // either 0:NO or 1:YES. 83 | char hasNameMapString_; 84 | char dataType_; // either I:integer R:real S:string Q:quotedstring. 85 | // N:nameMapString 86 | char* stringData_; // if it is a string the data is here. 87 | int stringLength_; // allocated size of stringData. 88 | double left_, right_; // if it has a range the numbers are here. 89 | double d_; // if it is a real or int the number is here. 90 | 91 | defrData *defData; 92 | }; 93 | 94 | 95 | END_LEFDEF_PARSER_NAMESPACE 96 | 97 | USE_LEFDEF_PARSER_NAMESPACE 98 | 99 | #endif 100 | -------------------------------------------------------------------------------- /def/def/defiPropType.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: dell $ 24 | // $Revision: #7 $ 25 | // $Date: 2015/01/27 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef defiPropType_h 31 | #define defiPropType_h 32 | 33 | #include "defiKRDefs.hpp" 34 | #include 35 | 36 | BEGIN_LEFDEF_PARSER_NAMESPACE 37 | 38 | // Struct holds the data type for one property, if the property is 39 | // either REAL or INTEGER. 40 | class defiPropType { 41 | public: 42 | defiPropType(); 43 | void Init(); 44 | 45 | void Destroy(); 46 | ~defiPropType(); 47 | 48 | void setPropType(const char* name, const char type); 49 | void Clear(); 50 | 51 | const char propType(char* name) const; 52 | void bumpProps(); 53 | 54 | protected: 55 | int numProperties_; 56 | int propertiesAllocated_; 57 | char** propNames_; // name. 58 | char* propTypes_; // 'R' == "REAL", 'I' == "INTEGER" 59 | }; 60 | 61 | 62 | END_LEFDEF_PARSER_NAMESPACE 63 | 64 | USE_LEFDEF_PARSER_NAMESPACE 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /def/def/defiRegion.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: icftcm $ 24 | // $Revision: #8 $ 25 | // $Date: 2016/10/13 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef defiRegion_h 31 | #define defiRegion_h 32 | 33 | #include "defiKRDefs.hpp" 34 | #include 35 | 36 | BEGIN_LEFDEF_PARSER_NAMESPACE 37 | 38 | class defrData; 39 | 40 | // Struct holds the data for one property. 41 | class defiRegion { 42 | public: 43 | defiRegion(defrData *data); 44 | void Init(); 45 | 46 | void Destroy(); 47 | ~defiRegion(); 48 | 49 | void clear(); 50 | void setup(const char* name); 51 | void addRect(int xl, int yl, int xh, int yh); 52 | void addProperty(const char* name, const char* value, const char type); 53 | void addNumProperty(const char* name, const double d, 54 | const char* value, const char type); 55 | void setType(const char* type); // 5.4.1 56 | 57 | const char* name() const; 58 | 59 | int numProps() const; 60 | const char* propName(int index) const; 61 | const char* propValue(int index) const; 62 | double propNumber(int index) const; 63 | const char propType(int index) const; 64 | int propIsNumber(int index) const; 65 | int propIsString(int index) const; 66 | 67 | int hasType() const; // 5.4.1 68 | const char* type() const; // 5.4.1 69 | 70 | int numRectangles() const; 71 | int xl(int index) const; 72 | int yl(int index) const; 73 | int xh(int index) const; 74 | int yh(int index) const; 75 | 76 | void print(FILE* f) const; 77 | 78 | protected: 79 | char* name_; 80 | int nameLength_; 81 | 82 | int numRectangles_; 83 | int rectanglesAllocated_; 84 | int* xl_; 85 | int* yl_; 86 | int* xh_; 87 | int* yh_; 88 | 89 | int numProps_; 90 | int propsAllocated_; 91 | char** propNames_; 92 | char** propValues_; 93 | double* propDValues_; 94 | char* propTypes_; 95 | 96 | char* type_; 97 | 98 | defrData *defData; 99 | }; 100 | 101 | 102 | 103 | END_LEFDEF_PARSER_NAMESPACE 104 | 105 | USE_LEFDEF_PARSER_NAMESPACE 106 | 107 | #endif 108 | -------------------------------------------------------------------------------- /def/def/defiSite.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: icftcm $ 24 | // $Revision: #8 $ 25 | // $Date: 2016/10/13 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef defiSite_h 31 | #define defiSite_h 32 | 33 | #include "defiKRDefs.hpp" 34 | #include "defiMisc.hpp" 35 | #include 36 | 37 | BEGIN_LEFDEF_PARSER_NAMESPACE 38 | 39 | class defrData; 40 | 41 | /* 42 | * Struct holds the data for one site. 43 | * It is also used for a canplace and cannotoccupy. 44 | */ 45 | class defiSite { 46 | public: 47 | defiSite(defrData *data); 48 | void Init(); 49 | 50 | ~defiSite(); 51 | void Destroy(); 52 | 53 | void clear(); 54 | 55 | void setName(const char* name); 56 | void setLocation(double xorg, double yorg); 57 | void setOrient(int orient); 58 | void setDo(double x_num, double y_num, double x_step, double y_step); 59 | 60 | double x_num() const; 61 | double y_num() const; 62 | double x_step() const; 63 | double y_step() const; 64 | double x_orig() const; 65 | double y_orig() const; 66 | int orient() const; 67 | const char* orientStr() const; 68 | const char* name() const; 69 | 70 | void print(FILE* f) const; 71 | 72 | void bumpName(int size); 73 | 74 | protected: 75 | char* siteName_; // Name of this. 76 | int nameSize_; // allocated size of siteName_ 77 | double x_orig_, y_orig_; // Origin 78 | double x_step_, y_step_; // Array step size. 79 | double x_num_, y_num_; 80 | int orient_; // orientation 81 | 82 | defrData *defData; 83 | }; 84 | 85 | 86 | 87 | /* Struct holds the data for a Box */ 88 | class defiBox { 89 | public: 90 | // Use the default destructor and constructor. 91 | // 5.6 changed to use it own constructor & destructor 92 | 93 | defiBox(); 94 | void Init(); 95 | void Destroy(); 96 | ~defiBox(); 97 | 98 | // NOTE: 5.6 99 | // The following methods are still here for backward compatibility 100 | // For new reader they should use numPoints & getPoint to get the 101 | // data. 102 | int xl() const; 103 | int yl() const; 104 | int xh() const; 105 | int yh() const; 106 | 107 | void addPoint(defiGeometries* geom); 108 | defiPoints getPoint() const; 109 | 110 | void print(FILE* f) const; 111 | 112 | protected: 113 | int xl_, yl_; 114 | int xh_, yh_; 115 | defiPoints* points_; // 5.6 116 | }; 117 | 118 | 119 | END_LEFDEF_PARSER_NAMESPACE 120 | 121 | USE_LEFDEF_PARSER_NAMESPACE 122 | 123 | #endif 124 | -------------------------------------------------------------------------------- /def/def/defiSlot.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: icftcm $ 24 | // $Revision: #8 $ 25 | // $Date: 2016/10/13 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef defiSLOT_h 31 | #define defiSLOT_h 32 | 33 | #include 34 | #include "defiKRDefs.hpp" 35 | #include "defiMisc.hpp" 36 | 37 | BEGIN_LEFDEF_PARSER_NAMESPACE 38 | 39 | class defrData; 40 | 41 | class defiSlot { 42 | public: 43 | defiSlot(defrData *data); 44 | void Init(); 45 | 46 | void Destroy(); 47 | ~defiSlot(); 48 | 49 | void clear(); 50 | void clearPoly(); 51 | 52 | void setLayer(const char* name); 53 | void addRect(int xl, int yl, int xh, int yh); 54 | void addPolygon(defiGeometries* geom); 55 | 56 | int hasLayer() const; 57 | const char* layerName() const; 58 | 59 | int numRectangles() const; 60 | int xl(int index) const; 61 | int yl(int index) const; 62 | int xh(int index) const; 63 | int yh(int index) const; 64 | 65 | int numPolygons() const; // 5.6 66 | defiPoints getPolygon(int index) const; // 5.6 67 | 68 | void print(FILE* f) const; 69 | 70 | protected: 71 | int hasLayer_; 72 | char* layerName_; 73 | int layerNameLength_; 74 | int numRectangles_; 75 | int rectsAllocated_; 76 | int* xl_; 77 | int* yl_; 78 | int* xh_; 79 | int* yh_; 80 | int numPolys_; // 5.6 81 | int polysAllocated_; // 5.6 82 | defiPoints** polygons_; // 5.6 83 | 84 | defrData *defData; 85 | }; 86 | 87 | 88 | END_LEFDEF_PARSER_NAMESPACE 89 | 90 | USE_LEFDEF_PARSER_NAMESPACE 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /def/def/defiTimingDisable.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: icftcm $ 24 | // $Revision: #8 $ 25 | // $Date: 2016/10/13 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef defiTimingDisable_h 31 | #define defiTimingDisable_h 32 | 33 | #include 34 | #include "defiKRDefs.hpp" 35 | 36 | BEGIN_LEFDEF_PARSER_NAMESPACE 37 | 38 | // A Timing disable can be a from-to or a thru or a macro. 39 | // A macro is either a fromto macro or a thru macro. 40 | class defrData; 41 | 42 | 43 | class defiTimingDisable { 44 | public: 45 | defiTimingDisable(defrData *data); 46 | void Init(); 47 | 48 | void Destroy(); 49 | ~defiTimingDisable(); 50 | 51 | void clear(); 52 | 53 | void setFromTo(const char* fromInst, const char* fromPin, 54 | const char* toInst, const char* toPin); 55 | void setThru(const char* fromInst, const char* fromPin); 56 | void setMacro(const char* name); 57 | void setMacroThru(const char* thru); 58 | void setMacroFromTo(const char* fromPin, const char* toPin); 59 | void setReentrantPathsFlag(); 60 | 61 | int hasMacroThru() const; 62 | int hasMacroFromTo() const; 63 | int hasThru() const; 64 | int hasFromTo() const; 65 | int hasReentrantPathsFlag() const; 66 | 67 | const char* fromPin() const; 68 | const char* toPin() const; 69 | const char* fromInst() const; 70 | const char* toInst() const; 71 | const char* macroName() const; 72 | const char* thruPin() const; // Also macro thru 73 | const char* thruInst() const; 74 | 75 | // debug print 76 | void print(FILE* f) const; 77 | 78 | protected: 79 | char* fromInst_; // also macro name and thru inst 80 | int fromInstLength_; 81 | char* toInst_; 82 | int toInstLength_; 83 | char* fromPin_; // also macro thru and thru pin 84 | int fromPinLength_; 85 | char* toPin_; 86 | int toPinLength_; 87 | 88 | int hasFromTo_; 89 | int hasThru_; 90 | int hasMacro_; 91 | int hasReentrantPathsFlag_; 92 | 93 | defrData *defData; 94 | }; 95 | 96 | 97 | END_LEFDEF_PARSER_NAMESPACE 98 | 99 | USE_LEFDEF_PARSER_NAMESPACE 100 | 101 | #endif 102 | -------------------------------------------------------------------------------- /def/def/defiUser.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: dell $ 24 | // $Revision: #7 $ 25 | // $Date: 2015/01/27 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | /* 31 | * User header file for the DEF Interface. This includes 32 | * all of the header files which are relevant to both the 33 | * reader and the writer. 34 | * 35 | * defrReader.h and defwWriter.h include this file, so that 36 | * an application only needs to include either defwReader.h 37 | * or defwWriter.h. 38 | */ 39 | 40 | #ifndef DEFI_USER_H 41 | #define DEFI_USER_H 42 | 43 | /* General utilities. */ 44 | /* #include "defiMalloc.hpp" */ 45 | /* #include "defiUtils.hpp" */ 46 | 47 | /* 48 | * API objects 49 | */ 50 | #include "defiDebug.hpp" 51 | #include "defiProp.hpp" 52 | #include "defiSite.hpp" 53 | #include "defiComponent.hpp" 54 | #include "defiNet.hpp" 55 | #include "defiPath.hpp" 56 | #include "defiPinCap.hpp" 57 | #include "defiRowTrack.hpp" 58 | #include "defiVia.hpp" 59 | #include "defiRegion.hpp" 60 | #include "defiGroup.hpp" 61 | #include "defiAssertion.hpp" 62 | #include "defiScanchain.hpp" 63 | #include "defiIOTiming.hpp" 64 | #include "defiFPC.hpp" 65 | #include "defiTimingDisable.hpp" 66 | #include "defiPartition.hpp" 67 | #include "defiPinProp.hpp" 68 | #include "defiBlockage.hpp" 69 | #include "defiSlot.hpp" 70 | #include "defiFill.hpp" 71 | #include "defiNonDefault.hpp" 72 | #include "defiPropType.hpp" 73 | 74 | BEGIN_LEFDEF_PARSER_NAMESPACE 75 | 76 | /* NEW CALLBACK - If you are creating a new .cpp and .hpp file to 77 | * describe a new class of object in the parser, then add a reference 78 | * to the .hpp here. 79 | * 80 | * You must also add an entry for the .h and the .hpp in the package_list 81 | * file of the ../../../release directory. */ 82 | 83 | END_LEFDEF_PARSER_NAMESPACE 84 | 85 | USE_LEFDEF_PARSER_NAMESPACE 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /def/def/defiUtil.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: dell $ 24 | // $Revision: #7 $ 25 | // $Date: 2015/01/27 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef defiUtil_h 31 | #define defiUtil_h 32 | 33 | #include "defiKRDefs.hpp" 34 | 35 | BEGIN_LEFDEF_PARSER_NAMESPACE 36 | 37 | /* Return codes Orient and Rotation */ 38 | #define DEF_ORIENT_N 0 39 | #define DEF_ORIENT_W 1 40 | #define DEF_ORIENT_S 2 41 | #define DEF_ORIENT_E 3 42 | #define DEF_ORIENT_FN 4 43 | #define DEF_ORIENT_FW 5 44 | #define DEF_ORIENT_FS 6 45 | #define DEF_ORIENT_FE 7 46 | 47 | const char* defiOrientStr(int orient); 48 | 49 | END_LEFDEF_PARSER_NAMESPACE 50 | 51 | #endif 52 | 53 | -------------------------------------------------------------------------------- /def/def/lex.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | ******************************************************************************* 3 | * Copyright 2014, Cadence Design Systems 4 | * 5 | * This file is part of the Cadence LEF/DEF Open Source 6 | * Distribution, Product Version 5.8. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | * implied. See the License for the specific language governing 18 | * permissions and limitations under the License. 19 | * 20 | * For updates, support, or to become part of the LEF/DEF Community, 21 | * check www.openeda.org for details. 22 | ******************************************************************************* 23 | * 24 | * $Author: icftcm $ 25 | * $Revision: #8 $ 26 | * $Date: 2016/10/13 $ 27 | * $State: $ 28 | ******************************************************************************/ 29 | 30 | #include "defiKRDefs.hpp" 31 | #include "defrData.hpp" 32 | 33 | 34 | BEGIN_LEFDEF_PARSER_NAMESPACE 35 | 36 | extern void lex_init(); 37 | extern void lex_un_init(); 38 | extern int defyyparse(defrData *data); 39 | 40 | void AddStringDefine(char *token, char *string); 41 | void AddBooleanDefine(char *token, int val); 42 | void AddNumDefine(char *token, double val); 43 | 44 | int fake_ftell(); 45 | 46 | END_LEFDEF_PARSER_NAMESPACE 47 | -------------------------------------------------------------------------------- /def/defdiff/.gitignore: -------------------------------------------------------------------------------- 1 | defdiff 2 | -------------------------------------------------------------------------------- /def/defdiff/Makefile: -------------------------------------------------------------------------------- 1 | FAKE_ALL: all 2 | 3 | BINTARGET = defdiff 4 | 5 | HEADERS = \ 6 | diffDefRW.hpp 7 | 8 | PUBLIC_HDRS = 9 | 10 | LDLIBS = ../lib/libdef.a 11 | 12 | BINSRCS = \ 13 | diffDefRW.cpp \ 14 | differDef.cpp 15 | 16 | include ../template.mk 17 | -------------------------------------------------------------------------------- /def/defdiff/defdiff_vc14.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {7db7d450-9f3b-44b0-8580-363ef0601fb9} 6 | 7 | 8 | {a6f2e3ed-ea59-4cda-afe8-7504fa2a0ba3} 9 | 10 | 11 | 12 | 13 | Source Files 14 | 15 | 16 | Private Header Files 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /def/defdiff/diffDefRW.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2012, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author$ 24 | // $Revision$ 25 | // $Date$ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef DIFFDEFRW_H 31 | #define DIFFDEFRW_H 32 | 33 | #include 34 | #include 35 | 36 | int diffDefReadFile(char* inFile, char* outFile, char* ignorePinExtra, 37 | char* ignoreRowName, char* ignoreViaName, char* netSegComp); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /def/defrw/.gitignore: -------------------------------------------------------------------------------- 1 | defrw 2 | -------------------------------------------------------------------------------- /def/defrw/Makefile: -------------------------------------------------------------------------------- 1 | FAKE_ALL: all 2 | 3 | BINTARGET = defrw 4 | 5 | HEADERS = 6 | 7 | PUBLIC_HDRS = 8 | 9 | LDLIBS = ../lib/libdef.a 10 | 11 | BINSRCS = \ 12 | defrw.cpp 13 | 14 | include ../template.mk 15 | -------------------------------------------------------------------------------- /def/defrw/defrw_vc14.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {a6f2e3ed-ea59-4cda-afe8-7504fa2a0ba3} 6 | 7 | 8 | 9 | 10 | Source Files 11 | 12 | 13 | -------------------------------------------------------------------------------- /def/defwrite/.gitignore: -------------------------------------------------------------------------------- 1 | defwrite 2 | -------------------------------------------------------------------------------- /def/defwrite/Makefile: -------------------------------------------------------------------------------- 1 | # This make file is for defwrite.cpp only. defwrite.cpp is an example 2 | # which calls directly to the defwWrite calls. It does not use the callback 3 | # mechanism. The user is responsible for the correct sequence of the output. 4 | # 5 | # There is another example (defwriteCbs.cpp) in this directory. This example 6 | # uses the callback mechanism. The user does not have to worry about the 7 | # correct sequence of the def output file. 8 | # To compile defwriteCbs.cpp, you need to create another Makefile which 9 | # is identical to this one, but change the line: 10 | # BINSRCS = defwriteCbs.cpp 11 | 12 | FAKE_ALL: all 13 | 14 | BINTARGET = defwrite 15 | 16 | HEADERS = 17 | 18 | PUBLIC_HDRS = 19 | 20 | LDLIBS = ../lib/libdef.a 21 | 22 | BINSRCS = defwrite.cpp 23 | 24 | include ../template.mk 25 | -------------------------------------------------------------------------------- /def/defwrite/defwrite_vc14.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {a6f2e3ed-ea59-4cda-afe8-7504fa2a0ba3} 6 | 7 | 8 | 9 | 10 | Source Files 11 | 12 | 13 | -------------------------------------------------------------------------------- /def/defzlib/Makefile: -------------------------------------------------------------------------------- 1 | DEF_TABNAME = defzlib 2 | 3 | FAKE_ALL: all 4 | 5 | LIBTARGET = libdefzlib.a 6 | 7 | PUBLIC_HDRS = defzlib.hpp 8 | 9 | LIBSRCS = defzlib.cpp 10 | 11 | include ../template.mk 12 | -------------------------------------------------------------------------------- /def/defzlib/defzlib.cpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2012 - 2015, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: icftcm $ 24 | // $Revision: #9 $ 25 | // $Date: 2016/12/04 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include "zlib.h" 37 | #include "defzlib.hpp" 38 | #include "defrReader.hpp" 39 | 40 | 41 | BEGIN_LEFDEF_PARSER_NAMESPACE 42 | 43 | /* 44 | * Private functions: 45 | */ 46 | size_t defGZip_read(FILE* file, char* buf, size_t len) { 47 | return (gzread((gzFile)file, buf, len)); 48 | } 49 | 50 | /* 51 | * Public functions: 52 | */ 53 | defGZFile 54 | defGZipOpen(const char *gzipPath, const char* mode) { 55 | 56 | if (!gzipPath) 57 | return NULL; 58 | 59 | defGZFile fptr = gzopen(gzipPath, mode); 60 | 61 | if (fptr) { 62 | /* successfully open the gzip file */ 63 | /* set the read function to read from a compressed file */ 64 | defrSetReadFunction(defGZip_read); 65 | return (defGZFile)fptr; 66 | } else 67 | return NULL; 68 | } 69 | 70 | int defGZipClose(defGZFile filePtr) { 71 | defrUnsetReadFunction(); 72 | return (gzclose((gzFile)filePtr)); 73 | } 74 | 75 | int defrReadGZip(defGZFile file, const char* gzipFile, defiUserData uData) { 76 | return defrRead((FILE*)file, gzipFile, uData, 1); 77 | } 78 | 79 | void 80 | defrSetGZipReadFunction() 81 | { 82 | defrSetReadFunction(defGZip_read); 83 | } 84 | 85 | defGZFile 86 | defrGZipOpen(const char *gzipPath, const char* mode) 87 | { 88 | if (!gzipPath) 89 | return NULL; 90 | 91 | return gzopen(gzipPath, mode); 92 | } 93 | 94 | int defrGZipClose(defGZFile filePtr) { 95 | return (gzclose((gzFile)filePtr)); 96 | } 97 | 98 | END_LEFDEF_PARSER_NAMESPACE 99 | -------------------------------------------------------------------------------- /def/defzlib/defzlib.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2012 - 2015, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: icftcm $ 24 | // $Revision: #9 $ 25 | // $Date: 2016/12/04 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef LEFDEFZIP_H 31 | #define LEFDEFZIP_H 32 | 33 | #include "defiDefs.hpp" 34 | 35 | BEGIN_LEFDEF_PARSER_NAMESPACE 36 | 37 | typedef void* defGZFile; 38 | class defrContext; 39 | 40 | // 41 | // Name: defrSetReadGZipFunction 42 | // Description: Sets GZip read function for the parser 43 | // Returns: 0 if no errors 44 | // 45 | extern void defrSetGZipReadFunction(); 46 | 47 | // 48 | // Name: defOpenGZip 49 | // Description: Open a gzip file 50 | // Returns: A file pointer 51 | // 52 | extern defGZFile defrGZipOpen(const char* gzipFile, const char* mode); 53 | 54 | // 55 | // Name: defCloseGZip 56 | // Description: Close a gzip file 57 | // Returns: 0 if no errors 58 | // 59 | extern int defrGZipClose(defGZFile filePtr); 60 | 61 | // 62 | // Name: defrReadGZip 63 | // Description: Parse a def gzip file 64 | // Returns: 0 if no errors 65 | // 66 | extern int defrReadGZip(defGZFile file, const char* gzipFile, void* uData); 67 | 68 | // 69 | // FUNCTIONS TO BE OBSOLETED. 70 | // The API is kept only for compatibility reasons. 71 | // 72 | 73 | // 74 | // Name: defGZipOpen 75 | // Description: Open a gzip file 76 | // Returns: A file pointer 77 | // 78 | extern defGZFile defGZipOpen(const char* gzipFile, const char* mode); 79 | 80 | // 81 | // Name: defGZipClose 82 | // Description: Close a gzip file 83 | // Returns: 0 if no errors 84 | // 85 | extern int defGZipClose(defGZFile filePtr); 86 | 87 | END_LEFDEF_PARSER_NAMESPACE 88 | 89 | USE_LEFDEF_PARSER_NAMESPACE 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /def/defzlib/defzlib_vc14.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {aeafd166-99c9-4db0-980e-075fa5f41e06} 6 | 7 | 8 | {a6f2e3ed-ea59-4cda-afe8-7504fa2a0ba3} 9 | 10 | 11 | 12 | 13 | Source Files 14 | 15 | 16 | Public Header Files 17 | 18 | 19 | -------------------------------------------------------------------------------- /def/doc/defapi.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncvlsi/lefdef/2577884c1219368e9cdb642f341ec0dcd95ed99b/def/doc/defapi.pdf -------------------------------------------------------------------------------- /def/doc/defapiWN.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncvlsi/lefdef/2577884c1219368e9cdb642f341ec0dcd95ed99b/def/doc/defapiWN.pdf -------------------------------------------------------------------------------- /def/template.mk: -------------------------------------------------------------------------------- 1 | SHELL=/bin/sh 2 | 3 | OS_TYPE := $(shell uname -s) 4 | ifeq ($(OS_TYPE),AIX) 5 | ARCH=ibmrs 6 | CXX=/usr/bin/xlC_r -+ -Dibmrs 7 | CC=/usr/bin/cc_r -Dibmrs 8 | endif 9 | ifeq ($(OS_TYPE),HP-UX) 10 | ARCH=hppa 11 | CXX=/opt/aCC/bin/aCC 12 | CXXFLAGS=+DAportable -AA 13 | BIN_LINK_FLAGS=-lPW 14 | endif 15 | 16 | ifeq ($(OS_TYPE),SunOS) 17 | ARCH=sun4v 18 | CXX=CC 19 | CXXFLAGS=-g 20 | endif 21 | 22 | ifeq ($(OS_TYPE),Linux) 23 | ARCH=lnx86 24 | CXX=g++ 25 | CC=gcc 26 | endif 27 | 28 | .SUFFIXES: $(SUFFIXES) .cpp 29 | 30 | 31 | TMP1 = $(LIBSRCS:.cpp=.o) 32 | TMP2 = $(TMP1:.cc=.o) 33 | LIBOBJS = $(TMP2:.c=.o) 34 | 35 | TMP3 = $(BINSRCS:.cpp=.o) 36 | TMP4 = $(TMP3:.cc=.o) 37 | BINOBJS = $(TMP4:.c=.o) 38 | 39 | all: $(LIBTARGET) $(BINTARGET) 40 | 41 | ifdef BINTARGET 42 | INSTALLED_BIN = ../bin/$(BINTARGET) 43 | endif 44 | 45 | 46 | $(INSTALLED_BIN): $(BINTARGET) 47 | @mkdir -p ../bin 48 | @echo $< =\> $@ 49 | @rm -f $(INSTALLED_BIN) 50 | @cp $(BINTARGET) $(INSTALLED_BIN) 51 | 52 | installbin: $(INSTALLED_BIN) 53 | 54 | ifdef LIBTARGET 55 | INSTALLED_LIB = ../lib/$(LIBTARGET) 56 | endif 57 | 58 | 59 | $(INSTALLED_LIB): $(LIBTARGET) 60 | @mkdir -p ../lib 61 | @echo $< =\> $@ 62 | @rm -f $(INSTALLED_LIB) 63 | @cp $(LIBTARGET) $(INSTALLED_LIB) 64 | 65 | installlib: $(INSTALLED_LIB) 66 | 67 | install release: all installhdrs installlib installbin 68 | 69 | INSTALLED_HDRS = $(PUBLIC_HDRS:%=../include/%) 70 | $(INSTALLED_HDRS): ../include/%: % 71 | @mkdir -p ../include 72 | @echo $< =\> $@ 73 | @rm -f $@ 74 | @cp -p $< $@ 75 | 76 | installhdrs: $(INSTALLED_HDRS) 77 | 78 | .cpp.o: 79 | $(COMPILE.cc) -I../include $< 80 | 81 | .c.o: 82 | $(COMPILE.c) -I../include $< 83 | 84 | $(LIBTARGET): $(LIBOBJS) 85 | rm -f $(LIBTARGET) 86 | $(AR) $(ARFLAGS) $(LIBTARGET) $^ 87 | 88 | $(BINTARGET): $(BINOBJS) $(LIBTARGET) $(LDLIBS) 89 | rm -f $(BINTARGET) 90 | $(LINK.cc) -o $(BINTARGET) $(BINOBJS) $(LIBTARGET) $(LDLIBS) $(BIN_LINK_FLAGS) 91 | 92 | clean doclean: 93 | rm -f $(LIBTARGET) $(LIBOBJS) $(BINTARGET) $(BINOBJS) $(INSTALLED_LIB) \ 94 | $(INSTALLED_BIN) $(INSTALLED_HDRS) def.tab.c* def.tab.h 95 | -------------------------------------------------------------------------------- /lef/.gitignore: -------------------------------------------------------------------------------- 1 | include 2 | -------------------------------------------------------------------------------- /lef/LICENSE.TXT: -------------------------------------------------------------------------------- 1 | Copyright 2012 - 2017, Cadence Design Systems 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /lef/Makefile: -------------------------------------------------------------------------------- 1 | # $Source: /usr1/mfg/3.4C/solaris_bld/group/util/makefiles/RCS/dir.mk,v $ 2 | # 3 | # $Author: wanda $ 4 | # $Revision: #3 $ 5 | # $Date: 2004/09/29 $ 6 | # $State: Exp $ 7 | # 8 | 9 | .PHONY: all 10 | all: install release 11 | 12 | BUILD_ORDER = \ 13 | lef \ 14 | clef \ 15 | clefzlib \ 16 | lefzlib \ 17 | lefrw \ 18 | lefwrite \ 19 | lefdiff 20 | 21 | ## HP-UX 9.0.X 22 | OS_TYPE := $(shell uname) 23 | ifeq ($(OS_TYPE),HP-UX) 24 | OPTIMIZE_FLAG = +O2 25 | else 26 | OS_VER := $(shell uname -r) 27 | ifeq ($(findstring 4.1,$(OS_VER)),4.1) 28 | OPTIMIZE_FLAG = -O 29 | else 30 | OPTIMIZE_FLAG = -O 31 | endif 32 | endif 33 | 34 | install: 35 | @$(MAKE) $(MFLAGS) installhdrs installlib installbin 36 | 37 | release: 38 | @$(MAKE) "DEBUG=$(OPTIMIZE_FLAG)" install 39 | 40 | test: 41 | @$(MAKE) "BUILD_ORDER=TEST" dotest 42 | 43 | .PHONY: clean 44 | clean: 45 | @$(MAKE) "BUILD_ORDER += TEST" doclean; 46 | echo $(BUILD_ORDER); 47 | @$(MAKE) doclean; 48 | 49 | .DEFAULT: 50 | @for i in $(BUILD_ORDER) ;do \ 51 | echo $(MAKE) $@ in $$i ; \ 52 | cd $$i ; \ 53 | $(MAKE) $(MFLAGS) $@ || exit ; \ 54 | cd .. ; \ 55 | done 56 | 57 | .DELETE_ON_ERROR: 58 | -------------------------------------------------------------------------------- /lef/TEST/Makefile: -------------------------------------------------------------------------------- 1 | FAKE_ALL: all 2 | 3 | all: test 4 | 5 | install: test 6 | 7 | dotest: test 8 | 9 | clean doclean: 10 | rm -f run.output run.stderr diff.out 11 | 12 | TEST_FILE = complete.5.8.lef 13 | 14 | TEST_GOLD = complete.5.8.lef.au 15 | 16 | test: ../bin/lefrw 17 | ../bin/lefrw -65nm -lef58 $(TEST_FILE) > run.output 2> run.stderr 18 | diff run.output $(TEST_GOLD) && echo TEST PASSED 19 | -------------------------------------------------------------------------------- /lef/bin/.gitignore: -------------------------------------------------------------------------------- 1 | lefdiff 2 | lefrw 3 | lefwrite 4 | -------------------------------------------------------------------------------- /lef/clef/Makefile: -------------------------------------------------------------------------------- 1 | LEF_TABNAME = lef 2 | LEF_BISON_SRCS = lef.y 3 | 4 | FAKE_ALL: all 5 | 6 | DIRNAME = lef 7 | LEF_BISON_SRCS = lef.y 8 | 9 | LIBTARGET = libclef.a 10 | 11 | PUBLIC_HDRS = lefiArray.h \ 12 | lefiCrossTalk.h \ 13 | lefiDebug.h \ 14 | lefiEncryptInt.h \ 15 | lefiLayer.h \ 16 | lefiMacro.h \ 17 | lefiMisc.h \ 18 | lefiNonDefault.h \ 19 | lefiProp.h \ 20 | lefiPropType.h \ 21 | lefiTypedefs.h \ 22 | lefiUnits.h \ 23 | lefiUser.h \ 24 | lefiUtil.h \ 25 | lefiVia.h \ 26 | lefiViaRule.h \ 27 | lefrReader.h \ 28 | lefwWriter.h \ 29 | lefwWriterCalls.h 30 | 31 | LIBSRCS = xlefiArray.cpp \ 32 | xlefiCrossTalk.cpp \ 33 | xlefiDebug.cpp \ 34 | xlefiEncryptInt.cpp \ 35 | xlefiLayer.cpp \ 36 | xlefiMacro.cpp \ 37 | xlefiMisc.cpp \ 38 | xlefiNonDefault.cpp \ 39 | xlefiProp.cpp \ 40 | xlefiPropType.cpp \ 41 | xlefiUnits.cpp \ 42 | xlefiUtil.cpp \ 43 | xlefiVia.cpp \ 44 | xlefiViaRule.cpp \ 45 | xlefrReader.cpp \ 46 | xlefwWriter.cpp \ 47 | xlefwWriterCalls.cpp 48 | 49 | include ../template.mk 50 | -------------------------------------------------------------------------------- /lef/clef/lefiCrossTalk.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* ************************************************************************** */ 3 | /* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! */ 4 | /* ************************************************************************** */ 5 | /* ************************************************************************** */ 6 | /* Copyright 2012 - 2013, Cadence Design Systems */ 7 | /* */ 8 | /* This file is part of the Cadence LEF/DEF Open Source */ 9 | /* Distribution, Product Version 5.8. */ 10 | /* */ 11 | /* Licensed under the Apache License, Version 2.0 (the "License"); */ 12 | /* you may not use this file except in compliance with the License. */ 13 | /* You may obtain a copy of the License at */ 14 | /* */ 15 | /* http://www.apache.org/licenses/LICENSE-2.0 */ 16 | /* */ 17 | /* Unless required by applicable law or agreed to in writing, software */ 18 | /* distributed under the License is distributed on an "AS IS" BASIS, */ 19 | /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ 20 | /* implied. See the License for the specific language governing */ 21 | /* permissions and limitations under the License. */ 22 | /* */ 23 | /* For updates, support, or to become part of the LEF/DEF Community, */ 24 | /* check www.openeda.org for details. */ 25 | /* */ 26 | /* $Author: dell $ */ 27 | /* $Revision: #7 $ */ 28 | /* $Date: 2015/01/27 $ */ 29 | /* $State: $ */ 30 | /* ************************************************************************** */ 31 | /* ************************************************************************** */ 32 | 33 | 34 | #ifndef CLEFICROSSTALK_H 35 | #define CLEFICROSSTALK_H 36 | 37 | #include 38 | #include "lefiTypedefs.h" 39 | 40 | /* Structure returned for the noise margin callback. */ 41 | /* This lef construct has two floating point numbers. */ 42 | 43 | EXTERN double lefiNoiseVictim_length (const lefiNoiseVictim* obj); 44 | EXTERN int lefiNoiseVictim_numNoises (const lefiNoiseVictim* obj); 45 | EXTERN double lefiNoiseVictim_noise (const lefiNoiseVictim* obj, int index); 46 | 47 | EXTERN int lefiNoiseResistance_numNums (const lefiNoiseResistance* obj); 48 | EXTERN double lefiNoiseResistance_num (const lefiNoiseResistance* obj, int index); 49 | 50 | EXTERN int lefiNoiseResistance_numVictims (const lefiNoiseResistance* obj); 51 | EXTERN const lefiNoiseVictim* lefiNoiseResistance_victim (const lefiNoiseResistance* obj, int index); 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /lef/clef/lefiDebug.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* ************************************************************************** */ 3 | /* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! */ 4 | /* ************************************************************************** */ 5 | /* ************************************************************************** */ 6 | /* Copyright 2012 - 2013, Cadence Design Systems */ 7 | /* */ 8 | /* This file is part of the Cadence LEF/DEF Open Source */ 9 | /* Distribution, Product Version 5.8. */ 10 | /* */ 11 | /* Licensed under the Apache License, Version 2.0 (the "License"); */ 12 | /* you may not use this file except in compliance with the License. */ 13 | /* You may obtain a copy of the License at */ 14 | /* */ 15 | /* http://www.apache.org/licenses/LICENSE-2.0 */ 16 | /* */ 17 | /* Unless required by applicable law or agreed to in writing, software */ 18 | /* distributed under the License is distributed on an "AS IS" BASIS, */ 19 | /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ 20 | /* implied. See the License for the specific language governing */ 21 | /* permissions and limitations under the License. */ 22 | /* */ 23 | /* For updates, support, or to become part of the LEF/DEF Community, */ 24 | /* check www.openeda.org for details. */ 25 | /* */ 26 | /* $Author: dell $ */ 27 | /* $Revision: #7 $ */ 28 | /* $Date: 2015/01/27 $ */ 29 | /* $State: $ */ 30 | /* ************************************************************************** */ 31 | /* ************************************************************************** */ 32 | 33 | 34 | #ifndef CLEFIDEBUG_H 35 | #define CLEFIDEBUG_H 36 | 37 | #include 38 | #include "lefiTypedefs.h" 39 | 40 | /* Set flag */ 41 | EXTERN void lefiSetDebug (int num, int value); 42 | 43 | /* Read flag */ 44 | EXTERN int lefiDebug (int num); 45 | 46 | /* Error reporting routine */ 47 | EXTERN void lefiError (int check, int msgNum, const char* msg); 48 | 49 | EXTERN const char* CASE (const char * x); 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /lef/clef/lefiEncryptExt.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Cadence LEF/DEF Open Source 3 | * Distribution, Product Version 5.7, and is subject to the Cadence LEF/DEF 4 | * Open Source License Agreement. Your continued use of this file 5 | * constitutes your acceptance of the terms of the LEF/DEF Open Source 6 | * License and an agreement to abide by its terms. If you don't agree 7 | * with this, you must remove this and any other files which are part of the 8 | * distribution and destroy any copies made. 9 | * 10 | * For updates, support, or to become part of the LEF/DEF Community, check 11 | * www.openeda.org for details. 12 | */ 13 | #include 14 | 15 | /* 16 | * Global variables 17 | */ int lefrReadEncrypted = 0; 18 | -------------------------------------------------------------------------------- /lef/clef/lefiEncryptInt.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* ************************************************************************** */ 3 | /* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! */ 4 | /* ************************************************************************** */ 5 | /* ************************************************************************** */ 6 | /* Copyright 2012 - 2013, Cadence Design Systems */ 7 | /* */ 8 | /* This file is part of the Cadence LEF/DEF Open Source */ 9 | /* Distribution, Product Version 5.8. */ 10 | /* */ 11 | /* Licensed under the Apache License, Version 2.0 (the "License"); */ 12 | /* you may not use this file except in compliance with the License. */ 13 | /* You may obtain a copy of the License at */ 14 | /* */ 15 | /* http://www.apache.org/licenses/LICENSE-2.0 */ 16 | /* */ 17 | /* Unless required by applicable law or agreed to in writing, software */ 18 | /* distributed under the License is distributed on an "AS IS" BASIS, */ 19 | /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ 20 | /* implied. See the License for the specific language governing */ 21 | /* permissions and limitations under the License. */ 22 | /* */ 23 | /* For updates, support, or to become part of the LEF/DEF Community, */ 24 | /* check www.openeda.org for details. */ 25 | /* */ 26 | /* $Author: dell $ */ 27 | /* $Revision: #7 $ */ 28 | /* $Date: 2015/01/27 $ */ 29 | /* $State: $ */ 30 | /* ************************************************************************** */ 31 | /* ************************************************************************** */ 32 | 33 | 34 | #ifndef CLEFIENCRYPTINT_H 35 | #define CLEFIENCRYPTINT_H 36 | 37 | #include 38 | #include "lefiTypedefs.h" 39 | 40 | /* Unable the reader to read encrypted lef file. */ 41 | /* This function must be called before lefrRead(). */ 42 | /* / */ 43 | EXTERN void lefrEnableReadEncrypted (); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /lef/clef/lefiPropType.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* ************************************************************************** */ 3 | /* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! */ 4 | /* ************************************************************************** */ 5 | /* ************************************************************************** */ 6 | /* Copyright 2012 - 2013, Cadence Design Systems */ 7 | /* */ 8 | /* This file is part of the Cadence LEF/DEF Open Source */ 9 | /* Distribution, Product Version 5.8. */ 10 | /* */ 11 | /* Licensed under the Apache License, Version 2.0 (the "License"); */ 12 | /* you may not use this file except in compliance with the License. */ 13 | /* You may obtain a copy of the License at */ 14 | /* */ 15 | /* http://www.apache.org/licenses/LICENSE-2.0 */ 16 | /* */ 17 | /* Unless required by applicable law or agreed to in writing, software */ 18 | /* distributed under the License is distributed on an "AS IS" BASIS, */ 19 | /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ 20 | /* implied. See the License for the specific language governing */ 21 | /* permissions and limitations under the License. */ 22 | /* */ 23 | /* For updates, support, or to become part of the LEF/DEF Community, */ 24 | /* check www.openeda.org for details. */ 25 | /* */ 26 | /* $Author: dell $ */ 27 | /* $Revision: #7 $ */ 28 | /* $Date: 2015/01/27 $ */ 29 | /* $State: $ */ 30 | /* ************************************************************************** */ 31 | /* ************************************************************************** */ 32 | 33 | 34 | #ifndef CLEFIPROPTYPE_H 35 | #define CLEFIPROPTYPE_H 36 | 37 | #include 38 | #include "lefiTypedefs.h" 39 | 40 | /* Struct holds the data type for one property, if the property is */ 41 | /* either REAL or INTEGER. */ 42 | 43 | EXTERN const char lefiPropType_propType (const lefiPropType* obj, char* name); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /lef/clef/lefiTBInt.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Cadence LEF/DEF Open Source 3 | * Distribution, Product Version 5.7, and is subject to the Cadence LEF/DEF 4 | * Open Source License Agreement. Your continued use of this file 5 | * constitutes your acceptance of the terms of the LEF/DEF Open Source 6 | * License and an agreement to abide by its terms. If you don't agree 7 | * with this, you must remove this and any other files which are part of the 8 | * distribution and destroy any copies made. 9 | * 10 | * For updates, support, or to become part of the LEF/DEF Community, check 11 | * www.openeda.org for details. 12 | */ 13 | #include 14 | 15 | /* 16 | * lefiTimeBomb 17 | *//* Internal time bomb. Always return date current *//* Check the current 18 | date against the date given */ int 19 | lefiValidTime() 20 | { 21 | return (1); 22 | } 23 | 24 | /* 25 | * Internal check, always return ok 26 | *//* Check the current date against the date given */ int 27 | lefiValidUser() 28 | { 29 | return (1); 30 | } 31 | 32 | /* 33 | * Internal, return Cadence Design Systems 34 | *//* Check the current date against the date given */ char * 35 | lefiUser() 36 | { 37 | return ((char *) "Cadence Design Systems"); 38 | } 39 | -------------------------------------------------------------------------------- /lef/clef/lefiUtil.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* ************************************************************************** */ 3 | /* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! */ 4 | /* ************************************************************************** */ 5 | /* ************************************************************************** */ 6 | /* Copyright 2012 - 2013, Cadence Design Systems */ 7 | /* */ 8 | /* This file is part of the Cadence LEF/DEF Open Source */ 9 | /* Distribution, Product Version 5.8. */ 10 | /* */ 11 | /* Licensed under the Apache License, Version 2.0 (the "License"); */ 12 | /* you may not use this file except in compliance with the License. */ 13 | /* You may obtain a copy of the License at */ 14 | /* */ 15 | /* http://www.apache.org/licenses/LICENSE-2.0 */ 16 | /* */ 17 | /* Unless required by applicable law or agreed to in writing, software */ 18 | /* distributed under the License is distributed on an "AS IS" BASIS, */ 19 | /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ 20 | /* implied. See the License for the specific language governing */ 21 | /* permissions and limitations under the License. */ 22 | /* */ 23 | /* For updates, support, or to become part of the LEF/DEF Community, */ 24 | /* check www.openeda.org for details. */ 25 | /* */ 26 | /* $Author: dell $ */ 27 | /* $Revision: #7 $ */ 28 | /* $Date: 2015/01/27 $ */ 29 | /* $State: $ */ 30 | /* ************************************************************************** */ 31 | /* ************************************************************************** */ 32 | 33 | 34 | #ifndef CLEFIUTIL_H 35 | #define CLEFIUTIL_H 36 | 37 | #include 38 | #include "lefiTypedefs.h" 39 | 40 | /* Structure to return Macro data to FE */ 41 | 42 | /*int lefiValidTime(); */ 43 | EXTERN int lefiValidUser (); 44 | 45 | EXTERN char* lefiUser (); 46 | 47 | EXTERN char* lefiOrientStr (int orient); 48 | 49 | EXTERN double convert_name2num (const char * versionName); 50 | 51 | EXTERN bool validateMaskNumber (int num); 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /lef/clef/xlefiCrossTalk.cpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! 4 | // ***************************************************************************** 5 | // ***************************************************************************** 6 | // Copyright 2012, Cadence Design Systems 7 | // 8 | // This file is part of the Cadence LEF/DEF Open Source 9 | // Distribution, Product Version 5.8. 10 | // 11 | // Licensed under the Apache License, Version 2.0 (the \"License\"); 12 | // you may not use this file except in compliance with the License. 13 | // You may obtain a copy of the License at 14 | // 15 | // http://www.apache.org/licenses/LICENSE-2.0 16 | // 17 | // Unless required by applicable law or agreed to in writing, software 18 | // distributed under the License is distributed on an \"AS IS\" BASIS, 19 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 20 | // implied. See the License for the specific language governing 21 | // permissions and limitations under the License. 22 | // 23 | // 24 | // For updates, support, or to become part of the LEF/DEF Community, 25 | // check www.openeda.org for details. 26 | // 27 | // $Author: dell $ 28 | // $Revision: #7 $ 29 | // $Date: 2015/01/27 $ 30 | // $State: $ 31 | // ***************************************************************************** 32 | // ***************************************************************************** 33 | 34 | #define EXTERN extern "C" 35 | 36 | #include "lefiCrossTalk.h" 37 | #include "lefiCrossTalk.hpp" 38 | 39 | // Wrappers definitions. 40 | double lefiNoiseVictim_length (const ::lefiNoiseVictim* obj) { 41 | return ((LefDefParser::lefiNoiseVictim*)obj)->length(); 42 | } 43 | 44 | int lefiNoiseVictim_numNoises (const ::lefiNoiseVictim* obj) { 45 | return ((LefDefParser::lefiNoiseVictim*)obj)->numNoises(); 46 | } 47 | 48 | double lefiNoiseVictim_noise (const ::lefiNoiseVictim* obj, int index) { 49 | return ((LefDefParser::lefiNoiseVictim*)obj)->noise(index); 50 | } 51 | 52 | int lefiNoiseResistance_numNums (const ::lefiNoiseResistance* obj) { 53 | return ((LefDefParser::lefiNoiseResistance*)obj)->numNums(); 54 | } 55 | 56 | double lefiNoiseResistance_num (const ::lefiNoiseResistance* obj, int index) { 57 | return ((LefDefParser::lefiNoiseResistance*)obj)->num(index); 58 | } 59 | 60 | int lefiNoiseResistance_numVictims (const ::lefiNoiseResistance* obj) { 61 | return ((LefDefParser::lefiNoiseResistance*)obj)->numVictims(); 62 | } 63 | 64 | const ::lefiNoiseVictim* lefiNoiseResistance_victim (const ::lefiNoiseResistance* obj, int index) { 65 | return (const ::lefiNoiseVictim*) ((LefDefParser::lefiNoiseResistance*)obj)->victim(index); 66 | } 67 | 68 | -------------------------------------------------------------------------------- /lef/clef/xlefiDebug.cpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! 4 | // ***************************************************************************** 5 | // ***************************************************************************** 6 | // Copyright 2012, Cadence Design Systems 7 | // 8 | // This file is part of the Cadence LEF/DEF Open Source 9 | // Distribution, Product Version 5.8. 10 | // 11 | // Licensed under the Apache License, Version 2.0 (the \"License\"); 12 | // you may not use this file except in compliance with the License. 13 | // You may obtain a copy of the License at 14 | // 15 | // http://www.apache.org/licenses/LICENSE-2.0 16 | // 17 | // Unless required by applicable law or agreed to in writing, software 18 | // distributed under the License is distributed on an \"AS IS\" BASIS, 19 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 20 | // implied. See the License for the specific language governing 21 | // permissions and limitations under the License. 22 | // 23 | // 24 | // For updates, support, or to become part of the LEF/DEF Community, 25 | // check www.openeda.org for details. 26 | // 27 | // $Author: dell $ 28 | // $Revision: #7 $ 29 | // $Date: 2015/01/27 $ 30 | // $State: $ 31 | // ***************************************************************************** 32 | // ***************************************************************************** 33 | 34 | #define EXTERN extern "C" 35 | 36 | #include "lefiDebug.h" 37 | #include "lefiDebug.hpp" 38 | 39 | // Wrappers definitions. 40 | void lefiSetDebug (int num, int value) { 41 | LefDefParser::lefiSetDebug(num, value); 42 | } 43 | 44 | int lefiDebug (int num) { 45 | return LefDefParser::lefiDebug(num); 46 | } 47 | 48 | void lefiError (int check, int msgNum, const char* msg) { 49 | LefDefParser::lefiError(check, msgNum, msg); 50 | } 51 | 52 | const char* CASE (const char * x) { 53 | return LefDefParser::CASE(x); 54 | } 55 | 56 | -------------------------------------------------------------------------------- /lef/clef/xlefiEncryptInt.cpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! 4 | // ***************************************************************************** 5 | // ***************************************************************************** 6 | // Copyright 2012, Cadence Design Systems 7 | // 8 | // This file is part of the Cadence LEF/DEF Open Source 9 | // Distribution, Product Version 5.8. 10 | // 11 | // Licensed under the Apache License, Version 2.0 (the \"License\"); 12 | // you may not use this file except in compliance with the License. 13 | // You may obtain a copy of the License at 14 | // 15 | // http://www.apache.org/licenses/LICENSE-2.0 16 | // 17 | // Unless required by applicable law or agreed to in writing, software 18 | // distributed under the License is distributed on an \"AS IS\" BASIS, 19 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 20 | // implied. See the License for the specific language governing 21 | // permissions and limitations under the License. 22 | // 23 | // 24 | // For updates, support, or to become part of the LEF/DEF Community, 25 | // check www.openeda.org for details. 26 | // 27 | // $Author: dell $ 28 | // $Revision: #7 $ 29 | // $Date: 2015/01/27 $ 30 | // $State: $ 31 | // ***************************************************************************** 32 | // ***************************************************************************** 33 | 34 | #define EXTERN extern "C" 35 | 36 | #include "lefiEncryptInt.h" 37 | #include "lefiEncryptInt.hpp" 38 | 39 | // Wrappers definitions. 40 | void lefrEnableReadEncrypted () { 41 | LefDefParser::lefrEnableReadEncrypted(); 42 | } 43 | 44 | -------------------------------------------------------------------------------- /lef/clef/xlefiProp.cpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! 4 | // ***************************************************************************** 5 | // ***************************************************************************** 6 | // Copyright 2012, Cadence Design Systems 7 | // 8 | // This file is part of the Cadence LEF/DEF Open Source 9 | // Distribution, Product Version 5.8. 10 | // 11 | // Licensed under the Apache License, Version 2.0 (the \"License\"); 12 | // you may not use this file except in compliance with the License. 13 | // You may obtain a copy of the License at 14 | // 15 | // http://www.apache.org/licenses/LICENSE-2.0 16 | // 17 | // Unless required by applicable law or agreed to in writing, software 18 | // distributed under the License is distributed on an \"AS IS\" BASIS, 19 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 20 | // implied. See the License for the specific language governing 21 | // permissions and limitations under the License. 22 | // 23 | // 24 | // For updates, support, or to become part of the LEF/DEF Community, 25 | // check www.openeda.org for details. 26 | // 27 | // $Author: dell $ 28 | // $Revision: #7 $ 29 | // $Date: 2015/01/27 $ 30 | // $State: $ 31 | // ***************************************************************************** 32 | // ***************************************************************************** 33 | 34 | #define EXTERN extern "C" 35 | 36 | #include "lefiProp.h" 37 | #include "lefiProp.hpp" 38 | 39 | // Wrappers definitions. 40 | const char* lefiProp_string (const ::lefiProp* obj) { 41 | return ((const LefDefParser::lefiProp*)obj)->string(); 42 | } 43 | 44 | const char* lefiProp_propType (const ::lefiProp* obj) { 45 | return ((const LefDefParser::lefiProp*)obj)->propType(); 46 | } 47 | 48 | const char* lefiProp_propName (const ::lefiProp* obj) { 49 | return ((const LefDefParser::lefiProp*)obj)->propName(); 50 | } 51 | 52 | char lefiProp_dataType (const ::lefiProp* obj) { 53 | return ((LefDefParser::lefiProp*)obj)->dataType(); 54 | } 55 | 56 | int lefiProp_hasNumber (const ::lefiProp* obj) { 57 | return ((LefDefParser::lefiProp*)obj)->hasNumber(); 58 | } 59 | 60 | int lefiProp_hasRange (const ::lefiProp* obj) { 61 | return ((LefDefParser::lefiProp*)obj)->hasRange(); 62 | } 63 | 64 | int lefiProp_hasString (const ::lefiProp* obj) { 65 | return ((LefDefParser::lefiProp*)obj)->hasString(); 66 | } 67 | 68 | int lefiProp_hasNameMapString (const ::lefiProp* obj) { 69 | return ((LefDefParser::lefiProp*)obj)->hasNameMapString(); 70 | } 71 | 72 | double lefiProp_number (const ::lefiProp* obj) { 73 | return ((LefDefParser::lefiProp*)obj)->number(); 74 | } 75 | 76 | double lefiProp_left (const ::lefiProp* obj) { 77 | return ((LefDefParser::lefiProp*)obj)->left(); 78 | } 79 | 80 | double lefiProp_right (const ::lefiProp* obj) { 81 | return ((LefDefParser::lefiProp*)obj)->right(); 82 | } 83 | 84 | void lefiProp_print (const ::lefiProp* obj, FILE* f) { 85 | ((LefDefParser::lefiProp*)obj)->print(f); 86 | } 87 | 88 | -------------------------------------------------------------------------------- /lef/clef/xlefiPropType.cpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! 4 | // ***************************************************************************** 5 | // ***************************************************************************** 6 | // Copyright 2012, Cadence Design Systems 7 | // 8 | // This file is part of the Cadence LEF/DEF Open Source 9 | // Distribution, Product Version 5.8. 10 | // 11 | // Licensed under the Apache License, Version 2.0 (the \"License\"); 12 | // you may not use this file except in compliance with the License. 13 | // You may obtain a copy of the License at 14 | // 15 | // http://www.apache.org/licenses/LICENSE-2.0 16 | // 17 | // Unless required by applicable law or agreed to in writing, software 18 | // distributed under the License is distributed on an \"AS IS\" BASIS, 19 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 20 | // implied. See the License for the specific language governing 21 | // permissions and limitations under the License. 22 | // 23 | // 24 | // For updates, support, or to become part of the LEF/DEF Community, 25 | // check www.openeda.org for details. 26 | // 27 | // $Author: dell $ 28 | // $Revision: #7 $ 29 | // $Date: 2015/01/27 $ 30 | // $State: $ 31 | // ***************************************************************************** 32 | // ***************************************************************************** 33 | 34 | #define EXTERN extern "C" 35 | 36 | #include "lefiPropType.h" 37 | #include "lefiPropType.hpp" 38 | 39 | // Wrappers definitions. 40 | const char lefiPropType_propType (const ::lefiPropType* obj, char* name) { 41 | return ((const LefDefParser::lefiPropType*)obj)->propType(name); 42 | } 43 | 44 | -------------------------------------------------------------------------------- /lef/clef/xlefiUtil.cpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! 4 | // ***************************************************************************** 5 | // ***************************************************************************** 6 | // Copyright 2012, Cadence Design Systems 7 | // 8 | // This file is part of the Cadence LEF/DEF Open Source 9 | // Distribution, Product Version 5.8. 10 | // 11 | // Licensed under the Apache License, Version 2.0 (the \"License\"); 12 | // you may not use this file except in compliance with the License. 13 | // You may obtain a copy of the License at 14 | // 15 | // http://www.apache.org/licenses/LICENSE-2.0 16 | // 17 | // Unless required by applicable law or agreed to in writing, software 18 | // distributed under the License is distributed on an \"AS IS\" BASIS, 19 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 20 | // implied. See the License for the specific language governing 21 | // permissions and limitations under the License. 22 | // 23 | // 24 | // For updates, support, or to become part of the LEF/DEF Community, 25 | // check www.openeda.org for details. 26 | // 27 | // $Author: dell $ 28 | // $Revision: #7 $ 29 | // $Date: 2015/01/27 $ 30 | // $State: $ 31 | // ***************************************************************************** 32 | // ***************************************************************************** 33 | 34 | #define EXTERN extern "C" 35 | 36 | #include "lefiUtil.h" 37 | #include "lefiUtil.hpp" 38 | 39 | // Wrappers definitions. 40 | int lefiValidUser () { 41 | return LefDefParser::lefiValidUser(); 42 | } 43 | 44 | char* lefiUser () { 45 | return LefDefParser::lefiUser(); 46 | } 47 | 48 | char* lefiOrientStr (int orient) { 49 | return LefDefParser::lefiOrientStr(orient); 50 | } 51 | 52 | double convert_name2num (const char * versionName) { 53 | return LefDefParser::convert_name2num(versionName); 54 | } 55 | 56 | bool validateMaskNumber (int num) { 57 | return LefDefParser::validateMaskNumber(num); 58 | } 59 | 60 | -------------------------------------------------------------------------------- /lef/clefzlib/Makefile: -------------------------------------------------------------------------------- 1 | LEF_TABNAME = clefzlib 2 | 3 | FAKE_ALL: all 4 | 5 | DIRNAME = clefzlib 6 | 7 | LIBTARGET = libclefzlib.a 8 | 9 | PUBLIC_HDRS = lefzlib.h 10 | 11 | LIBSRCS = clefzlib.c 12 | 13 | include ../template.mk 14 | -------------------------------------------------------------------------------- /lef/clefzlib/clefzlib.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | ******************************************************************************* 3 | * Copyright 2014, Cadence Design Systems 4 | * 5 | * This file is part of the Cadence LEF/DEF Open Source 6 | * Distribution, Product Version 5.8. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | * implied. See the License for the specific language governing 18 | * permissions and limitations under the License. 19 | * 20 | * For updates, support, or to become part of the LEF/DEF Community, 21 | * check www.openeda.org for details. 22 | ******************************************************************************* 23 | ******************************************************************************/ 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include "zlib.h" 32 | #include "lefzlib.h" 33 | #include "lefrReader.h" 34 | 35 | /* 36 | * Private functions: 37 | */ 38 | size_t lefGZip_read(FILE* file, char* buf, size_t len) { 39 | return gzread((gzFile)file, buf, (unsigned int)len); 40 | } 41 | 42 | /* 43 | * Public functions: 44 | */ 45 | lefGZFile 46 | lefGZipOpen(const char *gzipPath, const char* mode) { 47 | lefGZFile fptr; 48 | 49 | if (!gzipPath) 50 | return NULL; 51 | 52 | fptr = gzopen(gzipPath, mode); 53 | 54 | if (fptr) { 55 | /* successfully open the gzip file */ 56 | /* set the read function to read from a compressed file */ 57 | lefrSetReadFunction(lefGZip_read); 58 | return (lefGZFile)fptr; 59 | } else 60 | return NULL; 61 | } 62 | 63 | int lefGZipClose(lefGZFile filePtr) { 64 | return (gzclose((gzFile)filePtr)); 65 | } 66 | 67 | int lefrReadGZip(lefGZFile file, const char* gzipFile, lefiUserData uData) { 68 | return lefrRead((FILE*)file, gzipFile, uData); 69 | } 70 | -------------------------------------------------------------------------------- /lef/clefzlib/clefzlib_vc14.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {aeafd166-99c9-4db0-980e-075fa5f41e06} 6 | 7 | 8 | {a6f2e3ed-ea59-4cda-afe8-7504fa2a0ba3} 9 | 10 | 11 | 12 | 13 | Source Files 14 | 15 | 16 | Public Header Files 17 | 18 | 19 | -------------------------------------------------------------------------------- /lef/clefzlib/lefzlib.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | ******************************************************************************* 3 | * Copyright 2012, Cadence Design Systems 4 | * 5 | * This file is part of the Cadence LEF/DEF Open Source 6 | * Distribution, Product Version 5.8. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | * implied. See the License for the specific language governing 18 | * permissions and limitations under the License. 19 | * 20 | * For updates, support, or to become part of the LEF/DEF Community, 21 | * check www.openeda.org for details. 22 | ******************************************************************************* 23 | ******************************************************************************/ 24 | 25 | #ifndef CLEFZLIB_H 26 | #define CLEFZLIB_H 27 | 28 | typedef void* lefGZFile; 29 | 30 | /* 31 | * Name: lefGZipOpen 32 | * Description: Open a gzip file 33 | * Returns: A file pointer 34 | */ 35 | extern lefGZFile lefGZipOpen(const char* gzipFile, const char* mode); 36 | 37 | /* 38 | * Name: lefGZipClose 39 | * Description: Close a gzip file 40 | * Returns: 0 if no errors 41 | */ 42 | extern int lefGZipClose(lefGZFile filePtr); 43 | 44 | /* 45 | * Name: lefrReadGZip 46 | * Description: Parse a lef gzip file 47 | * Returns: 0 if no errors 48 | */ 49 | extern int lefrReadGZip(lefGZFile file, const char* gzipFile, void* uData); 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /lef/doc/lefapi.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncvlsi/lefdef/2577884c1219368e9cdb642f341ec0dcd95ed99b/lef/doc/lefapi.pdf -------------------------------------------------------------------------------- /lef/doc/lefapiWN.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncvlsi/lefdef/2577884c1219368e9cdb642f341ec0dcd95ed99b/lef/doc/lefapiWN.pdf -------------------------------------------------------------------------------- /lef/lef/.gitignore: -------------------------------------------------------------------------------- 1 | lef.output 2 | lef.tab.* 3 | -------------------------------------------------------------------------------- /lef/lef/Makefile: -------------------------------------------------------------------------------- 1 | LEF_TABNAME = lef 2 | LEF_BISON_SRCS = lef.y 3 | 4 | FAKE_ALL: all 5 | 6 | DIRNAME = lef 7 | LEF_BISON_SRCS = lef.y 8 | 9 | LIBTARGET = liblef.a 10 | 11 | HEADERS = \ 12 | lef.tab.h \ 13 | lex.h \ 14 | crypt.hpp \ 15 | lex.cpph 16 | 17 | PUBLIC_HDRS = lefiArray.hpp \ 18 | lefiCrossTalk.hpp \ 19 | lefiDebug.hpp \ 20 | lefiDefs.hpp \ 21 | lefiEncryptInt.hpp \ 22 | lefiKRDefs.hpp \ 23 | lefiLayer.hpp \ 24 | lefiMacro.hpp \ 25 | lefiMisc.hpp \ 26 | lefiNonDefault.hpp \ 27 | lefiProp.hpp \ 28 | lefiPropType.hpp \ 29 | lefiUnits.hpp \ 30 | lefiUser.hpp \ 31 | lefiUtil.hpp \ 32 | lefiVia.hpp \ 33 | lefiViaRule.hpp \ 34 | lefrCallBacks.hpp \ 35 | lefrData.hpp \ 36 | lefrReader.hpp \ 37 | lefrSettings.hpp \ 38 | lefwWriter.hpp \ 39 | lefwWriterCalls.hpp 40 | 41 | LIBSRCS = \ 42 | crypt.cpp \ 43 | lef.tab.cpp \ 44 | lef_keywords.cpp \ 45 | lefiArray.cpp \ 46 | lefiCrossTalk.cpp \ 47 | lefiDebug.cpp \ 48 | lefiEncryptInt.cpp \ 49 | lefiLayer.cpp \ 50 | lefiMacro.cpp \ 51 | lefiMisc.cpp \ 52 | lefiNonDefault.cpp \ 53 | lefiProp.cpp \ 54 | lefiPropType.cpp \ 55 | lefiTBExt.cpp \ 56 | lefiUnits.cpp \ 57 | lefiVia.cpp \ 58 | lefiViaRule.cpp \ 59 | lefrCallbacks.cpp \ 60 | lefrData.cpp \ 61 | lefrReader.cpp \ 62 | lefrSettings.cpp \ 63 | lefwWriter.cpp \ 64 | lefwWriterCalls.cpp 65 | 66 | # For lef, create '.cpp' object 67 | lef.tab.cpp : $(LEF_BISON_SRCS) 68 | bison -v -p$(LEF_TABNAME)yy -d $(LEF_BISON_SRCS) 69 | mv $(LEF_TABNAME).tab.c $(LEF_TABNAME).tab.cpp ; 70 | 71 | include ../template.mk 72 | -------------------------------------------------------------------------------- /lef/lef/crypt.cpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2012 - 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: dell $ 24 | // $Revision: #6 $ 25 | // $Date: 2015/01/20 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | /* 31 | * FILE: crypt.cpp 32 | * 33 | */ 34 | 35 | #include 36 | #include 37 | 38 | #include "lefiKRDefs.hpp" 39 | 40 | BEGIN_LEFDEF_PARSER_NAMESPACE 41 | 42 | #ifdef WIN32 43 | # include 44 | #else // not WIN32 45 | # include 46 | 47 | #endif // WIN32 48 | 49 | 50 | FILE * 51 | encOpenFileForRead(char *filename) 52 | { 53 | return fopen(filename, "r"); 54 | } 55 | 56 | FILE * 57 | encOpenFileForWrite(char *filename, 58 | int encrypt_f) 59 | { 60 | return fopen(filename, "w"); 61 | } 62 | 63 | int 64 | encCloseFile(FILE *fp) 65 | { 66 | return fclose(fp); 67 | } 68 | 69 | void 70 | encClearBuf(FILE *fp) 71 | { 72 | } 73 | 74 | void 75 | encReadingEncrypted() 76 | { 77 | } 78 | 79 | void 80 | encWritingEncrypted() 81 | { 82 | } 83 | 84 | int 85 | encIsEncrypted(unsigned char *buf) 86 | { 87 | return false; 88 | } 89 | 90 | int 91 | encFgetc(FILE *fp) 92 | { 93 | return fgetc(fp); 94 | } 95 | 96 | int 97 | encFputc(char c, 98 | FILE *fp) 99 | { 100 | return fputc(c, fp); 101 | } 102 | 103 | void 104 | encPrint(FILE *fp, 105 | char *format, 106 | ...) 107 | { 108 | va_list ap; 109 | 110 | va_start(ap, format); 111 | vfprintf(fp, format, ap); 112 | va_end(ap); 113 | } 114 | 115 | END_LEFDEF_PARSER_NAMESPACE 116 | 117 | -------------------------------------------------------------------------------- /lef/lef/crypt.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2012 - 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: dell $ 24 | // $Revision: #7 $ 25 | // $Date: 2015/01/27 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef CRYPT_H 31 | #define CRYPT_H 1 32 | 33 | #include "lefiKRDefs.hpp" 34 | 35 | BEGIN_LEFDEF_PARSER_NAMESPACE 36 | 37 | extern FILE* encOpenFileForRead(char* filename); 38 | extern FILE* encOpenFileForWrite(char* filename, int encrypt_f); 39 | extern int encCloseFile(FILE* fp); 40 | extern void encClearBuf(FILE* fp); 41 | extern void encReadingEncrypted(); 42 | extern void encWritingEncrypted(); 43 | extern int encIsEncrypted(unsigned char* buf); 44 | extern int encFgetc(FILE* fp); 45 | extern int encFputc(char c, FILE* fp); 46 | extern void encPrint(FILE*fp, char* format,...); 47 | 48 | END_LEFDEF_PARSER_NAMESPACE 49 | 50 | USE_LEFDEF_PARSER_NAMESPACE 51 | 52 | #endif 53 | 54 | -------------------------------------------------------------------------------- /lef/lef/lefiDebug.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2012 - 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: dell $ 24 | // $Revision: #7 $ 25 | // $Date: 2015/01/27 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef lefiDebug_h 31 | #define lefiDebug_h 1 32 | 33 | #include "lefiKRDefs.hpp" 34 | 35 | BEGIN_LEFDEF_PARSER_NAMESPACE 36 | 37 | // Set flag 38 | extern void lefiSetDebug (int num, int value) ; 39 | 40 | // Read flag 41 | extern int lefiDebug (int num) ; 42 | 43 | // Error reporting routine 44 | extern void lefiError (int check, int msgNum, const char* msg); 45 | 46 | extern const char* CASE(const char *x); 47 | 48 | END_LEFDEF_PARSER_NAMESPACE 49 | 50 | USE_LEFDEF_PARSER_NAMESPACE 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /lef/lef/lefiEncryptInt.cpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2012 - 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: dell $ 24 | // $Revision: #7 $ 25 | // $Date: 2015/01/27 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #include 31 | 32 | #include "lefiEncryptInt.hpp" 33 | 34 | #include "lefrSettings.hpp" 35 | 36 | BEGIN_LEFDEF_PARSER_NAMESPACE 37 | 38 | // ***************************************************************************** 39 | // Global variables 40 | // ***************************************************************************** 41 | 42 | void 43 | lefrEnableReadEncrypted() 44 | { 45 | lefSettings->ReadEncrypted = 1; 46 | } 47 | 48 | END_LEFDEF_PARSER_NAMESPACE 49 | -------------------------------------------------------------------------------- /lef/lef/lefiEncryptInt.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2012 - 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: dell $ 24 | // $Revision: #7 $ 25 | // $Date: 2015/01/27 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef DEFI_ENCRYPTINT_H 31 | #define DEFI_ENCRYPTINT_H 32 | 33 | #include 34 | #include "lefiKRDefs.hpp" 35 | 36 | BEGIN_LEFDEF_PARSER_NAMESPACE 37 | 38 | // Unable the reader to read encrypted lef file. 39 | // This function must be called before lefrRead(). 40 | // / 41 | extern void lefrEnableReadEncrypted(); 42 | 43 | END_LEFDEF_PARSER_NAMESPACE 44 | 45 | USE_LEFDEF_PARSER_NAMESPACE 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /lef/lef/lefiKRDefs.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2012 - 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: dell $ 24 | // $Revision: #7 $ 25 | // $Date: 2015/01/27 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef lefiKRDEFS_h 31 | #define lefiKRDEFS_h 32 | 33 | #define BEGIN_LEFDEF_PARSER_NAMESPACE namespace LefDefParser { 34 | #define END_LEFDEF_PARSER_NAMESPACE } 35 | #define USE_LEFDEF_PARSER_NAMESPACE using namespace LefDefParser; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /lef/lef/lefiProp.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2012 - 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: dell $ 24 | // $Revision: #7 $ 25 | // $Date: 2015/01/27 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef lefiProp_h 31 | #define lefiProp_h 32 | 33 | #include "lefiKRDefs.hpp" 34 | #include 35 | 36 | BEGIN_LEFDEF_PARSER_NAMESPACE 37 | 38 | // Struct holds the data for one property. 39 | class lefiProp { 40 | public: 41 | lefiProp(); 42 | void Init(); 43 | 44 | void Destroy(); 45 | ~lefiProp(); 46 | 47 | void setPropType(const char* typ, const char* string); 48 | void setRange(double left, double right); 49 | void setNumber(double num); 50 | void setPropInteger(); 51 | void setPropReal(); 52 | void setPropString(); 53 | void setPropQString(const char* string); 54 | void setPropNameMapString(const char* string); 55 | void clear(); 56 | 57 | const char* string() const; 58 | const char* propType() const; 59 | const char* propName() const; 60 | char dataType() const; 61 | // either I:integer R:real S:string Q:quotedstring 62 | // N:property name is not defined in the property definition section 63 | int hasNumber() const; 64 | int hasRange() const; 65 | int hasString() const; 66 | int hasNameMapString() const; 67 | double number() const; 68 | double left() const; 69 | double right() const; 70 | 71 | void bumpSize(int size); 72 | void bumpName(int size); 73 | 74 | void print(FILE* f) const; 75 | 76 | protected: 77 | char* propType_; // "design" "net" "macro" ... 78 | char* propName_; // name. 79 | int nameSize_; // allocated size of name. 80 | char hasRange_; // either 0:NO or 1:YES. 81 | char hasNumber_; // either 0:NO or 1:YES. 82 | char hasNameMapString_; 83 | char dataType_; // either I:integer R:real S:string Q:quotedstring. 84 | // N:property name is not defined. 85 | char* stringData_; // if it is a string the data is here. 86 | int stringLength_; // allocated size of stringData. 87 | double left_; 88 | double right_; // if it has a range the numbers are here. 89 | double d_; // if it is a real or int the number is here. 90 | }; 91 | 92 | END_LEFDEF_PARSER_NAMESPACE 93 | 94 | USE_LEFDEF_PARSER_NAMESPACE 95 | 96 | #endif 97 | -------------------------------------------------------------------------------- /lef/lef/lefiPropType.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2012 - 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: dell $ 24 | // $Revision: #7 $ 25 | // $Date: 2015/01/27 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef lefiPropType_h 31 | #define lefiPropType_h 32 | 33 | #include "lefiKRDefs.hpp" 34 | #include 35 | 36 | BEGIN_LEFDEF_PARSER_NAMESPACE 37 | 38 | // Struct holds the data type for one property, if the property is 39 | // either REAL or INTEGER. 40 | class lefiPropType { 41 | public: 42 | lefiPropType(); 43 | void Init(); 44 | 45 | void Destroy(); 46 | ~lefiPropType(); 47 | 48 | void setPropType(const char* name, const char type); 49 | void Clear(); 50 | 51 | const char propType(char* name) const; 52 | void bumpProps(); 53 | 54 | protected: 55 | int numProperties_; 56 | int propertiesAllocated_; 57 | char** propNames_; // name. 58 | char* propTypes_; // 'R' == "REAL", 'I' == "INTEGER" 59 | }; 60 | 61 | END_LEFDEF_PARSER_NAMESPACE 62 | 63 | USE_LEFDEF_PARSER_NAMESPACE 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /lef/lef/lefiUnits.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2012 - 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: dell $ 24 | // $Revision: #7 $ 25 | // $Date: 2015/01/27 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef lefiUnits_h 31 | #define lefiUnits_h 32 | 33 | #include 34 | #include "lefiKRDefs.hpp" 35 | 36 | BEGIN_LEFDEF_PARSER_NAMESPACE 37 | 38 | class lefiUnits { 39 | public: 40 | lefiUnits(); 41 | void Init(); 42 | 43 | void Destroy(); 44 | ~lefiUnits(); 45 | 46 | void setDatabase(const char* name, double num); 47 | void clear(); 48 | void setTime(double num); 49 | void setCapacitance(double num); 50 | void setResistance(double num); 51 | void setPower(double num); 52 | void setCurrent(double num); 53 | void setVoltage(double num); 54 | void setFrequency(double num); 55 | 56 | int hasDatabase() const; 57 | int hasCapacitance()const; 58 | int hasResistance() const; 59 | int hasTime() const; 60 | int hasPower() const; 61 | int hasCurrent() const; 62 | int hasVoltage() const; 63 | int hasFrequency() const; 64 | 65 | const char* databaseName() const; 66 | double databaseNumber() const; 67 | double capacitance() const; 68 | double resistance() const; 69 | double time() const; 70 | double power() const; 71 | double current() const; 72 | double voltage() const; 73 | double frequency() const; 74 | 75 | // Debug print 76 | void print(FILE* f) const ; 77 | 78 | protected: 79 | int hasDatabase_; 80 | int hasCapacitance_; 81 | int hasResistance_; 82 | int hasTime_; 83 | int hasPower_; 84 | int hasCurrent_; 85 | int hasVoltage_; 86 | int hasFrequency_; 87 | char* databaseName_; 88 | double databaseNumber_; 89 | double capacitance_; 90 | double resistance_; 91 | double power_; 92 | double time_; 93 | double current_; 94 | double voltage_; 95 | double frequency_; 96 | }; 97 | 98 | END_LEFDEF_PARSER_NAMESPACE 99 | 100 | USE_LEFDEF_PARSER_NAMESPACE 101 | 102 | #endif 103 | -------------------------------------------------------------------------------- /lef/lef/lefiUser.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2012 - 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: dell $ 24 | // $Revision: #7 $ 25 | // $Date: 2015/01/27 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | // User header file for the LEF Interface. This includes 31 | // all of the header files which are relevant to both the 32 | // reader and the writer. 33 | // 34 | // lefrReader.h and lefwWriter.h include this file, so that 35 | // an application only needs to include either lefrReader.h(pp) 36 | // or lefwWriter.h(pp). 37 | // 38 | 39 | #ifndef LEFI_USER_H 40 | #define LEFI_USER_H 41 | 42 | #include "lefiDebug.hpp" 43 | #include "lefiUnits.hpp" 44 | #include "lefiLayer.hpp" 45 | #include "lefiVia.hpp" 46 | #include "lefiViaRule.hpp" 47 | #include "lefiMisc.hpp" 48 | #include "lefiNonDefault.hpp" 49 | #include "lefiMacro.hpp" 50 | #include "lefiArray.hpp" 51 | #include "lefiCrossTalk.hpp" 52 | #include "lefiProp.hpp" 53 | #include "lefiPropType.hpp" 54 | 55 | BEGIN_LEFDEF_PARSER_NAMESPACE 56 | 57 | // NEW CALLBACK add the reference here 58 | 59 | END_LEFDEF_PARSER_NAMESPACE 60 | 61 | USE_LEFDEF_PARSER_NAMESPACE 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /lef/lef/lefiUtil.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2012 - 2013, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: dell $ 24 | // $Revision: #7 $ 25 | // $Date: 2015/01/27 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef lefiUtil_h 31 | #define lefiUtil_h 32 | 33 | #include "lefiKRDefs.hpp" 34 | 35 | BEGIN_LEFDEF_PARSER_NAMESPACE 36 | 37 | // Structure to return Macro data to FE 38 | struct lefiPoints { 39 | double x; 40 | double y; 41 | }; 42 | 43 | typedef struct lefiPoints lefiNum; 44 | 45 | //int lefiValidTime(); 46 | extern int lefiValidUser(); 47 | 48 | extern char* lefiUser(); 49 | 50 | extern char* lefiOrientStr(int orient); 51 | 52 | extern double convert_name2num(const char *versionName); 53 | 54 | extern bool validateMaskNumber(int num); 55 | 56 | END_LEFDEF_PARSER_NAMESPACE 57 | 58 | USE_LEFDEF_PARSER_NAMESPACE 59 | 60 | #endif 61 | 62 | -------------------------------------------------------------------------------- /lef/lef/lefrCallbacks.cpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2012 - 2017, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: arakhman $ 24 | // $Revision: #11 $ 25 | // $Date: 2013/04/23 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #include "lefrCallBacks.hpp" 31 | #include "string.h" 32 | 33 | BEGIN_LEFDEF_PARSER_NAMESPACE 34 | 35 | lefrCallbacks::lefrCallbacks() 36 | : AntennaInoutCbk(0), 37 | AntennaInputCbk(0), 38 | AntennaOutputCbk(0), 39 | ArrayBeginCbk(0), 40 | ArrayCbk(0), 41 | ArrayEndCbk(0), 42 | BusBitCharsCbk(0), 43 | CaseSensitiveCbk(0), 44 | ClearanceMeasureCbk(0), 45 | CorrectionTableCbk(0), 46 | DensityCbk(0), 47 | DielectricCbk(0), 48 | DividerCharCbk(0), 49 | EdgeRateScaleFactorCbk(0), 50 | EdgeRateThreshold1Cbk(0), 51 | EdgeRateThreshold2Cbk(0), 52 | ExtensionCbk(0), 53 | FixedMaskCbk(0), 54 | IRDropBeginCbk(0), 55 | IRDropCbk(0), 56 | IRDropEndCbk(0), 57 | InoutAntennaCbk(0), 58 | InputAntennaCbk(0), 59 | LayerCbk(0), 60 | LibraryEndCbk(0), 61 | MacroBeginCbk(0), 62 | MacroCbk(0), 63 | MacroClassTypeCbk(0), 64 | MacroEndCbk(0), 65 | MacroFixedMaskCbk(0), 66 | MacroOriginCbk(0), 67 | MacroSiteCbk(0), 68 | MacroForeignCbk(0), 69 | MacroSizeCbk(0), 70 | ManufacturingCbk(0), 71 | MaxStackViaCbk(0), 72 | MinFeatureCbk(0), 73 | NoWireExtensionCbk(0), 74 | NoiseMarginCbk(0), 75 | NoiseTableCbk(0), 76 | NonDefaultCbk(0), 77 | ObstructionCbk(0), 78 | OutputAntennaCbk(0), 79 | PinCbk(0), 80 | PropBeginCbk(0), 81 | PropCbk(0), 82 | PropEndCbk(0), 83 | SiteCbk(0), 84 | SpacingBeginCbk(0), 85 | SpacingCbk(0), 86 | SpacingEndCbk(0), 87 | TimingCbk(0), 88 | UnitsCbk(0), 89 | UseMinSpacingCbk(0), 90 | VersionCbk(0), 91 | VersionStrCbk(0), 92 | ViaCbk(0), 93 | ViaRuleCbk(0) 94 | { 95 | } 96 | 97 | lefrCallbacks *lefCallbacks = NULL; 98 | 99 | void 100 | lefrCallbacks::reset() 101 | { 102 | if (lefCallbacks) { 103 | delete lefCallbacks; 104 | } 105 | 106 | lefCallbacks = new lefrCallbacks(); 107 | } 108 | 109 | END_LEFDEF_PARSER_NAMESPACE 110 | -------------------------------------------------------------------------------- /lef/lef/lex.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | ******************************************************************************* 3 | * Copyright 2012 - 2014, Cadence Design Systems 4 | * 5 | * This file is part of the Cadence LEF/DEF Open Source 6 | * Distribution, Product Version 5.8. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | * implied. See the License for the specific language governing 18 | * permissions and limitations under the License. 19 | * 20 | * For updates, support, or to become part of the LEF/DEF Community, 21 | * check www.openeda.org for details. 22 | ******************************************************************************* 23 | * 24 | * $Author: dell $ 25 | * $Revision: #8 $ 26 | * $Date: 2015/01/27 $ 27 | * $State: $ 28 | ******************************************************************************/ 29 | 30 | #ifndef leh_h 31 | #define leh_h 32 | 33 | #include "lefiKRDefs.hpp" 34 | 35 | BEGIN_LEFDEF_PARSER_NAMESPACE 36 | 37 | void lefAddStringDefine(const char *token, 38 | const char *string); 39 | 40 | void lefAddBooleanDefine(const char *token, 41 | int val); 42 | 43 | void lefAddNumDefine(const char *token, 44 | double val); 45 | 46 | void yyerror(const char *s); 47 | void lefError(int msgNum, 48 | const char *s); 49 | void lefWarning(int msgNum, 50 | const char *s); 51 | void lefInfo(int msgNum, 52 | const char *s); 53 | void *lefMalloc(size_t lef_size); 54 | void *lefRealloc(void *name, 55 | size_t lef_size); 56 | void lefFree(void *name); 57 | void lefSetNonDefault(const char *name); 58 | void lefUnsetNonDefault(); 59 | 60 | extern int yylex(); 61 | extern void lex_init(); 62 | extern int lefyyparse(); 63 | extern void lex_un_init(); 64 | 65 | int fake_ftell(); 66 | 67 | END_LEFDEF_PARSER_NAMESPACE 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /lef/lefdiff/.gitignore: -------------------------------------------------------------------------------- 1 | lefdiff 2 | -------------------------------------------------------------------------------- /lef/lefdiff/Makefile: -------------------------------------------------------------------------------- 1 | FAKE_ALL: all 2 | 3 | BINTARGET = lefdiff 4 | 5 | HEADERS = \ 6 | diffLefRW.hpp 7 | 8 | PUBLIC_HDRS = 9 | 10 | LDLIBS = ../lib/liblef.a 11 | 12 | BINSRCS = \ 13 | diffLefRW.cpp \ 14 | differLef.cpp 15 | 16 | include ../template.mk 17 | -------------------------------------------------------------------------------- /lef/lefdiff/diffLefRW.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2012, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author$ 24 | // $Revision$ 25 | // $Date$ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef DIFFDEFRW_H 31 | #define DIFFDEFRW_H 32 | 33 | #include 34 | #include 35 | 36 | int diffLefReadFile(char* inFile, char* outFile); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /lef/lefdiff/differLef.cpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2012 - 2016, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author$ 24 | // $Revision$ 25 | // $Date$ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | // This program will diff two lef files or two def files and list the 31 | // different between the two files. This problem is not intend to 32 | // diff a real design. If user runs this program will a big design, 33 | // they may experience long execution time and may even ran out of 34 | // memory. 35 | // 36 | // This program is to give user a feel of whether they are using the 37 | // parser correctly. After they read the lef/def file in, and 38 | // write them back out in lef/def format. 39 | // 40 | // This program support lef/def 5.6. 41 | 42 | #include 43 | #include 44 | #include 45 | #ifdef ibmrs 46 | # include 47 | #endif 48 | #ifndef WIN32 49 | # include 50 | extern char VersionIdent[]; 51 | #else 52 | char* VersionIdent = "N/A"; 53 | #endif /* not WIN32 */ 54 | #include "lefrReader.hpp" 55 | #include "diffLefRW.hpp" 56 | 57 | char * exeName; // use to save the executable name 58 | 59 | // This program requires 2 inputs, fileName1 and fileName2 60 | void diffUsage() { 61 | printf("Usage: lefdefdiff -lef|-def fileName1 fileName2 [-o outputFileName]\n"); 62 | } 63 | 64 | int main(int argc, char** argv) { 65 | char *fileName1, *fileName2; // For the filenames to compare 66 | char *lefOut1, *lefOut2; // For the tmp output files 67 | 68 | #if (defined WIN32 && _MSC_VER < 1800) 69 | // Enable two-digit exponent format 70 | _set_output_format(_TWO_DIGIT_EXPONENT); 71 | #endif 72 | 73 | exeName = argv[0]; 74 | 75 | if (argc != 5) { // If pass in from lefdefdiff, argc is 76 | diffUsage(); // always 5 77 | return(1); 78 | } 79 | 80 | fileName1 = argv[1]; 81 | fileName2 = argv[2]; 82 | 83 | // These are temporary files to hold the lef data as they are read in, 84 | // later these files will be sorted for comparison. 85 | lefOut1 = argv[3]; 86 | lefOut2 = argv[4]; 87 | 88 | // just read in the 1st file to memory 89 | printf("Reading file: %s\n", fileName1); 90 | if (diffLefReadFile(fileName1, lefOut1) != 0) 91 | return(1); 92 | // read and compare with the 1st file in memory 93 | printf("Reading file: %s\n", fileName2); 94 | if (diffLefReadFile(fileName2, lefOut2) != 0) 95 | return(1); 96 | 97 | return (0); 98 | } 99 | -------------------------------------------------------------------------------- /lef/lefdiff/lefdiff_vc14.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {7db7d450-9f3b-44b0-8580-363ef0601fb9} 6 | 7 | 8 | {a6f2e3ed-ea59-4cda-afe8-7504fa2a0ba3} 9 | 10 | 11 | 12 | 13 | Source Files 14 | 15 | 16 | Source Files 17 | 18 | 19 | Private Header Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /lef/lefrw/.gitignore: -------------------------------------------------------------------------------- 1 | lefrw 2 | -------------------------------------------------------------------------------- /lef/lefrw/Makefile: -------------------------------------------------------------------------------- 1 | FAKE_ALL: all 2 | 3 | LIBTARGET = 4 | BINTARGET = lefrw 5 | 6 | LDLIBS = ../lib/liblef.a 7 | 8 | BINSRCS = lefrw.cpp 9 | 10 | include ../template.mk 11 | -------------------------------------------------------------------------------- /lef/lefrw/lefrw_vc14.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {a6f2e3ed-ea59-4cda-afe8-7504fa2a0ba3} 6 | 7 | 8 | 9 | 10 | Source Files 11 | 12 | 13 | -------------------------------------------------------------------------------- /lef/lefwrite/.gitignore: -------------------------------------------------------------------------------- 1 | lefwrite 2 | -------------------------------------------------------------------------------- /lef/lefwrite/Makefile: -------------------------------------------------------------------------------- 1 | # This make file is for lefwrite.cpp only. lefwrite.cpp is an example 2 | # which calls directly to the defwWrite calls. It does not use the callback 3 | # mechanism. The user is responsible for the correct sequence of the output. 4 | # 5 | # There is another example (lefwriteCbs.cpp) in this directory. This example 6 | # uses the callback mechanism. The user does not have to worry about the 7 | # correct sequence of the lef output file. 8 | # To compile lefwriteCbs.cpp, you need to create another Makefile which 9 | # is identical to this one, but change the line: 10 | # BINSRCS = lefwriteCbs.o 11 | 12 | FAKE_ALL: all 13 | 14 | LIBTARGET = 15 | BINTARGET = lefwrite 16 | 17 | LDLIBS = ../lib/liblef.a 18 | 19 | BINSRCS = lefwrite.cpp 20 | 21 | include ../template.mk 22 | -------------------------------------------------------------------------------- /lef/lefwrite/lefwrite_vc14.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {a6f2e3ed-ea59-4cda-afe8-7504fa2a0ba3} 6 | 7 | 8 | 9 | 10 | Source Files 11 | 12 | 13 | -------------------------------------------------------------------------------- /lef/lefzlib/Makefile: -------------------------------------------------------------------------------- 1 | LEF_TABNAME = lefzlib 2 | 3 | FAKE_ALL: all 4 | 5 | DIRNAME = lefzlib 6 | 7 | LIBTARGET = liblefzlib.a 8 | 9 | PUBLIC_HDRS = lefzlib.hpp 10 | 11 | LIBSRCS = lefzlib.cpp 12 | 13 | include ../template.mk 14 | -------------------------------------------------------------------------------- /lef/lefzlib/lefzlib.cpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2012, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: dell $ 24 | // $Revision: #7 $ 25 | // $Date: 2015/01/27 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include "zlib.h" 37 | #include "lefzlib.hpp" 38 | #include "lefrReader.hpp" 39 | 40 | /* 41 | * Private functions: 42 | */ 43 | size_t lefGZip_read(FILE* file, char* buf, size_t len) { 44 | return (gzread((gzFile)file, buf, len)); 45 | } 46 | 47 | /* 48 | * Public functions: 49 | */ 50 | lefGZFile 51 | lefGZipOpen(const char *gzipPath, const char* mode) { 52 | 53 | if (!gzipPath) 54 | return NULL; 55 | 56 | lefGZFile fptr = gzopen(gzipPath, mode); 57 | if (fptr) { 58 | /* successfully open the gzip file */ 59 | /* set the read function to read from a compressed file */ 60 | lefrSetReadFunction(lefGZip_read); 61 | return (lefGZFile)fptr; 62 | } else 63 | return NULL; 64 | } 65 | 66 | int lefGZipClose(lefGZFile filePtr) { 67 | lefrUnsetReadFunction(); 68 | return (gzclose((gzFile)filePtr)); 69 | } 70 | 71 | int lefrReadGZip(lefGZFile file, const char* gzipFile, lefiUserData uData) { 72 | return lefrRead((FILE*)file, gzipFile, uData); 73 | } 74 | -------------------------------------------------------------------------------- /lef/lefzlib/lefzlib.hpp: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // ***************************************************************************** 3 | // Copyright 2012, Cadence Design Systems 4 | // 5 | // This file is part of the Cadence LEF/DEF Open Source 6 | // Distribution, Product Version 5.8. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 17 | // implied. See the License for the specific language governing 18 | // permissions and limitations under the License. 19 | // 20 | // For updates, support, or to become part of the LEF/DEF Community, 21 | // check www.openeda.org for details. 22 | // 23 | // $Author: dell $ 24 | // $Revision: #7 $ 25 | // $Date: 2015/01/27 $ 26 | // $State: $ 27 | // ***************************************************************************** 28 | // ***************************************************************************** 29 | 30 | #ifndef LEFZLIB_H 31 | 32 | typedef void* lefGZFile; 33 | 34 | /* 35 | * Name: lefGZipOpen 36 | * Description: Open a gzip file 37 | * Returns: A file pointer 38 | */ 39 | extern lefGZFile lefGZipOpen(const char* gzipFile, const char* mode); 40 | 41 | /* 42 | * Name: lefGZipClose 43 | * Description: Close a gzip file 44 | * Returns: 0 if no errors 45 | */ 46 | extern int lefGZipClose(lefGZFile filePtr); 47 | 48 | /* 49 | * Name: lefrReadGZip 50 | * Description: Parse a lef gzip file 51 | * Returns: 0 if no errors 52 | */ 53 | extern int lefrReadGZip(lefGZFile file, const char* gzipFile, void* uData); 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /lef/lefzlib/lefzlib_vc14.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {aeafd166-99c9-4db0-980e-075fa5f41e06} 6 | 7 | 8 | {a6f2e3ed-ea59-4cda-afe8-7504fa2a0ba3} 9 | 10 | 11 | 12 | 13 | Source Files 14 | 15 | 16 | Public Header Files 17 | 18 | 19 | -------------------------------------------------------------------------------- /lef/template.mk: -------------------------------------------------------------------------------- 1 | SHELL=/bin/sh 2 | 3 | OS_TYPE := $(shell uname -s) 4 | ifeq ($(OS_TYPE),AIX) 5 | ARCH=ibmrs 6 | CXX=/usr/bin/xlC_r -+ -Dibmrs 7 | CC=/usr/bin/cc_r -Dibmrs 8 | endif 9 | ifeq ($(OS_TYPE),HP-UX) 10 | ARCH=hppa 11 | CXX=/opt/aCC/bin/aCC 12 | CXXFLAGS=+DAportable -AA 13 | BIN_LINK_FLAGS=-lPW 14 | endif 15 | 16 | ifeq ($(OS_TYPE),SunOS) 17 | ARCH=sun4v 18 | CXX=CC 19 | CXXFLAGS=-g 20 | endif 21 | 22 | ifeq ($(OS_TYPE),Linux) 23 | ARCH=lnx86 24 | CXX=g++ 25 | CC=gcc 26 | endif 27 | 28 | .SUFFIXES: $(SUFFIXES) .cpp 29 | 30 | 31 | TMP1 = $(LIBSRCS:.cpp=.o) 32 | TMP2 = $(TMP1:.cc=.o) 33 | LIBOBJS = $(TMP2:.c=.o) 34 | 35 | TMP3 = $(BINSRCS:.cpp=.o) 36 | TMP4 = $(TMP3:.cc=.o) 37 | BINOBJS = $(TMP4:.c=.o) 38 | 39 | all: $(LIBTARGET) $(BINTARGET) 40 | 41 | ifdef BINTARGET 42 | INSTALLED_BIN = ../bin/$(BINTARGET) 43 | endif 44 | 45 | 46 | $(INSTALLED_BIN): $(BINTARGET) 47 | @mkdir -p ../bin 48 | @echo $< =\> $@ 49 | @rm -f $(INSTALLED_BIN) 50 | @cp $(BINTARGET) $(INSTALLED_BIN) 51 | 52 | installbin: $(INSTALLED_BIN) 53 | 54 | ifdef LIBTARGET 55 | INSTALLED_LIB = ../lib/$(LIBTARGET) 56 | endif 57 | 58 | 59 | $(INSTALLED_LIB): $(LIBTARGET) 60 | @mkdir -p ../lib 61 | @echo $< =\> $@ 62 | @rm -f $(INSTALLED_LIB) 63 | @cp $(LIBTARGET) $(INSTALLED_LIB) 64 | 65 | installlib: $(INSTALLED_LIB) 66 | 67 | install release: all installhdrs installlib installbin 68 | 69 | INSTALLED_HDRS = $(PUBLIC_HDRS:%=../include/%) 70 | $(INSTALLED_HDRS): ../include/%: % 71 | @mkdir -p ../include 72 | @echo $< =\> $@ 73 | @rm -f $@ 74 | @cp -p $< $@ 75 | 76 | installhdrs: $(INSTALLED_HDRS) 77 | 78 | .cpp.o: 79 | $(COMPILE.cc) -I../include $< 80 | 81 | .c.o: 82 | $(COMPILE.c) -I../include $< 83 | 84 | $(LIBTARGET): $(LIBOBJS) 85 | rm -f $(LIBTARGET) 86 | $(AR) $(ARFLAGS) $(LIBTARGET) $^ 87 | 88 | $(BINTARGET): $(BINOBJS) $(LIBTARGET) $(LDLIBS) 89 | rm -f $(BINTARGET) 90 | $(LINK.cc) -o $(BINTARGET) $(BINOBJS) $(LIBTARGET) $(LDLIBS) $(BIN_LINK_FLAGS) 91 | 92 | clean doclean: 93 | rm -f $(LIBTARGET) $(LIBOBJS) $(BINTARGET) $(BINOBJS) $(INSTALLED_LIB) \ 94 | $(INSTALLED_BIN) $(INSTALLED_HDRS) lef.tab.c* lef.tab.h 95 | -------------------------------------------------------------------------------- /lefdefReadme.txt: -------------------------------------------------------------------------------- 1 | This directory contains the the 5.8 version of Library Exchange Format (LEF) and Design 2 | Exchange Format (DEF). LEF and DEF are distributed free of charge. See the 3 | License.txt file in the LEF and DEF modules for conditions attached to the use of this 4 | software, and the copying or distribution of it. 5 | 6 | The Make programs for some systems may not be able to process the Makefile for the 7 | LEF/DEF utilities. If your system's native Make program returns errors when building 8 | LEF/DEF, use GNU Make, or change the Makefiles so that they work on your system. 9 | 10 | Mixing 5.4, 5.5, 5.6 and 5.7 Syntax with 5.8 Syntax 11 | 12 | Use caution when mixing versions 5.4, 5.5, 5.6, and 5.7 syntax in LEF and DEF files. If you 13 | include obsolete 5.4, 5.5, 5.6 and 5.7 constructs in a 5.8 file, the reader generates a warning. 14 | 15 | Documentation 16 | 17 | Documentation for the LEF and DEF application programming interfaces can be found in 18 | the lef/doc and def/doc subdirectories, but it has not yet been updated with the 19 | changes required for the new 5.8 syntax. Please contact Cadence for the version of 20 | the LEF/DEF 5.8 syntax. 21 | 22 | Bug Reporting 23 | 24 | Please report issues with this version of the LEF/DEF 5.8 parser directly to Cadence. 25 | Email mguiney@cadence.com 26 | 27 | Platforms Supported 28 | 29 | The LEF/DEF utilities have been tested on Linux RH 5.5. They should also work on Solaris 5.10. 30 | 31 | Installation 32 | 33 | The following information explains how to compile the LEF and DEF packages. 34 | 35 | Installing LEF 36 | 37 | To install LEF, do the following: 38 | 39 | 1. Change directories (cd) to the lef subdirectory containing the package's source code. 40 | 2. To compile and build the package, type the following command: 41 | gmake 42 | 43 | 3. To set DEBUG with OPTIMIZE_FLAG, type the following command: 44 | gmake release 45 | 46 | 4. To install headers before compiling lefrw lefdiff lefwrite, type the following 47 | command: 48 | gmake installhdrs 49 | 50 | 5. Optionally, to run the tests that come with the package, type the following command: 51 | ./gmake test 52 | 53 | NOTE: To remove the program binaries and object files from the source code directory, 54 | type the following command: 55 | 56 | gmake clean 57 | 58 | 59 | Installing DEF 60 | 61 | To install DEF, do the following: 62 | 63 | 1. Change directories (cd) to the def subdirectory containing the package's source code. 64 | 2. To compile and build the package, type the following command: 65 | gmake 66 | 67 | 3. To set DEBUG with OPTIMIZE_FLAG, type the following command: 68 | gmake release 69 | 70 | 4. To install headers before compiling defrw defdiff defwrite, type the following command: 71 | gmake installhdrs 72 | 73 | 5. Optionally, to run the tests that come with the package, type the following command: 74 | ./gmake test 75 | 76 | NOTE: To remove the program binaries and object files from the source code directory, 77 | type the following command: 78 | 79 | gmake clean 80 | 81 | --------------------------------------------------------------------------------