Merge branch 'master' into network-drc

This commit is contained in:
Matthias Koefferlein 2023-01-13 22:01:51 +01:00
commit 2191db0c6d
16 changed files with 314 additions and 59 deletions

View File

@ -1,3 +1,15 @@
0.28.3 (2023-01-12):
* Bugfix: %GITHUB%/issues/1247 Layer stipples not updated after editing custom stipples with high-DPI displays
* Bugfix: %GITHUB%/issues/1245 Connectivity not preserved when loading/saving technology
* Bugfix: %GITHUB%/issues/1242 KLayout 0.28.2 crashes when registering a plugin if a layout exists
* Bugfix: %GITHUB%/issues/1240 Layer is not activated from layer properties file on first creation
* Bugfix: %GITHUB%/issues/1238 Macro IDE: breakpoints not effective on Windows
* Bugfix: %GITHUB%/issues/1234 "Clone view": layer list is empty
* Enhancement: %GITHUB%/issues/1228 Add option to have Show parameter names on by default
* Enhancement: Improved performance of layer list with many layers
* Bugfix: Restored ability to build with Python 2.7
* Enhancement: Compatibility with Qt 6.4.1
0.28.2 (2022-12-22):
* Bugfix: %GITHUB%/issues/1230 LVS browser crashes

View File

@ -1,3 +1,10 @@
klayout (0.28.3-1) unstable; urgency=low
* New features and bugfixes
- See changelog
-- Matthias Köfferlein <matthias@koefferlein.de> Thu, 12 Jan 2023 07:14:02 +0100
klayout (0.28.2-1) unstable; urgency=low
* New features and bugfixes

View File

@ -291,6 +291,8 @@ public:
gsi::Callback f_tracking_position;
};
static std::map <std::string, PluginFactoryBase *> s_factories;
class PluginFactoryBase
: public lay::PluginDeclaration
{
@ -304,6 +306,13 @@ public:
~PluginFactoryBase ()
{
for (auto f = s_factories.begin (); f != s_factories.end (); ++f) {
if (f->second == this) {
s_factories.erase (f);
break;
}
}
delete mp_registration;
mp_registration = 0;
}
@ -319,7 +328,6 @@ public:
keep ();
// remove an existing factory with the same name
static std::map <std::string, PluginFactoryBase *> s_factories;
std::map <std::string, PluginFactoryBase *>::iterator f = s_factories.find (name);
if (f != s_factories.end ()) {
delete f->second;

View File

@ -462,6 +462,8 @@ static const char *dither_strings [] = {
// ---------------------------------------------------------------------
// DitherPatternInfo implementation
static tl::Mutex s_mutex;
DitherPatternInfo::DitherPatternInfo ()
: m_width (1), m_height (1), m_order_index (0)
{
@ -482,23 +484,31 @@ DitherPatternInfo &
DitherPatternInfo::operator= (const DitherPatternInfo &d)
{
if (&d != this) {
m_order_index = d.m_order_index;
m_name = d.m_name;
m_width = d.m_width;
m_pattern_stride = d.m_pattern_stride;
m_height = d.m_height;
for (size_t i = 0; i < sizeof (m_pattern) / sizeof (m_pattern [0]); ++i) {
m_pattern [i] = &m_buffer [0] + (d.m_pattern [i] - d.m_buffer);
}
memcpy (m_buffer, d.m_buffer, sizeof (m_buffer));
tl::MutexLocker locker (& s_mutex);
assign_no_lock (d);
}
return *this;
}
bool
void
DitherPatternInfo::assign_no_lock (const DitherPatternInfo &d)
{
m_scaled_pattern.reset ();
m_order_index = d.m_order_index;
m_name = d.m_name;
m_width = d.m_width;
m_pattern_stride = d.m_pattern_stride;
m_height = d.m_height;
for (size_t i = 0; i < sizeof (m_pattern) / sizeof (m_pattern [0]); ++i) {
m_pattern [i] = &m_buffer [0] + (d.m_pattern [i] - d.m_buffer);
}
memcpy (m_buffer, d.m_buffer, sizeof (m_buffer));
}
bool
DitherPatternInfo::same_bitmap (const DitherPatternInfo &d) const
{
if (m_width != d.m_width || m_height != d.m_height) {
@ -597,15 +607,11 @@ DitherPatternInfo::get_bitmap (int width, int height, int frame_width) const
#endif
static tl::Mutex s_mutex;
void
DitherPatternInfo::set_pattern (const uint32_t *pt, unsigned int w, unsigned int h)
{
{
tl::MutexLocker locker (& s_mutex);
m_scaled_pattern.reset (0);
}
tl::MutexLocker locker (& s_mutex);
m_scaled_pattern.reset (0);
set_pattern_impl (pt, w, h);
}
@ -669,10 +675,8 @@ DitherPatternInfo::set_pattern_impl (const uint32_t *pt, unsigned int w, unsigne
void
DitherPatternInfo::set_pattern (const uint64_t *pt, unsigned int w, unsigned int h)
{
{
tl::MutexLocker locker (& s_mutex);
m_scaled_pattern.reset (0);
}
tl::MutexLocker locker (& s_mutex);
m_scaled_pattern.reset (0);
set_pattern_impl (pt, w, h);
}
@ -752,7 +756,7 @@ DitherPatternInfo::scaled (unsigned int n) const
}
DitherPatternInfo &sp = (*m_scaled_pattern) [n];
sp = *this;
sp.assign_no_lock (*this);
sp.scale_pattern (n);
return sp;
}

View File

@ -243,6 +243,7 @@ private:
void set_pattern_impl (const uint32_t *pattern, unsigned int w, unsigned int h);
void set_pattern_impl (const uint64_t *pattern, unsigned int w, unsigned int h);
void assign_no_lock (const DitherPatternInfo &other);
};
/**

View File

@ -578,10 +578,11 @@ void LayoutViewBase::drop_url (const std::string &path_or_url)
void LayoutViewBase::clear_plugins ()
{
for (std::vector<lay::Plugin *>::iterator p = mp_plugins.begin (); p != mp_plugins.end (); ++p) {
std::vector<lay::Plugin *> plugins;
mp_plugins.swap (plugins);
for (std::vector<lay::Plugin *>::iterator p = plugins.begin (); p != plugins.end (); ++p) {
delete *p;
}
mp_plugins.clear ();
mp_active_plugin = 0;
}

View File

@ -75,6 +75,8 @@ static const char *style_strings [] = {
// ---------------------------------------------------------------------
// LineStyleInfo implementation
static tl::Mutex s_mutex;
LineStyleInfo::LineStyleInfo ()
: m_width (0), m_order_index (0)
{
@ -92,19 +94,26 @@ LineStyleInfo &
LineStyleInfo::operator= (const LineStyleInfo &d)
{
if (&d != this) {
m_order_index = d.m_order_index;
m_name = d.m_name;
m_width = d.m_width;
m_pattern_stride = d.m_pattern_stride;
memcpy (m_pattern, d.m_pattern, sizeof (m_pattern));
tl::MutexLocker locker (& s_mutex);
assign_no_lock (d);
}
return *this;
}
bool
void
LineStyleInfo::assign_no_lock (const LineStyleInfo &d)
{
m_scaled_pattern.reset (0);
m_order_index = d.m_order_index;
m_name = d.m_name;
m_width = d.m_width;
m_pattern_stride = d.m_pattern_stride;
memcpy (m_pattern, d.m_pattern, sizeof (m_pattern));
}
bool
LineStyleInfo::same_bits (const LineStyleInfo &d) const
{
if (m_width != d.m_width) {
@ -201,15 +210,11 @@ LineStyleInfo::get_bitmap (int width, int height) const
}
#endif
static tl::Mutex s_mutex;
void
LineStyleInfo::set_pattern (uint32_t pt, unsigned int w)
{
{
tl::MutexLocker locker (& s_mutex);
m_scaled_pattern.reset (0);
}
tl::MutexLocker locker (& s_mutex);
m_scaled_pattern.reset (0);
memset (m_pattern, 0, sizeof (m_pattern));
@ -271,7 +276,7 @@ LineStyleInfo::scaled (unsigned int n) const
}
LineStyleInfo &sp = (*m_scaled_pattern) [n];
sp = *this;
sp.assign_no_lock (*this);
sp.scale_pattern (n);
return sp;
}

View File

@ -216,6 +216,8 @@ private:
unsigned int m_order_index;
std::string m_name;
mutable std::unique_ptr<std::map<unsigned int, LineStyleInfo> > m_scaled_pattern;
void assign_no_lock (const LineStyleInfo &other);
};
/**

View File

@ -98,15 +98,23 @@ namespace lay
// LayoutViewWidget implementation
LayoutViewWidget::LayoutViewWidget (db::Manager *mgr, bool editable, lay::Plugin *plugin_parent, QWidget *parent, unsigned int options)
: QFrame (parent)
: QFrame (parent), mp_view (0)
{
mp_view = new LayoutView (mgr, editable, plugin_parent, this, options);
// NOTE: construction the LayoutView may trigger events (script code executed etc.) which must
// not meet an invalid mp_view pointer (e.g. in eventFilter). Hence, mp_view is 0 first, and set only
// after the LayoutView is successfully constructed.
std::unique_ptr<LayoutView> view (new LayoutView (mgr, editable, plugin_parent, this, options));
mp_view = view.release ();
}
LayoutViewWidget::LayoutViewWidget (lay::LayoutView *source, db::Manager *mgr, bool editable, lay::Plugin *plugin_parent, QWidget *parent, unsigned int options)
: QFrame (parent)
: QFrame (parent), mp_view (0)
{
mp_view = new LayoutView (source, mgr, editable, plugin_parent, this, options);
// NOTE: construction the LayoutView may trigger events (script code executed etc.) which must
// not meet an invalid mp_view pointer (e.g. in eventFilter). Hence, mp_view is 0 first, and set only
// after the LayoutView is successfully constructed.
std::unique_ptr<LayoutView> view (new LayoutView (source, mgr, editable, plugin_parent, this, options));
mp_view = view.release ();
}
LayoutViewWidget::~LayoutViewWidget ()

View File

@ -498,6 +498,7 @@ NetTracerTechnologyComponent::NetTracerTechnologyComponent ()
// NetTracerConnectivity implementation
NetTracerConnectivity::NetTracerConnectivity ()
: m_is_fallback_default (false)
{
// .. nothing yet ..
}
@ -510,6 +511,7 @@ NetTracerConnectivity::NetTracerConnectivity (const NetTracerConnectivity &d)
NetTracerConnectivity &NetTracerConnectivity::operator= (const NetTracerConnectivity &d)
{
if (this != &d) {
m_is_fallback_default = d.m_is_fallback_default;
m_connections = d.m_connections;
m_symbols = d.m_symbols;
m_name = d.m_name;

View File

@ -369,6 +369,16 @@ public:
NetTracerConnectivity (const NetTracerConnectivity &d);
NetTracerConnectivity &operator= (const NetTracerConnectivity &d);
bool is_fallback_default () const
{
return m_is_fallback_default;
}
void set_fallback_default (bool f)
{
m_is_fallback_default = f;
}
const std::string &name () const
{
return m_name;
@ -491,6 +501,7 @@ private:
std::vector<NetTracerConnectionInfo> m_connections;
std::vector<NetTracerSymbolInfo> m_symbols;
std::string m_name, m_description;
bool m_is_fallback_default;
};
class DB_PLUGIN_PUBLIC NetTracerTechnologyComponent

View File

@ -68,6 +68,18 @@ namespace tl
namespace
{
static const db::NetTracerConnectivity *
get_fallback_default (const db::NetTracerTechnologyComponent &tc)
{
for (auto d = tc.begin (); d != tc.end (); ++d) {
if (d->is_fallback_default ()) {
return d.operator-> ();
}
}
return 0;
}
static const db::NetTracerConnectivity *
get_default (const db::NetTracerTechnologyComponent &tc)
{
@ -88,28 +100,29 @@ get_default (const db::NetTracerTechnologyComponent &tc)
template <class Value>
struct FallbackXMLWriteAdaptor
{
FallbackXMLWriteAdaptor (void (db::NetTracerConnectivity::*member) (const Value &), void (db::NetTracerConnectivity::*clear) ())
: mp_member (member), mp_clear (clear)
FallbackXMLWriteAdaptor (void (db::NetTracerConnectivity::*member) (const Value &))
: mp_member (member)
{
// .. nothing yet ..
}
void operator () (db::NetTracerTechnologyComponent &owner, tl::XMLReaderState &reader) const
{
db::NetTracerConnectivity *stack = const_cast<db::NetTracerConnectivity *> (get_default (owner));
if (! stack) {
db::NetTracerConnectivity *stack = const_cast<db::NetTracerConnectivity *> (get_fallback_default (owner));
if (! stack && owner.begin () == owner.end ()) {
owner.push_back (db::NetTracerConnectivity ());
stack = (owner.end () - 1).operator-> ();
stack->set_fallback_default (true);
}
(stack->*mp_clear) ();
tl::XMLObjTag<Value> tag;
(stack->*mp_member) (*reader.back (tag));
if (stack) {
tl::XMLObjTag<Value> tag;
(stack->*mp_member) (*reader.back (tag));
}
}
private:
void (db::NetTracerConnectivity::*mp_member) (const Value &);
void (db::NetTracerConnectivity::*mp_clear) ();
};
template <class Value, class Iter>
@ -184,10 +197,10 @@ public:
// Fallback readers for migrating pre-0.28 setups to 0.28 and backward compatibility
tl::XMLMember<NetTracerConnectionInfo, NetTracerTechnologyComponent, FallbackXMLReadAdaptor <NetTracerConnectionInfo, NetTracerConnectivity::const_iterator>, FallbackXMLWriteAdaptor <NetTracerConnectionInfo>, tl::XMLStdConverter <NetTracerConnectionInfo> > (
FallbackXMLReadAdaptor <NetTracerConnectionInfo, NetTracerConnectivity::const_iterator> (&NetTracerConnectivity::begin, &NetTracerConnectivity::end),
FallbackXMLWriteAdaptor <NetTracerConnectionInfo> (&NetTracerConnectivity::add, &NetTracerConnectivity::clear_connections), "connection") +
FallbackXMLWriteAdaptor <NetTracerConnectionInfo> (&NetTracerConnectivity::add), "connection") +
tl::XMLMember<NetTracerSymbolInfo, NetTracerTechnologyComponent, FallbackXMLReadAdaptor <NetTracerSymbolInfo, NetTracerConnectivity::const_symbol_iterator>, FallbackXMLWriteAdaptor <NetTracerSymbolInfo>, tl::XMLStdConverter <NetTracerSymbolInfo> > (
FallbackXMLReadAdaptor <NetTracerSymbolInfo, NetTracerConnectivity::const_symbol_iterator> (&NetTracerConnectivity::begin_symbols, &NetTracerConnectivity::end_symbols),
FallbackXMLWriteAdaptor <NetTracerSymbolInfo> (&NetTracerConnectivity::add_symbol, &NetTracerConnectivity::clear_symbols), "symbols")
FallbackXMLWriteAdaptor <NetTracerSymbolInfo> (&NetTracerConnectivity::add_symbol), "symbols")
);
}
};

View File

@ -52,6 +52,41 @@ static void def_symbol (db::NetTracerConnectivity *tech, const std::string &name
tech->add_symbol (db::NetTracerSymbolInfo (db::LayerProperties (name), expr));
}
static std::string get_layer_a (const db::NetTracerConnectionInfo *info)
{
return info->layer_a ().to_string ();
}
static std::string get_via_layer (const db::NetTracerConnectionInfo *info)
{
return info->via_layer ().to_string ();
}
static std::string get_layer_b (const db::NetTracerConnectionInfo *info)
{
return info->layer_b ().to_string ();
}
gsi::Class<db::NetTracerConnectionInfo> decl_NetTracerConnectionInfo ("db", "NetTracerConnectionInfo",
gsi::method_ext ("layer_a", &get_layer_a, "@brief Gets the expression for the A layer") +
gsi::method_ext ("via_layer", &get_via_layer, "@brief Gets the expression for the Via layer") +
gsi::method_ext ("layer_b", &get_layer_b, "@brief Gets the expression for the B layer"),
"@brief Represents a single connection info line for the net tracer technology definition\n"
"This class has been introduced in version 0.28.3."
);
static std::string get_symbol (const db::NetTracerSymbolInfo *info)
{
return info->symbol ().to_string ();
}
gsi::Class<db::NetTracerSymbolInfo> decl_NetTracerSymbolInfo ("db", "NetTracerSymbolInfo",
gsi::method_ext ("symbol", &get_symbol, "@brief Gets the symbol") +
gsi::method ("expression", &db::NetTracerSymbolInfo::expression, "@brief Gets the expression"),
"@brief Represents a single symbol info line for the net tracer technology definition\n"
"This class has been introduced in version 0.28.3."
);
gsi::Class<db::NetTracerConnectivity> decl_NetTracerConnectivity ("db", "NetTracerConnectivity",
gsi::method ("name", &db::NetTracerConnectivity::name,
"@brief Gets the name of the connectivty definition\n"
@ -79,6 +114,14 @@ gsi::Class<db::NetTracerConnectivity> decl_NetTracerConnectivity ("db", "NetTrac
"@brief Defines a symbol for use in the material expressions.\n"
"Defines a sub-expression to be used in further symbols or material expressions. "
"For the detailed notation of the expression see the description of the net tracer feature."
) +
gsi::iterator ("each_connection", static_cast<db::NetTracerConnectivity::const_iterator (db::NetTracerConnectivity::*) () const> (&db::NetTracerConnectivity::begin), static_cast<db::NetTracerConnectivity::const_iterator (db::NetTracerConnectivity::*) () const> (&db::NetTracerConnectivity::end),
"@brief Gets the connection information.\n"
"This iterator method has been introduced in version 0.28.3.\n"
) +
gsi::iterator ("each_symbol", static_cast<db::NetTracerConnectivity::const_symbol_iterator (db::NetTracerConnectivity::*) () const> (&db::NetTracerConnectivity::begin_symbols), static_cast<db::NetTracerConnectivity::const_symbol_iterator (db::NetTracerConnectivity::*) () const> (&db::NetTracerConnectivity::end_symbols),
"@brief Gets the symbol information.\n"
"This iterator method has been introduced in version 0.28.3.\n"
),
"@brief A connectivity description for the net tracer\n"
"\n"
@ -99,6 +142,18 @@ gsi::Class<db::NetTracerConnectivity> decl_NetTracerConnectivity ("db", "NetTrac
"has been generalized.\n"
);
DB_PUBLIC gsi::Class<db::TechnologyComponent> &decl_dbTechnologyComponent ();
gsi::Class<db::NetTracerTechnologyComponent> decl_NetTracerTechnologyComponent (decl_dbTechnologyComponent (), "db", "NetTracerTechnologyComponent",
gsi::iterator ("each", static_cast<db::NetTracerTechnologyComponent::const_iterator (db::NetTracerTechnologyComponent::*) () const> (&db::NetTracerTechnologyComponent::begin), static_cast<db::NetTracerTechnologyComponent::const_iterator (db::NetTracerTechnologyComponent::*) () const> (&db::NetTracerTechnologyComponent::end),
"@brief Gets the connectivity definitions from the net tracer technology component.\n"
),
"@brief Represents the technology information for the net tracer.\n"
"This class has been redefined in version 0.28 and re-introduced in version 0.28.3. Since version 0.28, "
"multiple stacks are supported and the individual stack definition is provided through a list of stacks. Use \\each "
"to iterate the stacks."
);
static void trace1 (db::NetTracer *net_tracer, const db::NetTracerConnectivity &tech, const db::Layout &layout, const db::Cell &cell, const db::Point &start_point, unsigned int start_layer)
{
db::NetTracerData tracer_data = tech.get_tracer_data (layout);

View File

@ -498,6 +498,43 @@ class LAYLayoutView_TestClass < TestBase
end
class DummyPlugin < RBA::Plugin
def initialize(manager, view)
self.manager = manager
self.view = view
end
end
class DummyPluginFactory < RBA::PluginFactory
def initialize()
register(1000, "dummy_plugin", "Dummy Plugin")
end
def create_plugin(manager, unused, view)
DummyPlugin::new(manager, view)
end
end
# issue-1242
def test_6
if !RBA.constants.member?(:MainWindow)
return
end
# Create a new layout
main_window = RBA::MainWindow.instance()
main_window.close_all
main_window.create_layout(2)
# Register plugin -> crashes in issue-1242
dpi = DummyPluginFactory::new
main_window.close_all
dpi._destroy
end
end
load("test_epilogue.rb")

View File

@ -23,6 +23,14 @@ end
load("test_prologue.rb")
def nt_tech_to_s(t)
t.each.collect do |s|
([ "Stack [" + s.name + "]:" ] +
s.each_connection.collect { |c| " conn: " + c.layer_a + "," + c.via_layer + "," + c.layer_b } +
s.each_symbol.collect { |c| " symbol: " + c.symbol + "=" + c.expression }).join("\n")
end.join("\n") + "\n"
end
class LAYTechnologies_TestClass < TestBase
def test_1
@ -117,7 +125,88 @@ END
assert_equal(tech.component_names.size > 0, true)
assert_equal(tech.component_names.find("connectivity") != nil, true)
assert_equal(tech.component("connectivity").class.to_s, "RBA::TechnologyComponent")
assert_equal(tech.component("connectivity").class.to_s, "RBA::NetTracerTechnologyComponent")
end
# issue 1245
def test_3
# empty connectivity
tech = RBA::Technology::technology_from_xml(<<END)
<technology>
<name>X</name>
<connectivity/>
</technology>
END
nt_tech = tech.component("connectivity")
assert_equal(nt_tech_to_s(nt_tech), "\n")
# 0.27 to 0.28 migration
tech = RBA::Technology::technology_from_xml(<<END)
<technology>
<name>X</name>
<connectivity>
<connection>11,2,3</connection>
<connection>14,5,6</connection>
<symbols>AA=17</symbols>
<symbols>BB=42</symbols>
</connectivity>
</technology>
END
nt_tech = tech.component("connectivity")
assert_equal(nt_tech_to_s(nt_tech), <<END)
Stack []:
conn: 11,2,3
conn: 14,5,6
symbol: AA=17
symbol: BB=42
END
# 0.28 way
tech = RBA::Technology::technology_from_xml(<<END)
<technology>
<name>X</name>
<connectivity>
<stack>
<name>ST1</name>
<connection>1,2,3</connection>
<connection>4,5,6</connection>
<symbols>A=17</symbols>
<symbols>B=42</symbols>
</stack>
<stack>
<name>ST2</name>
<connection>1,2,3</connection>
<connection>4,5,7</connection>
<symbols>A=1</symbols>
</stack>
<!-- ignored: -->
<connection>1,2,3</connection>
<connection>4,5,6</connection>
<symbols>AA=17</symbols>
<symbols>BB=42</symbols>
</connectivity>
</technology>
END
nt_tech = tech.component("connectivity")
assert_equal(nt_tech_to_s(nt_tech), <<END)
Stack [ST1]:
conn: 1,2,3
conn: 4,5,6
symbol: A=17
symbol: B=42
Stack [ST2]:
conn: 1,2,3
conn: 4,5,7
symbol: A=1
END
end

View File

@ -2,10 +2,10 @@
# This script is sourced to define the main version parameters
# The main version
KLAYOUT_VERSION="0.28.2"
KLAYOUT_VERSION="0.28.3"
# The version used for PyPI (don't use variables here!)
KLAYOUT_PYPI_VERSION="0.28.2"
KLAYOUT_PYPI_VERSION="0.28.3"
# The build date
KLAYOUT_VERSION_DATE=$(date "+%Y-%m-%d")