Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/drc/drc/built-in-macros/_drc_engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,14 @@ def cell(*args)
# @brief Specifies cell filters on the default source
# @synopsis select(args)
# See \Source#select for a description of that function.
# Using the global version does not create a new source, but
# modifies the default source.
#
# @code
# # Selects only B cell instances below the top cell
# select("-", "+B*")
# l1 = input(1, 0)
# @/code

def select(*args)
self._context("select") do
Expand Down
18 changes: 10 additions & 8 deletions src/drc/drc/built-in-macros/_drc_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,11 @@ def inplace_select(*args)
# %DRC%
# @name select
# @brief Adds cell name expressions to the cell filters
# @synopsis source.select(filter1, filter2, ...)
# @synopsis new_source = source.select(filter1, filter2, ...)
# This method will construct a new source object with the given cell filters
# applied.
# applied. Note that there is a global version of "select" which does not
# create a new source, but acts on the default source.
#
# Cell filters will enable or disable cells plus their subtree.
# Cells can be switched on and off, which makes the hierarchy traversal
# stop or begin delivering shapes at the given cell. The arguments of
Expand All @@ -184,8 +186,8 @@ def inplace_select(*args)
# code:
#
# @code
# layout_with_selection = source.select("-TOP", "+B")
# l1 = source.input(1, 0)
# source_with_selection = source.select("-TOP", "+B")
# l1 = source_with_selection.input(1, 0)
# ...
# @/code
#
Expand All @@ -201,17 +203,17 @@ def inplace_select(*args)
# first "-*" selection, all cells including the children of "B" are disabled:
#
# @code
# layout_with_selection = source.select("-*", "+B")
# l1 = source.input(1, 0)
# source_with_selection = source.select("-*", "+B")
# l1 = source_with_selection.input(1, 0)
# ...
# @/code
#
# The short form "-" will disable the top cell. This code is identical to the first example
# and will start with a disabled top cell regardless of its name:
#
# @code
# layout_with_selection = source.select("-", "+B")
# l1 = source.input(1, 0)
# source_with_selection = source.select("-", "+B")
# l1 = source_with_selection.input(1, 0)
# ...
# @/code

Expand Down
8 changes: 8 additions & 0 deletions src/lay/lay/doc/about/drc_ref_global.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1597,6 +1597,14 @@ out = l1.drc(primary & secondary(l2))
</ul>
<p>
See <a href="/about/drc_ref_source.xml#select">Source#select</a> for a description of that function.
Using the global version does not create a new source, but
modifies the default source.
</p><p>
<pre>
# Selects only B cell instances below the top cell
select("-", "+B*")
l1 = input(1, 0)
</pre>
</p>
<a name="sep"/><h2>"sep" - Synonym for "separation"</h2>
<keyword name="sep"/>
Expand Down
18 changes: 10 additions & 8 deletions src/lay/lay/doc/about/drc_ref_source.xml
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,13 @@ Use the global version of "polygons" without a source object to address the defa
<keyword name="select"/>
<p>Usage:</p>
<ul>
<li><tt>source.select(filter1, filter2, ...)</tt></li>
<li><tt>new_source = source.select(filter1, filter2, ...)</tt></li>
</ul>
<p>
This method will construct a new source object with the given cell filters
applied.
applied. Note that there is a global version of "select" which does not
create a new source, but acts on the default source.
</p><p>
Cell filters will enable or disable cells plus their subtree.
Cells can be switched on and off, which makes the hierarchy traversal
stop or begin delivering shapes at the given cell. The arguments of
Expand All @@ -345,8 +347,8 @@ To disable the TOP cell but enabled a hypothetical cell B below the top cell, us
code:
</p><p>
<pre>
layout_with_selection = source.select("-TOP", "+B")
l1 = source.input(1, 0)
source_with_selection = source.select("-TOP", "+B")
l1 = source_with_selection.input(1, 0)
...
</pre>
</p><p>
Expand All @@ -362,17 +364,17 @@ The following code will just select "B" without its children, because in the
first "-*" selection, all cells including the children of "B" are disabled:
</p><p>
<pre>
layout_with_selection = source.select("-*", "+B")
l1 = source.input(1, 0)
source_with_selection = source.select("-*", "+B")
l1 = source_with_selection.input(1, 0)
...
</pre>
</p><p>
The short form "-" will disable the top cell. This code is identical to the first example
and will start with a disabled top cell regardless of its name:
</p><p>
<pre>
layout_with_selection = source.select("-", "+B")
l1 = source.input(1, 0)
source_with_selection = source.select("-", "+B")
l1 = source_with_selection.input(1, 0)
...
</pre>
</p>
Expand Down
16 changes: 12 additions & 4 deletions src/layui/layui/layDialogs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ LayerSourceDialog::exec_dialog (std::string &s)
// NewLayoutPropertiesDialog implementation

NewLayoutPropertiesDialog::NewLayoutPropertiesDialog (QWidget *parent)
: QDialog (parent)
: QDialog (parent), m_default_dbu (0.0)
{
setObjectName (QString::fromUtf8 ("new_layout_properties_dialog"));

Expand All @@ -117,14 +117,20 @@ NewLayoutPropertiesDialog::~NewLayoutPropertiesDialog ()
void
NewLayoutPropertiesDialog::tech_changed ()
{
double dbu = 0.001;
double dbu = 0.0;
int technology_index = mp_ui->tech_cbx->currentIndex ();
if (technology_index >= 0 && technology_index < (int) db::Technologies::instance ()->technologies ()) {
dbu = db::Technologies::instance ()->begin () [technology_index].dbu ();
}

m_default_dbu = dbu;

#if QT_VERSION >= 0x40700
mp_ui->dbu_le->setPlaceholderText (tl::to_qstring (tl::to_string (dbu)));
if (dbu > 1e-10) {
mp_ui->dbu_le->setPlaceholderText (tl::to_qstring (tl::to_string (dbu)));
} else {
mp_ui->dbu_le->setPlaceholderText (QString ());
}
#endif
}

Expand All @@ -142,6 +148,8 @@ NewLayoutPropertiesDialog::exec_dialog (std::string &technology, std::string &ce

}

tech_changed ();

mp_ui->window_le->setText (tl::to_qstring (tl::to_string (size)));
if (dbu > 1e-10) {
mp_ui->dbu_le->setText (tl::to_qstring (tl::to_string (dbu)));
Expand Down Expand Up @@ -174,7 +182,7 @@ NewLayoutPropertiesDialog::exec_dialog (std::string &technology, std::string &ce
if (! mp_ui->dbu_le->text ().isEmpty ()) {
tl::from_string_ext (tl::to_string (mp_ui->dbu_le->text ()), dbu);
} else {
dbu = 0.0;
dbu = m_default_dbu;
}

cell_name = tl::to_string (mp_ui->topcell_le->text ());
Expand Down
1 change: 1 addition & 0 deletions src/layui/layui/layDialogs.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ private slots:
virtual void accept ();

Ui::NewLayoutPropertiesDialog *mp_ui;
double m_default_dbu;
};

/**
Expand Down