Skip to content
Open
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
10 changes: 10 additions & 0 deletions src/buddies/src/bd/bdWriterOptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ GenericWriterOptions::init_from_options (const db::SaveLayoutOptions &save_optio
m_gds2_write_file_properties = save_options.get_option_by_name ("gds2_write_file_properties").to_bool ();
tl::Variant def_text_size = save_options.get_option_by_name ("gds2_default_text_size");
m_gds2_default_text_size = def_text_size.is_nil () ? -1.0 : def_text_size.to_double ();
m_gds2_extended_features = save_options.get_option_by_name ("gds2_extended_features").to_bool ();

m_oasis_compression_level = save_options.get_option_by_name ("oasis_compression_level").to_int ();
m_oasis_write_cblocks = save_options.get_option_by_name ("oasis_write_cblocks").to_bool ();
Expand Down Expand Up @@ -245,6 +246,14 @@ GenericWriterOptions::add_options (tl::CommandLineOptions &cmd, const std::strin
"This option enables a GDS2 extension that allows writing of file properties to GDS2 files. "
"Consumers that don't support this feature, may not be able to read such a GDS2 files."
)
<< tl::arg (group +
"!#--no-extended-features", &m_gds2_extended_features, "Disables extended GDS2 features",
"This option disables extended GDS2 features. Extended GDS features allow writing file and cell level "
"properties without 'write-cell-properties' or 'write-file-properties', store layer names and allow "
"string names for properties and complex property values such as very long strings or lists.\n"
"\n"
"Extended features rely on the context, so they are not available with 'no-context-info'."
)
<< tl::arg (group +
"#--default-text-size", &m_gds2_default_text_size, "Default text size",
"This text size (given in micrometers) is applied to text objects not coming with their "
Expand Down Expand Up @@ -474,6 +483,7 @@ GenericWriterOptions::configure (db::SaveLayoutOptions &save_options, const db::
save_options.set_option_by_name ("gds2_write_timestamps", m_gds2_write_timestamps);
save_options.set_option_by_name ("gds2_write_cell_properties", m_gds2_write_cell_properties);
save_options.set_option_by_name ("gds2_write_file_properties", m_gds2_write_file_properties);
save_options.set_option_by_name ("gds2_extended_features", m_gds2_extended_features);
save_options.set_option_by_name ("gds2_default_text_size", m_gds2_default_text_size < 0.0 ? tl::Variant () : tl::Variant (m_gds2_default_text_size));

save_options.set_option_by_name ("oasis_compression_level", m_oasis_compression_level);
Expand Down
1 change: 1 addition & 0 deletions src/buddies/src/bd/bdWriterOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ class BD_PUBLIC GenericWriterOptions
bool m_gds2_write_cell_properties;
bool m_gds2_write_file_properties;
double m_gds2_default_text_size;
bool m_gds2_extended_features;

int m_oasis_compression_level;
bool m_oasis_write_cblocks;
Expand Down
4 changes: 2 additions & 2 deletions src/db/db/dbLayoutDiff.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,7 @@ PrintingDifferenceReceiver::print_cell_inst (const db::CellInstArrayWithProperti
enough (tl::info) << "" << tl::noendl;
}
if (ci.properties_id () != 0) {
enough (tl::info) << " [" << ci.properties_id () << "]";
enough (tl::info) << " " << db::properties (ci.properties_id ()).to_dict_var ().to_string ();
} else {
enough (tl::info) << "";
}
Expand All @@ -1374,7 +1374,7 @@ PrintingDifferenceReceiver::print_cell_inst (const db::CellInstArrayWithProperti
enough (tl::info) << "" << tl::noendl;
}
if (ci.properties_id () != 0) {
enough (tl::info) << " [" << ci.properties_id () << "]";
enough (tl::info) << " " << db::properties (ci.properties_id ()).to_dict_var ().to_string ();
} else {
enough (tl::info) << "";
}
Expand Down
24 changes: 24 additions & 0 deletions src/db/db/dbReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,30 @@ class DB_PUBLIC ReaderUnknownFormatException
DB_PUBLIC void
join_layer_names (std::string &s, const std::string &n);

/**
* @brief A helper class to join two datatype layer name map members
*/
struct LNameJoinOp1
{
void operator() (std::string &a, const std::string &b)
{
join_layer_names (a, b);
}
};

/**
* @brief A helper class to join two layer map members
* This implementation basically merged the datatype maps.
*/
struct LNameJoinOp2
{
void operator() (tl::interval_map<db::ld_type, std::string> &a, const tl::interval_map<db::ld_type, std::string> &b)
{
LNameJoinOp1 op1;
a.add (b.begin (), b.end (), op1);
}
};

/**
* @brief The generic reader base class
*/
Expand Down
5 changes: 3 additions & 2 deletions src/layui/layui/layDialogs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1470,8 +1470,9 @@ normalize (const QString &s)

tl::Variant v;

if (*c == '#' || *c == '\"' || *c == '\'') {
tl::Extractor ex (c);
tl::Extractor ex (c);
ex.skip ();
if (*ex == '#' || *ex == '\"' || *ex == '\'' || *ex == '(' || *ex == '{' || *ex == '[') {
ex.read (v);
ex.expect_end ();
} else {
Expand Down
71 changes: 31 additions & 40 deletions src/layui/layui/syntax/ur_text.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,67 +7,58 @@

<contexts>

<context name="Normal" attribute="Normal Text">
<context name="Normal" attribute="Normal Text" fallthrough="true" fallthroughContext="Error">

<DetectChar attribute="String" char="&quot;" context="Quoted Key String"/>
<DetectChar attribute="Raw String" char="'" context="Apostrophed Key String"/>
<DetectChar attribute="Normal Text" char=":" context="#stay"/>
<DetectChar attribute="String" char="&quot;" context="Quoted String"/>
<DetectChar attribute="Raw String" char="'" context="Apostrophed String"/>
<DetectChar attribute="Normal Text" char="(" context="List"/>
<DetectChar attribute="Normal Text" char="[" context="Object"/>
<DetectChar attribute="Normal Text" char="{" context="Array"/>

<RegExpr attribute="Float" String="##\s*\-?[0-9]([0-9]|_[0-9])*(\.[0-9]([0-9]|_[0-9])*)?([eE]\-?[1-9]([0-9]|_[0-9])*(\.[0-9]*)?)?" context="After Key"/>
<RegExpr attribute="Dec" String="#\s*\-?[1-9]([0-9]|_[0-9])*" context="After Key"/>
<RegExpr attribute="Symbol" String="[_A-Za-z0-9]+\b" context="After Key"/>
<RegExpr attribute="Dec" String="#\s*\-?[1-9]([0-9]|_[0-9])*" context="#stay"/>
<RegExpr attribute="Symbol" String="[_A-Za-z0-9]+\b" context="#stay"/>

<RegExpr attribute="Error" String="[^\s]" context="Error"/>
<RegExpr attribute="Normal Text" String="\s+" context="#stay"/>

</context>

<context name="After Key" attribute="Normal Text" fallthrough="true" fallthroughContext="Value" lineEndContext="Error">
<DetectChar attribute="Normal" char=":" context="Value"/>
<RegExpr attribute="Normal" String="\s+" context="#stay"/>
</context>

<context name="Value" attribute="Normal Text" fallthrough="true" fallthroughContext="Error" lineEndContext="Error">

<DetectChar attribute="String" char="&quot;" context="Quoted Value String"/>
<DetectChar attribute="Raw String" char="'" context="Apostrophed Value String"/>

<RegExpr attribute="Float" String="##\s*\-?[0-9]([0-9]|_[0-9])*(\.[0-9]([0-9]|_[0-9])*)?([eE]\-?[1-9]([0-9]|_[0-9])*(\.[0-9]*)?)?" context="After Value"/>
<RegExpr attribute="Dec" String="#\s*\-?[1-9]([0-9]|_[0-9])*" context="After Value"/>
<RegExpr attribute="Symbol" String="[_A-Za-z0-9]+\b" context="After Value"/>

<RegExpr attribute="Normal" String="\s+" context="Value"/>

<context name="Object" attribute="Normal Text" lineEndContext="Error">
<DetectChar attribute="Normal Text" char="]" context="#pop"/>
<!-- nested square brackets -->
<DetectChar attribute="Normal Text" char="[" context="Object"/>
</context>

<context name="After Value" attribute="Normal Text" fallthrough="true" fallthroughContext="Error" lineEndContext="Normal">
<RegExpr attribute="Normal" String="\s+" context="#stay"/>
<context name="List" attribute="Normal Text" lineEndContext="Error">
<RegExpr attribute="Normal Text" String="\s+" context="#stay"/>
<DetectChar attribute="Normal Text" char="," context="#stay"/>
<DetectChar attribute="Normal Text" char=")" context="#pop"/>
<IncludeRules context="Normal"/>
</context>

<context name="Error" attribute="Error" lineEndContext="Normal">
<context name="Array" attribute="Normal Text" lineEndContext="Error">
<RegExpr attribute="Normal Text" String="\s+" context="#stay"/>
<DetectChar attribute="Normal Text" char="," context="#stay"/>
<DetectChar attribute="Normal Text" char="}" context="#pop"/>
<Detect2Chars attribute="Normal Text" char="=" char1="&gt;" context="#stay"/>
<IncludeRules context="Normal"/>
</context>

<context name="Quoted Key String" attribute="String" lineEndContext="Error">
<context name="Quoted String" attribute="String" lineEndContext="Error">
<StringDetect attribute="String" String="\\" context="#stay"/>
<RegExpr attribute="String" String="\\\&quot;" context="#stay"/>
<DetectChar char="&quot;" attribute="String" context="After Key"/>
<DetectChar char="&quot;" attribute="String" context="#pop"/>
</context>

<context name="Apostrophed Key String" attribute="Raw String" lineEndContext="Error">
<context name="Apostrophed String" attribute="Raw String" lineEndContext="Error">
<StringDetect attribute="String" String="\\" context="#stay"/>
<RegExpr attribute="String" String="\\\'" context="#stay"/>
<DetectChar char="'" attribute="Raw String" context="After Key"/>
</context>

<context name="Quoted Value String" attribute="String" lineEndContext="Error">
<StringDetect attribute="String" String="\\" context="#stay"/>
<RegExpr attribute="String" String="\\\&quot;" context="#stay"/>
<DetectChar char="&quot;" attribute="String" context="After Value"/>
<DetectChar char="'" attribute="Raw String" context="#pop"/>
</context>

<context name="Apostrophed Value String" attribute="Raw String" lineEndContext="Error">
<StringDetect attribute="String" String="\\" context="#stay"/>
<RegExpr attribute="String" String="\\\'" context="#stay"/>
<DetectChar char="'" attribute="Raw String" context="After Value"/>
</context>
<context name="Error" attribute="Error" lineEndContext="Normal">
</context>

</contexts>

Expand Down
14 changes: 7 additions & 7 deletions src/plugins/streamers/cif/unit_tests/dbCIFReader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -238,22 +238,22 @@ static void run_test2 (tl::TestBase *_this, const std::string &base, db::Layout

TEST(1a)
{
run_test (_this, tl::testdata_private (), "t1.cif.gz", "t1a_au.gds.gz");
run_test (_this, tl::testdata_private (), "t1.cif.gz", "t1a_au2.gds.gz");
}

TEST(1b)
{
run_test (_this, tl::testdata_private (), "t1.cif.gz", "t1b_au.gds.gz", 0, 0.01);
run_test (_this, tl::testdata_private (), "t1.cif.gz", "t1b_au2.gds.gz", 0, 0.01);
}

TEST(1c)
{
run_test (_this, tl::testdata_private (), "t1.cif.gz", "t1b_au.gds.gz", 0, 0.01, true);
run_test (_this, tl::testdata_private (), "t1.cif.gz", "t1b_au2.gds.gz", 0, 0.01, true);
}

TEST(1d)
{
run_test (_this, tl::testdata_private (), "t1.cif.gz", "t1b_au.gds.gz", 0, 0.01, false, true);
run_test (_this, tl::testdata_private (), "t1.cif.gz", "t1b_au2.gds.gz", 0, 0.01, false, true);
}

TEST(2)
Expand All @@ -263,17 +263,17 @@ TEST(2)

TEST(3a)
{
run_test (_this, tl::testdata_private (), "t3.cif.gz", "t3a_au.gds.gz", "CAA:43,CCA:48,CCP:47,CMF:49,CMS:51,CPG:46,CSN:45,CSP:44,CVA:50,CWN:42,XP:26");
run_test (_this, tl::testdata_private (), "t3.cif.gz", "t3a_au2.gds.gz", "CAA:43,CCA:48,CCP:47,CMF:49,CMS:51,CPG:46,CSN:45,CSP:44,CVA:50,CWN:42,XP:26");
}

TEST(3b)
{
run_test (_this, tl::testdata_private (), "t3.cif.gz", "t3b_au.gds.gz", "CAA:43,CCA:48,CCP:47,CMF:49,CMS:51,CPG:46,CSN:45,CSP:44,CVA:50,CWN:42,XP:26", 0.00012);
run_test (_this, tl::testdata_private (), "t3.cif.gz", "t3b_au2.gds.gz", "CAA:43,CCA:48,CCP:47,CMF:49,CMS:51,CPG:46,CSN:45,CSP:44,CVA:50,CWN:42,XP:26", 0.00012);
}

TEST(3c)
{
run_test (_this, tl::testdata_private (), "t3.cif.gz", "t3c_au.gds.gz", "(CPG:1/0) +(CPG:1000/0) (CCP:1/0) (CMF:2/0) +(CMF:1000/0) (CVA:3/0)", 0.00012);
run_test (_this, tl::testdata_private (), "t3.cif.gz", "t3c_au2.gds.gz", "(CPG:1/0) +(CPG:1000/0) (CCP:1/0) (CMF:2/0) +(CMF:1000/0) (CVA:3/0)", 0.00012);
}

TEST(4)
Expand Down
Loading
Loading