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

This commit is contained in:
klayoutmatthias 2022-04-16 20:13:04 +02:00
commit fd4fe5ce62
3766 changed files with 35468 additions and 8438 deletions

View File

@ -6,7 +6,7 @@ Authors:
Matthias Köfferlein
Copyright:
Copyright (C) 2006-2021 by Matthias Köfferlein.
Copyright (C) 2006-2022 by Matthias Köfferlein.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,27 @@
0.27.6 (2021-xx-xx):
TODO
0.28 (2022-xx-xx):
0.27.6 (2022-01-04):
* Enhancement: %GITHUB%/issues/963 Display snapped position in main window
* Bugfix: %GITHUB%/issues/960 Cap values range now shown in netlist browser
* Bugfix: %GITHUB%/issues/954 Fixed a device extraction glitch
* Bugfix: %GITHUB%/issues/951 Internal error fixed when deleting the cell you're sitting at
Side effect: copy & paste of cells is correctly disabled now in viewer mode
* Bugfix: %GITHUB%/issues/942 Technology file routing suffix string typo
* Bugfix: %GITHUB%/issues/946 Python: __file__ returns quoted path string
* Bugfix: DRC check for equal width now returns more consistent results
Previously, a check like "layer.drc(width == something)" was not flagging
all candidates correctly.
* Enhancement: A PCell can request "lazy evaluation" now
This means that a parameter change needs to be committed in the UI before
it is being taken. This way, slow PCell evaluation will not make the
application stall. To add this feature, reimplement "wants_lazy_evaluation"
in the PCell class to return "true".
* Enhancement: "lvs_data" is a global function now in LVS scripts
* Bugfix: less liberal evaluation of expressions in string to numeric conversion
This will fix a potential vulnerability which allows someone to sneak
in expression code through malicious configuration, technology or layer properties
files.
0.27.5 (2021-11-14):
* Enhancements: Better support for execution (also cross-interpreter) of macro code from scripts

View File

@ -1,3 +1,10 @@
klayout (0.27.6-1) unstable; urgency=low
* New features and bugfixes
- See changelog
-- Matthias Köfferlein <matthias@koefferlein.de> Tue, 04 Jan 2022 21:19:17 +0100
klayout (0.27.5-1) unstable; urgency=low
* New features and bugfixes

View File

@ -33,7 +33,7 @@ node("master") {
stage("Publish and test") {
// publish for release tags
if (BRANCH_NAME.startsWith('v')) {
if (BRANCH_NAME.startsWith('pypi_')) {
sh("twine upload --skip-existing wheelhouse/klayout-*manylinux2014*.whl wheelhouse/*.zip")
}

View File

@ -6,19 +6,19 @@ trigger:
- staging
tags:
include:
- '*'
- 'v*'
jobs:
- job: Build
pool:
vmImage: 'vs2017-win2016' # other options: 'macOS-10.13', 'ubuntu-16.04'
vmImage: 'windows-2019' # other options: 'macOS-10.13', 'ubuntu-16.04'
strategy:
matrix:
# Python27:
# python.version: '2.7'
cp35-cp35m-win_amd64.whl:
python.version: '3.5'
python.architecture: 'x64'
# cp35-cp35m-win_amd64.whl:
# python.version: '3.5'
# python.architecture: 'x64'
cp36-cp36m-win_amd64.whl:
python.version: '3.6'
python.architecture: 'x64'
@ -31,9 +31,12 @@ jobs:
cp39-cp39-win_amd64.whl:
python.version: '3.9'
python.architecture: 'x64'
cp35-cp35m-win32.whl:
python.version: '3.5'
python.architecture: 'x86'
cp310-cp310-win_amd64.whl:
python.version: '3.10'
python.architecture: 'x64'
# cp35-cp35m-win32.whl:
# python.version: '3.5'
# python.architecture: 'x86'
cp36-cp36m-win32.whl:
python.version: '3.6'
python.architecture: 'x86'
@ -46,6 +49,9 @@ jobs:
cp39-cp39-win32.whl:
python.version: '3.9'
python.architecture: 'x86'
cp310-cp310-win32.whl:
python.version: '3.10'
python.architecture: 'x86'
maxParallel: 6
steps:
@ -126,9 +132,14 @@ jobs:
displayName: 'Combine Windows wheels and deploy to PyPI'
dependsOn: Build
pool:
vmImage: 'vs2017-win2016' # other options: 'macOS-10.13', 'ubuntu-16.04'
vmImage: 'windows-2019' # other options: 'macOS-10.13', 'ubuntu-16.04'
steps:
- checkout: none #skip checking out the default repository resource
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.10.x64'
inputs:
artifactName: 'wheel-3.10.x64'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.9.x64'
inputs:
@ -150,9 +161,9 @@ jobs:
artifactName: 'wheel-3.6.x64'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.5.x64'
displayName: 'Download Build Artifacts wheel-3.10.x86'
inputs:
artifactName: 'wheel-3.5.x64'
artifactName: 'wheel-3.10.x86'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.9.x86'
@ -174,11 +185,6 @@ jobs:
inputs:
artifactName: 'wheel-3.6.x86'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.5.x86'
inputs:
artifactName: 'wheel-3.5.x86'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: CopyFiles@2
condition: always()
inputs:

View File

@ -2,7 +2,7 @@
#
# KLayout Layout Viewer
# Copyright (C) 2006-2021 Matthias Koefferlein
# Copyright (C) 2006-2022 Matthias Koefferlein
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@ -147,29 +147,36 @@ def Get_Default_Config():
Usage, ModuleSet = GenerateUsage(Platform)
# Set the default modules
ModuleQt = "Qt5MacPorts"
if Platform == "Monterey":
ModuleQt = "Qt6Brew"
ModuleRuby = "RubyMonterey"
ModulePython = "PythonMonterey"
elif Platform == "BigSur":
ModuleQt = "Qt6Brew"
ModuleRuby = "RubyBigSur"
ModulePython = "PythonBigSur"
elif Platform == "Catalina":
ModuleQt = "Qt6Brew"
ModuleRuby = "RubyCatalina"
ModulePython = "PythonCatalina"
elif Platform == "Mojave":
ModuleQt = "Qt6Brew"
ModuleRuby = "RubyMojave"
ModulePython = "PythonMojave"
elif Platform == "HighSierra":
ModuleQt = "Qt6Brew"
ModuleRuby = "RubyHighSierra"
ModulePython = "PythonHighSierra"
elif Platform == "Sierra":
ModuleQt = "Qt6Brew"
ModuleRuby = "RubySierra"
ModulePython = "PythonSierra"
elif Platform == "ElCapitan":
ModuleQt = "Qt6Brew"
ModuleRuby = "RubyElCapitan"
ModulePython = "PythonElCapitan"
else:
ModuleQt = "Qt6Brew"
ModuleRuby = "nil"
ModulePython = "nil"
@ -243,7 +250,6 @@ def Parse_CLI_Args(config):
PackagePrefix = config['PackagePrefix']
DeployVerbose = config['DeployVerbose']
ModuleSet = config['ModuleSet']
qt, ruby, python = ModuleSet
#-----------------------------------------------------
# [2] Parse the CLI arguments
@ -311,18 +317,32 @@ def Parse_CLI_Args(config):
default=False,
help='check usage' )
p.set_defaults( type_qt = "%s" % qt,
type_ruby = "sys",
type_python = "sys",
no_qt_binding = False,
no_qt_uitools = False,
make_option = "--jobs=4",
debug_build = False,
check_command = False,
deploy_full = False,
deploy_partial = False,
deploy_verbose = "1",
checkusage = False )
if Platform.upper() in [ "MONTEREY", "BIGSUR" ]: # with Xcode [13.1 .. ]
p.set_defaults( type_qt = "qt6brew",
type_ruby = "hb27",
type_python = "hb38",
no_qt_binding = False,
no_qt_uitools = False,
make_option = "--jobs=4",
debug_build = False,
check_command = False,
deploy_full = False,
deploy_partial = False,
deploy_verbose = "1",
checkusage = False )
else: # with Xcode [ .. 12.4]
p.set_defaults( type_qt = "qt6brew",
type_ruby = "sys",
type_python = "sys",
no_qt_binding = False,
no_qt_uitools = False,
make_option = "--jobs=4",
debug_build = False,
check_command = False,
deploy_full = False,
deploy_partial = False,
deploy_verbose = "1",
checkusage = False )
opt, args = p.parse_args()
if (opt.checkusage):
@ -578,7 +598,7 @@ def Get_Build_Parameters(config):
mode = "release"
# (B) Modules
(qt, ruby, python) = ModuleSet # ( 'qt6MP', 'Sys', 'Sys' )
(qt, ruby, python) = ModuleSet # ( 'qt6Brew', 'Sys', 'Sys' )
ruby_python = "R%sP%s" % ( ruby.lower(), python.lower() )
# (C) Target directories and files

View File

@ -18,6 +18,8 @@ def create_ref(mod, s)
else
"<a href=\"/" + $loc + "/" + mod.downcase + "_ref_" + $1.downcase + ".xml\">#{$1}</a>"
end
elsif s =~ /([A-Z].*)/
"<a href=\"/" + $loc + "/" + mod.downcase + "_ref_" + $1.downcase + ".xml\">#{$1}</a>"
else
"<a href=\"#" + s + "\">#{s}</a>"
end
@ -34,6 +36,8 @@ def create_link(mod, s)
else
"<link href=\"/" + $loc + "/" + mod.downcase + "_ref_" + $1.downcase + ".xml\"/>"
end
elsif s =~ /([A-Z].*)/
"<link href=\"/" + $loc + "/" + mod.downcase + "_ref_" + $1.downcase + ".xml\"/>"
else
"<link href=\"#" + s + "\"/>"
end

View File

@ -110,7 +110,7 @@ cp -pd $bininstdir/db_plugins/lib*so* makedeb-tmp/${libdir}/db_plugins
cp -pd $bininstdir/lay_plugins/lib*so* makedeb-tmp/${libdir}/lay_plugins
cp -pd $bininstdir/pymod/klayout/*so makedeb-tmp/${pylibdir}
cp -pd $bininstdir/pymod/klayout/*py makedeb-tmp/${pylibdir}
for d in db tl rdb; do
for d in db tl rdb lib; do
mkdir -p makedeb-tmp/${pylibdir}/$d
cp -pd $bininstdir/pymod/klayout/$d/*py makedeb-tmp/${pylibdir}/$d
done

View File

@ -21,7 +21,7 @@
# ./scripts/mkqtdecl.sh -h
#
#
# Copyright (C) 2006-2021 Matthias Koefferlein
# Copyright (C) 2006-2022 Matthias Koefferlein
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2006-2021 Matthias Koefferlein
# Copyright (C) 2006-2022 Matthias Koefferlein
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2006-2021 Matthias Koefferlein
# Copyright (C) 2006-2022 Matthias Koefferlein
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2006-2021 Matthias Koefferlein
# Copyright (C) 2006-2022 Matthias Koefferlein
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
#!/usr/bin/env ruby
#
# Copyright (C) 2006-2021 Matthias Koefferlein
# Copyright (C) 2006-2022 Matthias Koefferlein
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
#
# Copyright (C) 2006-2021 Matthias Koefferlein
# Copyright (C) 2006-2022 Matthias Koefferlein
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
#
# Copyright (C) 2006-2021 Matthias Koefferlein
# Copyright (C) 2006-2022 Matthias Koefferlein
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
#
# Copyright (C) 2006-2021 Matthias Koefferlein
# Copyright (C) 2006-2022 Matthias Koefferlein
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
#
# Copyright (C) 2006-2021 Matthias Koefferlein
# Copyright (C) 2006-2022 Matthias Koefferlein
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
#
# Copyright (C) 2006-2021 Matthias Koefferlein
# Copyright (C) 2006-2022 Matthias Koefferlein
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
#!/usr/bin/env ruby
#
# Copyright (C) 2006-2021 Matthias Koefferlein
# Copyright (C) 2006-2022 Matthias Koefferlein
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
#!/usr/bin/env ruby
#
# Copyright (C) 2006-2021 Matthias Koefferlein
# Copyright (C) 2006-2022 Matthias Koefferlein
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -1509,7 +1509,7 @@ class BindingProducer
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -3072,7 +3072,7 @@ END
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
#
# Copyright (C) 2006-2021 Matthias Koefferlein
# Copyright (C) 2006-2022 Matthias Koefferlein
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@ -153,7 +153,7 @@ mkdir -p %{buildroot}%{pylib}/klayout
cp -pd %{_builddir}/bin.$TARGET/pymod/klayout/*.so %{buildroot}%{pylib}/klayout
cp -pd %{_builddir}/bin.$TARGET/pymod/klayout/*.py %{buildroot}%{pylib}/klayout
chmod 644 %{buildroot}%{pylib}/klayout/*
for d in tl db rdb; do
for d in tl db rdb lib; do
mkdir -p %{buildroot}%{pylib}/klayout/$d
cp -pd %{_builddir}/bin.$TARGET/pymod/klayout/$d/*.py %{buildroot}%{pylib}/klayout/$d
chmod 644 %{buildroot}%{pylib}/klayout/$d/*

View File

@ -4,7 +4,7 @@
KLayout standalone Python module setup script
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -273,8 +273,6 @@ class Config(object):
quote_path("-I" + os.path.join(bits, "curl", "include"))]
else:
return []
elif platform.system() == "Darwin":
return []
else:
return ["-Wno-strict-aliasing", # Avoids many "type-punned pointer" warnings
"-std=c++11", # because we use unordered_map/unordered_set
@ -534,6 +532,7 @@ tl = Extension(config.root + '.tlcore',
include_dirs=[_tl_path, _gsi_path, _pya_path],
extra_objects=[config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_pya', _pya_path)],
extra_link_args=config.link_args('tlcore'),
extra_compile_args=config.compile_args('tlcore'),
sources=list(tl_sources))
# ------------------------------------------------------------------
@ -547,6 +546,7 @@ db = Extension(config.root + '.dbcore',
include_dirs=[_db_path, _tl_path, _gsi_path, _pya_path],
extra_objects=[config.path_of('_db', _db_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_pya', _pya_path)],
extra_link_args=config.link_args('dbcore'),
extra_compile_args=config.compile_args('dbcore'),
sources=list(db_sources))
# ------------------------------------------------------------------
@ -560,6 +560,7 @@ lib = Extension(config.root + '.libcore',
include_dirs=[_lib_path, _tl_path, _gsi_path, _pya_path],
extra_objects=[config.path_of('_lib', _lib_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_pya', _pya_path)],
extra_link_args=config.link_args('libcore'),
extra_compile_args=config.compile_args('libcore'),
sources=list(lib_sources))
# ------------------------------------------------------------------
@ -573,6 +574,7 @@ rdb = Extension(config.root + '.rdbcore',
include_dirs=[_rdb_path, _tl_path, _gsi_path, _pya_path],
extra_objects=[config.path_of('_rdb', _rdb_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_pya', _pya_path)],
extra_link_args=config.link_args('rdbcore'),
extra_compile_args=config.compile_args('rdbcore'),
sources=list(rdb_sources))
# ------------------------------------------------------------------
@ -583,7 +585,7 @@ if __name__ == '__main__':
version=config.version(),
license='GNU GPLv3',
description='KLayout standalone Python package',
long_description='TODO',
long_description='This package is a standalone distribution of KLayout\'s Python API.\n\nFor more details see here: https://www.klayout.org/klayout-pypi',
author='Matthias Koefferlein',
author_email='matthias@klayout.de',
classifiers=[

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -76,7 +76,7 @@ ConfigPage::commit (lay::Dispatcher *root)
root->config_set (cfg_ruler_grid_snap, mp_ui->ruler_grid_snap_cbx->isChecked ());
int sr = 0;
tl::from_string (tl::to_string (mp_ui->ruler_snap_range_edit->text ()), sr);
tl::from_string_ext (tl::to_string (mp_ui->ruler_snap_range_edit->text ()), sr);
if (sr < 1 || sr > 1000) {
throw tl::Exception (tl::to_string (QObject::tr ("Not a valid pixel value (must be non-zero positive and not too large): %s")), tl::to_string (mp_ui->ruler_snap_range_edit->text ()));
}
@ -127,7 +127,7 @@ ConfigPage2::commit (lay::Dispatcher *root)
{
int mr;
try {
tl::from_string (tl::to_string (mp_ui->num_rulers_edit->text ()), mr);
tl::from_string_ext (tl::to_string (mp_ui->num_rulers_edit->text ()), mr);
} catch (...) {
mr = -1;
}

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -132,7 +132,7 @@ PropertiesPage::get_points (db::DPoint &p1, db::DPoint &p2)
bool has_error = false;
try {
tl::from_string (tl::to_string (x1->text ()), dx1);
tl::from_string_ext (tl::to_string (x1->text ()), dx1);
lay::indicate_error (x1, (tl::Exception *) 0);
} catch (tl::Exception &ex) {
lay::indicate_error (x1, &ex);
@ -140,7 +140,7 @@ PropertiesPage::get_points (db::DPoint &p1, db::DPoint &p2)
}
try {
tl::from_string (tl::to_string (x2->text ()), dx2);
tl::from_string_ext (tl::to_string (x2->text ()), dx2);
lay::indicate_error (x2, (tl::Exception *) 0);
} catch (tl::Exception &ex) {
lay::indicate_error (x2, &ex);
@ -148,7 +148,7 @@ PropertiesPage::get_points (db::DPoint &p1, db::DPoint &p2)
}
try {
tl::from_string (tl::to_string (y1->text ()), dy1);
tl::from_string_ext (tl::to_string (y1->text ()), dy1);
lay::indicate_error (y1, (tl::Exception *) 0);
} catch (tl::Exception &ex) {
lay::indicate_error (y1, &ex);
@ -156,7 +156,7 @@ PropertiesPage::get_points (db::DPoint &p1, db::DPoint &p2)
}
try {
tl::from_string (tl::to_string (y2->text ()), dy2);
tl::from_string_ext (tl::to_string (y2->text ()), dy2);
lay::indicate_error (y2, (tl::Exception *) 0);
} catch (tl::Exception &ex) {
lay::indicate_error (y2, &ex);

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -42,7 +42,7 @@ int converter_main (int argc, char *argv[], const std::string &format)
generic_reader_options.add_options (cmd);
cmd << tl::arg ("input", &infile, "The input file (any format, may be gzip compressed)",
"You can use '+' to supply multiple files which will be read after each other into the same layout. "
"You can use '+' or ',' to supply multiple files which will be read after each other into the same layout. "
"This provides some cheap, but risky way of merging files. Beware of cell name conflicts.")
<< tl::arg ("output", &outfile, tl::sprintf ("The output file (%s format)", format))
;
@ -56,14 +56,7 @@ int converter_main (int argc, char *argv[], const std::string &format)
{
db::LoadLayoutOptions load_options;
generic_reader_options.configure (load_options);
std::vector<std::string> files = tl::split (infile, "+");
for (std::vector<std::string>::const_iterator f = files.begin (); f != files.end (); ++f) {
tl::InputStream stream (*f);
db::Reader reader (stream);
reader.read (layout, load_options);
}
read_files (layout, infile, load_options);
}
{

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -647,7 +647,7 @@ GenericReaderOptions::add_options (tl::CommandLineOptions &cmd)
"\n"
"The following values are accepted for this option:\n"
"\n"
"* 0: produce LEF geometry unless a FOREIGN cell is specified\n"
"* 0: produce LEF geometry unless a FOREIGN cell is specified (the default)\n"
"* 1: produce LEF geometry always and ignore FOREIGN\n"
"* 2: Never produce LEF geometry and assume FOREIGN always\n"
"\n"
@ -679,8 +679,6 @@ GenericReaderOptions::add_options (tl::CommandLineOptions &cmd)
"Use a comma-separated list of file names here to specify which LEF files to read. "
"See also '--" + m_long_prefix + "lefdef-read-lef-with-def' for an option to implicitly read all LEF files in the same "
"place than the DEF file.\n"
"\n"
"Relative paths are resolved based on the location of the DEF file which is read."
)
;
@ -730,7 +728,7 @@ GenericReaderOptions::configure (db::LoadLayoutOptions &load_options)
load_options.set_option_by_name ("gds2_allow_multi_xy_records", m_gds2_allow_multi_xy_records);
load_options.set_option_by_name ("oasis_read_all_properties", m_oasis_read_all_properties);
load_options.set_option_by_name ("oasis_expect_strict_mode", m_oasis_expect_strict_mode ? 1 : 0);
load_options.set_option_by_name ("oasis_expect_strict_mode", m_oasis_expect_strict_mode ? 1 : -1);
load_options.set_option_by_name ("cif_layer_map", tl::Variant::make_variant (m_layer_map));
load_options.set_option_by_name ("cif_create_other_layers", m_create_other_layers);
@ -807,6 +805,8 @@ GenericReaderOptions::configure (db::LoadLayoutOptions &load_options)
load_options.set_option_by_name ("lefdef_config.separate_groups", m_lefdef_separate_groups);
load_options.set_option_by_name ("lefdef_config.map_file", m_lefdef_map_file);
load_options.set_option_by_name ("lefdef_config.macro_resolution_mode", m_lefdef_macro_resolution_mode);
load_options.set_option_by_name ("lefdef_config.macro_resolution_mode", m_lefdef_macro_resolution_mode);
load_options.set_option_by_name ("lefdef_config.paths_relative_to_cwd", true);
m_lef_layouts.clear ();
tl::Variant lef_layout_ptrs = tl::Variant::empty_list ();
@ -833,4 +833,42 @@ GenericReaderOptions::configure (db::LoadLayoutOptions &load_options)
load_options.set_option_by_name ("lefdef_config.macro_layouts", lef_layout_ptrs);
}
static std::string::size_type find_file_sep (const std::string &s, std::string::size_type from)
{
std::string::size_type p1 = s.find ("+", from);
std::string::size_type p2 = s.find (",", from);
if (p1 == std::string::npos) {
return p2;
} else if (p2 == std::string::npos) {
return p1;
} else {
return p1 < p2 ? p1 : p2;
}
}
static std::vector<std::string> split_file_list (const std::string &infile)
{
std::vector<std::string> files;
size_t p = 0;
for (size_t pp = 0; (pp = find_file_sep (infile, p)) != std::string::npos; p = pp + 1) {
files.push_back (std::string (infile, p, pp - p));
}
files.push_back (std::string (infile, p));
return files;
}
void read_files (db::Layout &layout, const std::string &infile, const db::LoadLayoutOptions &options)
{
std::vector<std::string> files = split_file_list (infile);
for (std::vector<std::string>::const_iterator f = files.begin (); f != files.end (); ++f) {
tl::InputStream stream (*f);
db::Reader reader (stream);
reader.read (layout, options);
}
}
}

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -195,6 +195,13 @@ private:
tl::shared_collection<db::Layout> m_lef_layouts;
};
/**
* @brief A function to load a sequence of files into the layout with the given options
*
* "file_path" is a "+" or "," separated list of files read "into" a single layout.
*/
BD_PUBLIC void read_files (db::Layout &layout, const std::string &infile, const db::LoadLayoutOptions &options);
}
#endif

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -47,10 +47,7 @@ BD_PUBLIC int strm2txt (int argc, char *argv[])
{
db::LoadLayoutOptions load_options;
generic_reader_options.configure (load_options);
tl::InputStream stream (infile);
db::Reader reader (stream);
reader.read (layout, load_options);
bd::read_files (layout, infile, load_options);
}
{

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -71,10 +71,7 @@ void clip (ClipData &data)
{
db::LoadLayoutOptions load_options;
data.reader_options.configure (load_options);
tl::InputStream stream (data.file_in);
db::Reader reader (stream);
reader.read (layout, load_options);
bd::read_files (layout, data.file_in, load_options);
}
// create the layers in the target layout as well

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -142,19 +142,13 @@ BD_PUBLIC int strmcmp (int argc, char *argv[])
{
db::LoadLayoutOptions load_options;
generic_reader_options_a.configure (load_options);
tl::InputStream stream (infile_a);
db::Reader reader (stream);
reader.read (layout_a, load_options);
bd::read_files (layout_a, infile_a, load_options);
}
{
db::LoadLayoutOptions load_options;
generic_reader_options_b.configure (load_options);
tl::InputStream stream (infile_b);
db::Reader reader (stream);
reader.read (layout_b, load_options);
bd::read_files (layout_b, infile_b, load_options);
}
unsigned int flags = 0;

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -21,6 +21,7 @@
*/
#include "bdReaderOptions.h"
#include "bdWriterOptions.h"
#include "dbLayout.h"
#include "dbTilingProcessor.h"
#include "dbReader.h"
@ -30,12 +31,34 @@
#include "dbDeepShapeStore.h"
#include "gsiExpression.h"
#include "tlCommandLineParser.h"
#include "tlThreads.h"
class CountingInserter
namespace {
// ---------------------------------------------------------------------
class HealingCountingReceiver
: public db::TileOutputReceiver
{
public:
CountingInserter ()
: m_count (0)
HealingCountingReceiver (size_t *count, bool healing);
virtual void put (size_t /*ix*/, size_t /*iy*/, const db::Box &tile, size_t /*id*/, const tl::Variant &obj, double /*dbu*/, const db::ICplxTrans & /*trans*/, bool clip);
virtual void finish (bool);
void keep_for_healing (const db::Polygon &poly);
private:
size_t *mp_count;
db::Region m_for_healing;
bool m_healing;
};
class HealingCountingInserter
{
public:
HealingCountingInserter (const db::Box &tile, bool healing, HealingCountingReceiver *rec)
: m_count (0), mp_tile (&tile), m_healing (healing), mp_receiver (rec)
{
// .. nothing yet ..
}
@ -46,6 +69,15 @@ public:
m_count += 1;
}
void operator() (const db::Polygon &poly)
{
if (m_healing && ! poly.box ().inside (mp_tile->enlarged (db::Vector (-1, -1)))) {
mp_receiver->keep_for_healing (poly);
} else {
m_count += 1;
}
}
size_t count () const
{
return m_count;
@ -53,29 +85,140 @@ public:
private:
size_t m_count;
const db::Box *mp_tile;
bool m_healing;
HealingCountingReceiver *mp_receiver;
};
class CountingReceiver
HealingCountingReceiver::HealingCountingReceiver (size_t *count, bool healing)
: mp_count (count), m_healing (healing)
{
// .. nothing yet ..
}
void
HealingCountingReceiver::put (size_t /*ix*/, size_t /*iy*/, const db::Box &tile, size_t /*id*/, const tl::Variant &obj, double /*dbu*/, const db::ICplxTrans & /*trans*/, bool clip)
{
HealingCountingInserter inserter (tile, m_healing, this);
db::insert_var (inserter, obj, tile, clip);
*mp_count += inserter.count ();
}
void
HealingCountingReceiver::keep_for_healing (const db::Polygon &poly)
{
m_for_healing.insert (poly);
}
void
HealingCountingReceiver::finish (bool)
{
if (m_healing) {
*mp_count += m_for_healing.merged ().count ();
}
}
// ---------------------------------------------------------------------
class HealingTileLayoutOutputReceiver
: public db::TileOutputReceiver
{
public:
CountingReceiver (size_t *count)
: mp_count (count)
HealingTileLayoutOutputReceiver (db::Layout *layout, db::Cell *cell, unsigned int layer, bool healing);
void put (size_t /*ix*/, size_t /*iy*/, const db::Box &tile, size_t /*id*/, const tl::Variant &obj, double dbu, const db::ICplxTrans &trans, bool clip);
void begin (size_t /*nx*/, size_t /*ny*/, const db::DPoint & /*p0*/, double /*dx*/, double /*dy*/, const db::DBox & /*frame*/);
void finish (bool /*success*/);
void keep_for_healing (const db::Polygon &poly);
void output (const db::Polygon &poly);
private:
db::Layout *mp_layout;
db::Cell *mp_cell;
unsigned int m_layer;
db::Region m_for_healing;
bool m_healing;
tl::Mutex m_mutex;
};
class HealingTileLayoutOutputInserter
{
public:
HealingTileLayoutOutputInserter (const db::Box &tile, bool healing, const db::ICplxTrans &trans, HealingTileLayoutOutputReceiver *rec)
: mp_tile (&tile), m_healing (healing), mp_trans (&trans), mp_receiver (rec)
{
// .. nothing yet ..
}
virtual void put (size_t /*ix*/, size_t /*iy*/, const db::Box &tile, size_t /*id*/, const tl::Variant &obj, double /*dbu*/, const db::ICplxTrans & /*trans*/, bool clip)
template <class T>
void operator() (const T & /*t*/)
{
CountingInserter inserter;
db::insert_var (inserter, obj, tile, clip);
*mp_count += inserter.count ();
// .. ignore other shapes
}
void operator() (const db::Polygon &poly)
{
if (m_healing && ! poly.box ().inside (mp_tile->enlarged (db::Vector (-1, -1)))) {
mp_receiver->keep_for_healing (*mp_trans * poly);
} else {
mp_receiver->output (*mp_trans * poly);
}
}
private:
size_t *mp_count;
const db::Box *mp_tile;
bool m_healing;
const db::ICplxTrans *mp_trans;
HealingTileLayoutOutputReceiver *mp_receiver;
};
HealingTileLayoutOutputReceiver::HealingTileLayoutOutputReceiver (db::Layout *layout, db::Cell *cell, unsigned int layer, bool healing)
: mp_layout (layout), mp_cell (cell), m_layer (layer), m_healing (healing)
{
// .. nothing yet ..
}
void
HealingTileLayoutOutputReceiver::put (size_t /*ix*/, size_t /*iy*/, const db::Box &tile, size_t /*id*/, const tl::Variant &obj, double dbu, const db::ICplxTrans &trans, bool clip)
{
db::ICplxTrans tr (db::ICplxTrans (dbu / mp_layout->dbu ()) * trans);
HealingTileLayoutOutputInserter inserter (tile, m_healing, tr, this);
db::insert_var (inserter, obj, tile, clip);
}
void
HealingTileLayoutOutputReceiver::begin (size_t /*nx*/, size_t /*ny*/, const db::DPoint & /*p0*/, double /*dx*/, double /*dy*/, const db::DBox & /*frame*/)
{
mp_layout->start_changes ();
}
void
HealingTileLayoutOutputReceiver::finish (bool /*success*/)
{
// heal the polygons
m_for_healing.merge ();
m_for_healing.insert_into (mp_layout, mp_cell->cell_index (), m_layer);
m_for_healing.clear ();
mp_layout->end_changes ();
}
void
HealingTileLayoutOutputReceiver::keep_for_healing (const db::Polygon &poly)
{
m_for_healing.insert (poly);
}
void
HealingTileLayoutOutputReceiver::output (const db::Polygon &poly)
{
mp_cell->shapes (m_layer).insert (poly);
}
// ---------------------------------------------------------------------
struct ResultDescriptor
{
ResultDescriptor ()
@ -119,6 +262,8 @@ struct ResultDescriptor
}
};
// ---------------------------------------------------------------------
struct XORData
{
XORData ()
@ -126,7 +271,8 @@ struct XORData
tolerance_bump (0),
dont_summarize_missing_layers (false), silent (false), no_summary (false),
threads (0),
tile_size (0.0), output_layout (0), output_cell (0)
tile_size (0.0), heal_results (false),
output_layout (0), output_cell (0)
{ }
db::Layout *layout_a, *layout_b;
@ -138,12 +284,17 @@ struct XORData
bool no_summary;
int threads;
double tile_size;
bool heal_results;
db::Layout *output_layout;
db::cell_index_type output_cell;
std::map<db::LayerProperties, std::pair<int, int>, db::LPLogicalLessFunc> l2l_map;
std::map<std::pair<int, db::LayerProperties>, ResultDescriptor> *results;
};
}
// ---------------------------------------------------------------------
static bool run_tiled_xor (const XORData &xor_data);
static bool run_deep_xor (const XORData &xor_data);
@ -171,11 +322,15 @@ BD_PUBLIC int strmxor (int argc, char *argv[])
int tolerance_bump = 10000;
int threads = 1;
double tile_size = 0.0;
bool heal_results = false;
tl::CommandLineOptions cmd;
generic_reader_options_a.add_options (cmd);
generic_reader_options_b.add_options (cmd);
bd::GenericWriterOptions writer_options;
writer_options.add_options (cmd);
cmd << tl::arg ("input_a", &infile_a, "The first input file (any format, may be gzip compressed)")
<< tl::arg ("input_b", &infile_b, "The second input file (any format, may be gzip compressed)")
<< tl::arg ("?output", &output, "The output file to which the XOR differences are written",
@ -219,6 +374,10 @@ BD_PUBLIC int strmxor (int argc, char *argv[])
"In tiling mode, the layout is divided into tiles of the given size. Each tile is computed "
"individually. Multiple tiles can be processed in parallel on multiple cores."
)
<< tl::arg ("-m|--heal", &heal_results, "Heal results in tiling mode",
"This options runs a post-XOR merge to remove cuts implied by the tile formation. The resulting "
"feature count is closer to the real number of differences."
)
<< tl::arg ("-b|--layer-bump=offset", &tolerance_bump, "Specifies the layer number offset to add for every tolerance",
"This value is the number added to the original layer number to form a layer set for each tolerance "
"value. If this value is set to 1000, the first tolerance value will produce XOR results on the "
@ -253,10 +412,7 @@ BD_PUBLIC int strmxor (int argc, char *argv[])
db::LoadLayoutOptions load_options;
generic_reader_options_a.configure (load_options);
tl::InputStream stream (infile_a);
db::Reader reader (stream);
reader.read (layout_a, load_options);
bd::read_files (layout_a, infile_a, load_options);
}
{
@ -264,10 +420,7 @@ BD_PUBLIC int strmxor (int argc, char *argv[])
db::LoadLayoutOptions load_options;
generic_reader_options_b.configure (load_options);
tl::InputStream stream (infile_b);
db::Reader reader (stream);
reader.read (layout_b, load_options);
bd::read_files (layout_b, infile_b, load_options);
}
if (top_a.empty ()) {
@ -335,6 +488,7 @@ BD_PUBLIC int strmxor (int argc, char *argv[])
xor_data.no_summary = no_summary;
xor_data.threads = threads;
xor_data.tile_size = tile_size;
xor_data.heal_results = heal_results;
xor_data.output_layout = output_layout.get ();
xor_data.output_cell = output_top;
xor_data.l2l_map = l2l_map;
@ -356,6 +510,7 @@ BD_PUBLIC int strmxor (int argc, char *argv[])
db::SaveLayoutOptions save_options;
save_options.set_format_from_filename (output);
writer_options.configure (save_options, *output_layout);
tl::OutputStream stream (output);
db::Writer writer (save_options);
@ -413,7 +568,6 @@ BD_PUBLIC int strmxor (int argc, char *argv[])
return result ? 0 : 1;
}
bool run_tiled_xor (const XORData &xor_data)
{
db::TilingProcessor proc;
@ -422,6 +576,7 @@ bool run_tiled_xor (const XORData &xor_data)
if (xor_data.tile_size > db::epsilon) {
if (tl::verbosity () >= 20) {
tl::log << "Tile size: " << xor_data.tile_size;
tl::log << "Healing: " << (xor_data.heal_results ? "on" : "off");
}
proc.tile_size (xor_data.tile_size, xor_data.tile_size);
}
@ -445,8 +600,6 @@ bool run_tiled_xor (const XORData &xor_data)
int index = 1;
std::list<tl::shared_ptr<CountingReceiver> > counters;
for (std::map<db::LayerProperties, std::pair<int, int> >::const_iterator ll = xor_data.l2l_map.begin (); ll != xor_data.l2l_map.end (); ++ll) {
if ((ll->second.first < 0 || ll->second.second < 0) && ! xor_data.dont_summarize_missing_layers) {
@ -509,10 +662,10 @@ bool run_tiled_xor (const XORData &xor_data)
if (result.layout) {
result.layer_output = result.layout->insert_layer (lp);
proc.output (out, *result.layout, result.top_cell, result.layer_output);
HealingTileLayoutOutputReceiver *receiver = new HealingTileLayoutOutputReceiver (result.layout, &result.layout->cell (result.top_cell), result.layer_output, xor_data.heal_results);
proc.output (out, 0, receiver, db::ICplxTrans ());
} else {
CountingReceiver *counter = new CountingReceiver (&result.shape_count);
counters.push_back (tl::shared_ptr<CountingReceiver> (counter));
HealingCountingReceiver *counter = new HealingCountingReceiver (&result.shape_count, xor_data.heal_results);
proc.output (out, 0, counter, db::ICplxTrans ());
}

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -393,6 +393,105 @@ TEST(3_Flat)
);
}
TEST(3_FlatCount)
{
tl::CaptureChannel cap;
std::string input_a = tl::testdata ();
input_a += "/bd/strmxor_in1.gds";
std::string input_b = tl::testdata ();
input_b += "/bd/strmxor_in2.gds";
std::string au = tl::testdata ();
au += "/bd/strmxor_au3.oas";
std::string output = this->tmp_file ("tmp.oas");
const char *argv[] = { "x", "-p=1.0", "-n=4", input_a.c_str (), input_b.c_str () };
EXPECT_EQ (strmxor (sizeof (argv) / sizeof (argv[0]), (char **) argv), 1);
EXPECT_EQ (cap.captured_text (),
"Layer 10/0 is not present in first layout, but in second\n"
"Result summary (layers without differences are not shown):\n"
"\n"
" Layer Output Differences (shape count)\n"
" -------------------------------------------------------\n"
" 3/0 - 31\n"
" 6/0 - 217\n"
" 8/1 - 168\n"
" 10/0 - (no such layer in first layout)\n"
"\n"
);
}
TEST(3_FlatHeal)
{
tl::CaptureChannel cap;
std::string input_a = tl::testdata ();
input_a += "/bd/strmxor_in1.gds";
std::string input_b = tl::testdata ();
input_b += "/bd/strmxor_in2.gds";
std::string au = tl::testdata ();
au += "/bd/strmxor_au3_heal.oas";
std::string output = this->tmp_file ("tmp.oas");
const char *argv[] = { "x", "--heal", "--no-summary", "-p=1.0", "-n=4", input_a.c_str (), input_b.c_str (), output.c_str () };
EXPECT_EQ (strmxor (sizeof (argv) / sizeof (argv[0]), (char **) argv), 1);
db::Layout layout;
{
tl::InputStream stream (output);
db::Reader reader (stream);
reader.read (layout);
}
db::compare_layouts (this, layout, au, db::NoNormalization);
EXPECT_EQ (cap.captured_text (),
"Layer 10/0 is not present in first layout, but in second\n"
);
}
TEST(3_FlatCountHeal)
{
tl::CaptureChannel cap;
std::string input_a = tl::testdata ();
input_a += "/bd/strmxor_in1.gds";
std::string input_b = tl::testdata ();
input_b += "/bd/strmxor_in2.gds";
std::string au = tl::testdata ();
au += "/bd/strmxor_au3.oas";
std::string output = this->tmp_file ("tmp.oas");
const char *argv[] = { "x", "-m", "-p=1.0", "-n=4", input_a.c_str (), input_b.c_str () };
EXPECT_EQ (strmxor (sizeof (argv) / sizeof (argv[0]), (char **) argv), 1);
EXPECT_EQ (cap.captured_text (),
"Layer 10/0 is not present in first layout, but in second\n"
"Result summary (layers without differences are not shown):\n"
"\n"
" Layer Output Differences (shape count)\n"
" -------------------------------------------------------\n"
" 3/0 - 30\n"
" 6/0 - 41\n"
" 8/1 - 1\n"
" 10/0 - (no such layer in first layout)\n"
"\n"
);
}
TEST(3_Deep)
{
tl::CaptureChannel cap;
@ -460,6 +559,39 @@ TEST(4_Flat)
);
}
TEST(4_FlatHeal)
{
tl::CaptureChannel cap;
std::string input_a = tl::testdata ();
input_a += "/bd/strmxor_in1.gds";
std::string input_b = tl::testdata ();
input_b += "/bd/strmxor_in2.gds";
std::string au = tl::testdata ();
au += "/bd/strmxor_au4_heal.oas";
std::string output = this->tmp_file ("tmp.oas");
const char *argv[] = { "x", "--heal", "--no-summary", "-p=1.0", "-n=4", "-t=0.0,0.005,0.01,0.02,0.09,0.1", input_a.c_str (), input_b.c_str (), output.c_str () };
EXPECT_EQ (strmxor (sizeof (argv) / sizeof (argv[0]), (char **) argv), 1);
db::Layout layout;
{
tl::InputStream stream (output);
db::Reader reader (stream);
reader.read (layout);
}
db::compare_layouts (this, layout, au, db::NoNormalization);
EXPECT_EQ (cap.captured_text (),
"Layer 10/0 is not present in first layout, but in second\n"
);
}
TEST(4_Deep)
{
tl::CaptureChannel cap;

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -204,7 +204,6 @@ SOURCES = \
gsiDeclDbNetlistCrossReference.cc \
gsiDeclDbLayoutVsSchematic.cc \
dbNetlistObject.cc \
dbD25TechnologyComponent.cc \
gsiDeclDbTexts.cc \
dbTexts.cc \
dbDeepTexts.cc \
@ -381,7 +380,6 @@ HEADERS = \
dbLayoutVsSchematicFormatDefs.h \
dbLayoutVsSchematic.h \
dbNetlistObject.h \
dbD25TechnologyComponent.h \
dbTexts.h \
dbDeepTexts.h \
dbAsIfFlatTexts.h \

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -306,7 +306,8 @@ Cell::update_bbox (unsigned int layers)
// update the bboxes of the shapes lists
for (shapes_map::iterator s = m_shapes_map.begin (); s != m_shapes_map.end (); ++s) {
s->second.update_bbox ();
s->second.reset_bbox_dirty ();
box_type sbox (s->second.bbox ());
if (! sbox.empty ()) {

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -65,7 +65,7 @@ class LayerMapping;
* a set of child cell instances and auxiliary information such as
* the parent instance list.
* A cell is identified through an index given to the cell upon instantiation.
* The cell index is valid in the context of a cell graph object which
* The cell index is valid in the context of a layout object which
* must issue the cell index.
*/
@ -483,7 +483,7 @@ public:
bool is_shape_bbox_dirty () const;
/**
* @brief Update the bbox
* @brief Updates the bbox
*
* This will update the bbox from the shapes and instances.
* This requires the bboxes of the child cells to be computed
@ -496,8 +496,9 @@ public:
* @return true, if the bounding box has changed.
*/
bool update_bbox (unsigned int layers);
/**
* @brief Sort the shapes lists
* @brief Sorts the shapes lists
*
* This will sort the shapes lists for query of regions
* on a per-shape basis. Since sorting of the shapes is
@ -511,7 +512,7 @@ public:
*
* Before the bounding box can be retrieved, it must have
* been computed using update_bbox. This is performed by
* requesting an update from the graph.
* requesting an update from the layout.
*
* @return The bounding box that was computed by update_bbox
*/
@ -522,7 +523,7 @@ public:
*
* Before the bounding box can be retrieved, it must have
* been computed using update_bbox. This is performed by
* requesting an update from the graph.
* requesting an update from the layout.
*
* @return The bounding box that was computed by update_bbox
*/
@ -1026,10 +1027,10 @@ protected:
/**
* @brief Standard constructor: create an empty cell object
*
* Takes the manager object from the graph object.
* Takes the manager object from the layout object.
*
* @param ci The index of the cell
* @param g A reference to the graph object that owns the cell
* @param g A reference to the layout object that owns the cell
*/
Cell (cell_index_type ci, db::Layout &g);
@ -1065,7 +1066,7 @@ private:
// linked list, used by Layout
Cell *mp_last, *mp_next;
// clear the shapes without telling the graph
// clear the shapes without telling the layout
void clear_shapes_no_invalidate ();
// helper function for computing the number of hierarchy levels

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2021 Matthias Koefferlein
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

Some files were not shown because too many files have changed in this diff Show More