Merge branch 'master' of https://github.com/KLayout/klayout into netlist_properties

This commit is contained in:
Matthias Koefferlein 2019-11-13 00:59:29 +01:00
commit bb3aed5773
16 changed files with 107 additions and 62 deletions

View File

@ -28,31 +28,39 @@ pwd=$(pwd)
enable32bit=1 enable32bit=1
enable64bit=1 enable64bit=1
args=""
suffix=""
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then while [ "$1" != "" ]; do
echo "Runs the Windows build include installer generation." if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo "" echo "Runs the Windows build include installer generation."
echo "Run this script from the root directory." echo ""
echo "" echo "Run this script from the root directory."
echo "Usage:" echo ""
echo " scripts/deploy-win-mingw.sh <options>" echo "Usage:"
echo "" echo " scripts/deploy-win-mingw.sh <options>"
echo "Options:" echo ""
echo " -32 Run 32 bit build only" echo "Options:"
echo " -64 Run 64 bit build only" echo " -32 Run 32 bit build only"
echo "" echo " -64 Run 64 bit build only"
echo "By default, both 32 and 64 bit builds are performed" echo " -s <suffix> Binary suffix"
exit 0 echo ""
elif [ "$1" = "-32" ]; then echo "By default, both 32 and 64 bit builds are performed"
enable64bit=0 exit 0
enable32bit=1 elif [ "$1" = "-32" ]; then
elif [ "$1" = "-64" ]; then enable64bit=0
enable64bit=1 enable32bit=1
enable32bit=0 elif [ "$1" = "-64" ]; then
elif [ "$1" != "" ]; then enable64bit=1
echo "ERROR: invalid option $1 (use -h for details)" enable32bit=0
exit 1 elif [ "$1" = "-s" ]; then
fi shift
suffix="-$1"
else
args="$args $1"
fi
shift
done
# --------------------------------------------------- # ---------------------------------------------------
# Bootstrap script # Bootstrap script
@ -63,6 +71,8 @@ if [ "$KLAYOUT_BUILD_IN_PROGRESS" == "" ]; then
self=$(which $0) self=$(which $0)
export KLAYOUT_BUILD_IN_PROGRESS=1 export KLAYOUT_BUILD_IN_PROGRESS=1
export KLAYOUT_BUILD_ARGS="$args"
export KLAYOUT_BUILD_SUFFIX="$suffix"
# Run ourself in MINGW32 system for the win32 build # Run ourself in MINGW32 system for the win32 build
if [ "$enable32bit" != "0" ]; then if [ "$enable32bit" != "0" ]; then
@ -104,13 +114,15 @@ plugins="audio generic iconengines imageformats platforms printsupport sqldriver
echo "------------------------------------------------------------------" echo "------------------------------------------------------------------"
echo "Running build for architecture $arch .." echo "Running build for architecture $arch .."
echo "" echo ""
echo " target = $target" echo " target = $target"
echo " build = $build" echo " build = $build"
echo " version = $KLAYOUT_VERSION" echo " version = $KLAYOUT_VERSION"
echo " build args = $KLAYOUT_BUILD_ARGS"
echo " suffix = $KLAYOUT_BUILD_SUFFIX"
echo "" echo ""
rm -rf $target rm -rf $target
./build.sh -python $python -ruby $ruby -bin $target -build $build -j2 ./build.sh -python $python -ruby $ruby -bin $target -build $build -j2$KLAYOUT_BUILD_ARGS
if ! [ -e $target ]; then if ! [ -e $target ]; then
echo "ERROR: Target directory $target not found" echo "ERROR: Target directory $target not found"
@ -227,12 +239,12 @@ done
# longer require the copy # longer require the copy
cp $scripts/klayout-inst.nsis $target cp $scripts/klayout-inst.nsis $target
cd $target cd $target
NSIS_VERSION=$KLAYOUT_VERSION NSIS_ARCH=$arch "$makensis" klayout-inst.nsis NSIS_VERSION=$KLAYOUT_VERSION NSIS_ARCH=$arch$KLAYOUT_BUILD_SUFFIX "$makensis" klayout-inst.nsis
# ---------------------------------------------------------- # ----------------------------------------------------------
# Produce the .zip file # Produce the .zip file
zipname="klayout-$KLAYOUT_VERSION-$arch" zipname="klayout-$KLAYOUT_VERSION-$arch$KLAYOUT_BUILD_SUFFIX"
echo "Making .zip file $zipname.zip .." echo "Making .zip file $zipname.zip .."

View File

@ -333,10 +333,10 @@ class Config(object):
version_file = os.path.join(os.path.dirname(__file__), "version.sh") version_file = os.path.join(os.path.dirname(__file__), "version.sh")
with open(version_file, "r") as file: with open(version_file, "r") as file:
version_txt = file.read() version_txt = file.read()
rm = re.search(r"KLAYOUT_VERSION\s*=\s*\"(.*?)\".*", version_txt) rm = re.search(r"KLAYOUT_PYPI_VERSION\s*=\s*\"(.*?)\".*", version_txt)
if rm: if rm:
version_string = rm.group(1) version_string = rm.group(1)
print("KLAYOUT_VERSION = " + version_string) print("KLAYOUT_PYPI_VERSION = " + version_string)
return version_string return version_string
raise RuntimeError("Unable to obtain version string from version.sh") raise RuntimeError("Unable to obtain version string from version.sh")
@ -550,7 +550,7 @@ if __name__ == '__main__':
# Optional classifiers # Optional classifiers
"Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)", "Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)",
], ],
url='https://github.com/klayoutmatthias/klayout', url='https://github.com/klayout/klayout',
packages=find_packages('src/pymod/distutils_src'), packages=find_packages('src/pymod/distutils_src'),
package_dir={'': 'src/pymod/distutils_src'}, # https://github.com/pypa/setuptools/issues/230 package_dir={'': 'src/pymod/distutils_src'}, # https://github.com/pypa/setuptools/issues/230
ext_modules=[_tl, _gsi, _pya, _db, _lib, _rdb] + db_plugins + [tl, db, lib, rdb]) ext_modules=[_tl, _gsi, _pya, _db, _lib, _rdb] + db_plugins + [tl, db, lib, rdb])

View File

@ -188,7 +188,7 @@ HierarchyBuilder::register_variant (db::cell_index_type non_var, db::cell_index_
void void
HierarchyBuilder::unregister_variant (db::cell_index_type var) HierarchyBuilder::unregister_variant (db::cell_index_type var)
{ {
variant_to_original_target_map_type::const_iterator v = m_variants_to_original_target_map.find (var); variant_to_original_target_map_type::iterator v = m_variants_to_original_target_map.find (var);
if (v == m_variants_to_original_target_map.end ()) { if (v == m_variants_to_original_target_map.end ()) {
return; return;
} }

View File

@ -297,7 +297,7 @@ TEST(8_GridVariants)
// expanded placements mod 10: // expanded placements mod 10:
// c in a: r0 *2 x=1,1+102 y=10,10+101 x r0 *1 x=2,y=3 // c in a: r0 *2 x=1,1+102 y=10,10+101 x r0 *1 x=2,y=3
// = (3,3),(5,3),(3,4),(5,4) // = (3,3),(5,3),(3,4),(5,4)
EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "r0 *1 3,3[1];r0 *1 5,3[1];r0 *1 3,4[1];r0 *1 5,4[1]"); EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "r0 *1 -5,3[1];r0 *1 3,3[1];r0 *1 -5,4[1];r0 *1 3,4[1]");
EXPECT_EQ (var2str (vb.variants (d.cell_index ())), ""); EXPECT_EQ (var2str (vb.variants (d.cell_index ())), "");
EXPECT_EQ (inst2str (ly, a), "B:r0 *1 1,10;B:r0 *1 1,111;B:r0 *1 103,10;B:r0 *1 103,111"); EXPECT_EQ (inst2str (ly, a), "B:r0 *1 1,10;B:r0 *1 1,111;B:r0 *1 103,10;B:r0 *1 103,111");
@ -306,13 +306,13 @@ TEST(8_GridVariants)
std::map<db::cell_index_type, std::map<db::ICplxTrans, db::cell_index_type> > vm; std::map<db::cell_index_type, std::map<db::ICplxTrans, db::cell_index_type> > vm;
vb.separate_variants (ly, a, &vm); vb.separate_variants (ly, a, &vm);
EXPECT_EQ (vm2str (ly, vm), "B:B[r0 *1 1,0],B$VAR1[r0 *1 3,0],B$VAR2[r0 *1 1,1],B$VAR3[r0 *1 3,1];C:C[r0 *1 3,3],C$VAR1[r0 *1 5,3],C$VAR2[r0 *1 3,4],C$VAR3[r0 *1 5,4]"); EXPECT_EQ (vm2str (ly, vm), "B:B[r0 *1 1,0],B$VAR1[r0 *1 3,0],B$VAR2[r0 *1 1,1],B$VAR3[r0 *1 3,1];C:C[r0 *1 -5,3],C$VAR1[r0 *1 3,3],C$VAR2[r0 *1 -5,4],C$VAR3[r0 *1 3,4]");
EXPECT_EQ (inst2str (ly, a), "B:r0 *1 1,10;B$VAR2:r0 *1 1,111;B$VAR1:r0 *1 103,10;B$VAR3:r0 *1 103,111"); EXPECT_EQ (inst2str (ly, a), "B:r0 *1 1,10;B$VAR2:r0 *1 1,111;B$VAR1:r0 *1 103,10;B$VAR3:r0 *1 103,111");
EXPECT_EQ (inst2str (ly, b), "C:r0 *1 2,3"); EXPECT_EQ (inst2str (ly, b), "C$VAR1:r0 *1 2,3");
EXPECT_EQ (inst2str (ly, ly.cell (ly.cell_by_name ("B$VAR1").second)), "C$VAR1:r0 *1 2,3"); EXPECT_EQ (inst2str (ly, ly.cell (ly.cell_by_name ("B$VAR1").second)), "C:r0 *1 2,3");
EXPECT_EQ (inst2str (ly, ly.cell (ly.cell_by_name ("B$VAR2").second)), "C$VAR2:r0 *1 2,3"); EXPECT_EQ (inst2str (ly, ly.cell (ly.cell_by_name ("B$VAR2").second)), "C$VAR3:r0 *1 2,3");
EXPECT_EQ (inst2str (ly, ly.cell (ly.cell_by_name ("B$VAR3").second)), "C$VAR3:r0 *1 2,3"); EXPECT_EQ (inst2str (ly, ly.cell (ly.cell_by_name ("B$VAR3").second)), "C$VAR2:r0 *1 2,3");
EXPECT_EQ (inst2str (ly, c), ""); EXPECT_EQ (inst2str (ly, c), "");
} }
@ -352,21 +352,21 @@ TEST(9_ComplexGridVariants)
// (-9,102),(-9,207),(-112,102),(-112,207) // (-9,102),(-9,207),(-112,102),(-112,207)
// r90 *1 x=1,y=100 x m0 *1 x=2,y=100 // r90 *1 x=1,y=100 x m0 *1 x=2,y=100
// (-99,102) // (-99,102)
// expanded placements mod 10: // expanded ((placements + 5) mod 10) - placements
// c in a: r0 *2 x=1,1+102 y=10,10+101 x r0 *2 x=2,2+105 y=10,10+103 // c in a: r0 *2 x=1,1+102 y=10,10+101 x r0 *2 x=2,2+105 y=10,10+103
// = (5,0),(5,0),(5,6),(5,6) // = (5,0),(5,0),(-5,-4),(-5,-4)
// (7,0),(7,0),(7,6),(7,6) // (7,0),(7,0),(-3,-4),(-3,-4)
// (5,1),(5,1),(5,7),(5,7) // (-5,1),(-5,1),(-5,-3),(-5,-3)
// (7,1),(7,1),(7,7),(7,7) // (-3,1),(-3,1),(-3,-3),(-3,-3)
// r0 *2 x=1,1+102 y=10,10+101 x m0 *1 x=2,y=100 // r0 *2 x=1,1+102 y=10,10+101 x m0 *1 x=2,y=100
// (5,0),(5,1),(7,0),(7,1) // (-5,0),(-5,1),(-3,0),(-3,1)
// r90 *1 x=1,y=100 x r0 *2 x=2,2+105 y=10,10+103 // r90 *1 x=1,y=100 x r0 *2 x=2,2+105 y=10,10+103
// (1,2),(1,7),(8,2),(8,7) // (1,2),(1,-3),(-2,2),(-2,-3)
// r90 *1 x=1,y=100 x m0 *1 x=2,y=100 // r90 *1 x=1,y=100 x m0 *1 x=2,y=100
// (1,2) // (1,2)
EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "m0 *2 5,0[1];r0 *4 5,0[2];m0 *2 7,0[1];r0 *4 7,0[2];m0 *2 5,1[1];r0 *4 5,1[2];" EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "r0 *4 -5,-4[2];r0 *4 -3,-4[2];r0 *4 -5,-3[2];r0 *4 -3,-3[2];r90 *2 -2,-3[1];"
"m0 *2 7,1[1];r0 *4 7,1[2];m45 *1 1,2[1];r90 *2 1,2[1];r90 *2 8,2[1];" "r90 *2 1,-3[1];m0 *2 -5,0[1];r0 *4 -5,0[2];m0 *2 -3,0[1];r0 *4 -3,0[2];"
"r0 *4 5,6[2];r0 *4 7,6[2];r90 *2 1,7[1];r0 *4 5,7[2];r0 *4 7,7[2];r90 *2 8,7[1]"); "m0 *2 -5,1[1];r0 *4 -5,1[2];m0 *2 -3,1[1];r0 *4 -3,1[2];r90 *2 -2,2[1];m45 *1 1,2[1];r90 *2 1,2[1]");
EXPECT_EQ (var2str (vb.variants (d.cell_index ())), ""); EXPECT_EQ (var2str (vb.variants (d.cell_index ())), "");
} }

View File

@ -58,7 +58,7 @@ namespace lay
*/ */
inline db::DCoord snap (db::DCoord c) inline db::DCoord snap (db::DCoord c)
{ {
return floor (c + 0.5); return floor (c + 0.5 + db::coord_traits<double>::prec ());
} }
/** /**

View File

@ -207,6 +207,8 @@ PythonInterpreter::PythonInterpreter (bool embedded)
tl_assert (sizeof (wchar_t) == 2); tl_assert (sizeof (wchar_t) == 2);
Py_SetPythonHome ((wchar_t *) L""); // really ignore $PYTHONHOME + without this, we get dummy error message about lacking path for libraries
const wchar_t *python_path = _wgetenv (L"KLAYOUT_PYTHONPATH"); const wchar_t *python_path = _wgetenv (L"KLAYOUT_PYTHONPATH");
if (python_path) { if (python_path) {

View File

@ -31,6 +31,11 @@
using namespace tl; using namespace tl;
static std::string norm_exp (const std::string &s)
{
return tl::replaced (tl::replaced (s, "e+006", "e+06"), "E+006", "E+06");
}
TEST(1) TEST(1)
{ {
EXPECT_EQ (to_string (12.5), "12.5"); EXPECT_EQ (to_string (12.5), "12.5");
@ -44,17 +49,10 @@ TEST(1)
EXPECT_EQ (to_string ((unsigned char *)" 12"), " 12"); EXPECT_EQ (to_string ((unsigned char *)" 12"), " 12");
EXPECT_EQ (to_string (std::string (" 12")), " 12"); EXPECT_EQ (to_string (std::string (" 12")), " 12");
#if defined(_WIN32) && !defined(_MSC_VER) EXPECT_EQ (norm_exp (tl::sprintf("%g %e %f",M_PI,M_PI*1e6,M_PI*0.001)), "3.14159 3.141593e+06 0.003142");
EXPECT_EQ (tl::sprintf("%g %e %f",M_PI,M_PI*1e6,M_PI*0.001), "3.14159 3.141593e+006 0.003142"); EXPECT_EQ (norm_exp (tl::sprintf("%G %E %F",M_PI*1e6,M_PI*1e6,M_PI*1e6)), "3.14159E+06 3.141593E+06 3141592.653590");
EXPECT_EQ (tl::sprintf("%G %E %F",M_PI*1e6,M_PI*1e6,M_PI*1e6), "3.14159E+006 3.141593E+006 3141592.653590"); EXPECT_EQ (norm_exp (tl::sprintf("%-15g %015.8e %15.12f %g",M_PI,M_PI*1e6,M_PI*0.001,M_PI)), "3.14159 03.14159265e+06 0.003141592654 3.14159");
EXPECT_EQ (tl::sprintf("%-15g %15.8e %15.12f %g",M_PI,M_PI*1e6,M_PI*0.001,M_PI), "3.14159 3.14159265e+006 0.003141592654 3.14159"); EXPECT_EQ (norm_exp (tl::sprintf("%-15g %015.8E %15.12f %g",M_PI,M_PI*1e6,M_PI*0.001,M_PI)), "3.14159 03.14159265E+06 0.003141592654 3.14159");
EXPECT_EQ (tl::sprintf("%-15g %15.8E %15.12f %g",M_PI,M_PI*1e6,M_PI*0.001,M_PI), "3.14159 3.14159265E+006 0.003141592654 3.14159");
#else
EXPECT_EQ (tl::sprintf("%g %e %f",M_PI,M_PI*1e6,M_PI*0.001), "3.14159 3.141593e+06 0.003142");
EXPECT_EQ (tl::sprintf("%G %E %F",M_PI*1e6,M_PI*1e6,M_PI*1e6), "3.14159E+06 3.141593E+06 3141592.653590");
EXPECT_EQ (tl::sprintf("%-15g %015.8e %15.12f %g",M_PI,M_PI*1e6,M_PI*0.001,M_PI), "3.14159 03.14159265e+06 0.003141592654 3.14159");
EXPECT_EQ (tl::sprintf("%-15g %015.8E %15.12f %g",M_PI,M_PI*1e6,M_PI*0.001,M_PI), "3.14159 03.14159265E+06 0.003141592654 3.14159");
#endif
EXPECT_EQ (tl::sprintf("%-5s %5s %x %u %d (%s)","a","b",1234,2345,3456), "a b 4d2 2345 3456 ()"); EXPECT_EQ (tl::sprintf("%-5s %5s %x %u %d (%s)","a","b",1234,2345,3456), "a b 4d2 2345 3456 ()");
EXPECT_EQ (tl::sprintf("%lu %llu %02x", 1, 2, 167), "1 2 a7"); EXPECT_EQ (tl::sprintf("%lu %llu %02x", 1, 2, 167), "1 2 a7");
EXPECT_EQ (tl::sprintf("%lu %llu %02X", 1, 2, 761), "1 2 2F9"); EXPECT_EQ (tl::sprintf("%lu %llu %02X", 1, 2, 761), "1 2 2F9");

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
testdata/algo/device_extract_au10.gds.4 vendored Normal file

Binary file not shown.

30
testdata/lvs/invchain_cheat.cir.4 vendored Normal file
View File

@ -0,0 +1,30 @@
* Extracted by KLayout
.SUBCKT INVCHAIN
X$1 \$7 \$1 \$9 \$8 \$6 \$9 \$5 \$5 \$3 \$2 \$I2 \$I1 INV3
X$2 \$8 \$11 \$9 \$10 \$8 \$11 \$2 \$I3 \$2 \$I3 \$5 \$4 \$I2 \$I1 INV2
X$3 \$I1 \$I2 \$11 \$I3 \$4 \$4 \$10 \$10 INV
.ENDS INVCHAIN
.SUBCKT INV3 \$I18 \$I17 \$I15 \$I14 \$I13 \$I11 \$I10 \$I8 \$I7 \$I5 \$I4 \$I2
X$1 \$I2 \$I4 \$I13 \$I17 \$I7 \$I7 \$I18 \$I18 INV
X$2 \$I2 \$I4 \$I18 \$I7 \$I17 \$I17 \$I13 \$I13 INV
X$3 \$I2 \$I4 \$I14 \$I5 \$I8 \$I10 \$I15 \$I11 INV
.ENDS INV3
.SUBCKT INV2 \$I16 \$I15 \$I14 \$I13 \$I12 \$I11 \$I10 \$I9 \$I8 \$I7 \$I6 \$I5
+ \$I4 \$I2
X$1 \$I2 \$I4 \$I14 \$I6 \$I8 \$I10 \$I16 \$I12 INV
X$2 \$I2 \$I4 \$I13 \$I5 \$I7 \$I9 \$I15 \$I11 INV
.ENDS INV2
.SUBCKT INV \$1 \$2 \$3 \$4 \$6 \$9 \$I8 \$I7
M$1 \$4 \$3 \$2 \$4 PMOS L=0.25U W=0.95U AS=0.79325P AD=0.26125P PS=3.57U
+ PD=1.5U
M$2 \$2 \$I8 \$6 \$2 PMOS L=0.25U W=0.95U AS=0.26125P AD=0.03325P PS=1.5U
+ PD=1.97U
M$3 \$4 \$3 \$1 \$4 NMOS L=0.25U W=0.95U AS=0.79325P AD=0.26125P PS=3.57U
+ PD=1.5U
M$4 \$1 \$I7 \$9 \$1 NMOS L=0.25U W=0.95U AS=0.26125P AD=0.03325P PS=1.5U
+ PD=1.97U
.ENDS INV

BIN
testdata/net_tracer/t6_all_nets.oas.gz.3 vendored Normal file

Binary file not shown.

View File

@ -4,6 +4,9 @@
# The main version # The main version
KLAYOUT_VERSION="0.26.1" KLAYOUT_VERSION="0.26.1"
# The version used for PyPI (don't use variables here!)
KLAYOUT_PYPI_VERSION="0.26.1r1"
# The build date # The build date
KLAYOUT_VERSION_DATE=$(date "+%Y-%m-%d") KLAYOUT_VERSION_DATE=$(date "+%Y-%m-%d")