Merge pull request #2040 from KLayout/feature/maly

Feature/maly
This commit is contained in:
Matthias Köfferlein 2025-05-22 19:22:52 +02:00 committed by GitHub
commit 23b049627f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
37 changed files with 3373 additions and 3 deletions

View File

@ -33,8 +33,6 @@
namespace db
{
// ---------------------------------------------------------------
// ---------------------------------------------------------------
// GDS2ReaderBase

View File

@ -0,0 +1,183 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2025 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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "dbMALY.h"
#include "dbMALYReader.h"
#include "dbStream.h"
#include "tlClassRegistry.h"
namespace db
{
// ---------------------------------------------------------------
// MALYDiagnostics implementation
MALYDiagnostics::~MALYDiagnostics ()
{
// .. nothing yet ..
}
// ---------------------------------------------------------------
// MALYData implementation
std::string
MALYTitle::to_string () const
{
std::string res;
res += "\"" + string + "\" " + transformation.to_string ();
res += tl::sprintf (" %g,%g,%g", width, height, pitch);
if (font == Standard) {
res += " [Standard]";
} else if (font == Native) {
res += " [Native]";
}
return res;
}
std::string
MALYStructure::to_string () const
{
std::string res;
res += path + "{" + topcell + "}";
if (layer < 0) {
res += "(*)";
} else {
res += tl::sprintf ("(%d)", layer);
}
if (! mname.empty ()) {
res += " mname(" + mname + ")";
}
if (! ename.empty ()) {
res += " ename(" + ename + ")";
}
if (! dname.empty ()) {
res += " dname(" + dname + ")";
}
res += " ";
res += size.to_string ();
res += " ";
res += transformation.to_string ();
if (nx > 1 || ny > 1) {
res += tl::sprintf (" [%.12gx%d,%.12gx%d]", dx, nx, dy, ny);
}
return res;
}
std::string
MALYMask::to_string () const
{
std::string res;
res += "Mask " + name + "\n";
res += " Size " + tl::to_string (size_um);
for (auto t = titles.begin (); t != titles.end (); ++t) {
res += "\n Title " + t->to_string ();
}
for (auto s = structures.begin (); s != structures.end (); ++s) {
res += "\n Ref " + s->to_string ();
}
return res;
}
std::string
MALYData::to_string () const
{
std::string res;
for (auto m = masks.begin (); m != masks.end (); ++m) {
if (m != masks.begin ()) {
res += "\n";
}
res += m->to_string ();
}
return res;
}
// ---------------------------------------------------------------
// MALY format declaration
class MALYFormatDeclaration
: public db::StreamFormatDeclaration
{
public:
MALYFormatDeclaration ()
{
// .. nothing yet ..
}
virtual std::string format_name () const { return "MALY"; }
virtual std::string format_desc () const { return "MALY jobdeck"; }
virtual std::string format_title () const { return "MALY (MALY jobdeck format)"; }
virtual std::string file_format () const { return "MALY jobdeck files (*.maly *.MALY *.mly *.MLY)"; }
virtual bool detect (tl::InputStream &s) const
{
db::MALYReader reader (s);
return reader.test ();
}
virtual ReaderBase *create_reader (tl::InputStream &s) const
{
return new db::MALYReader (s);
}
virtual WriterBase *create_writer () const
{
return 0;
}
virtual bool can_read () const
{
return true;
}
virtual bool can_write () const
{
return false;
}
virtual tl::XMLElementBase *xml_reader_options_element () const
{
return new db::ReaderOptionsXMLElement<db::MALYReaderOptions> ("maly",
tl::make_member (&db::MALYReaderOptions::dbu, "dbu") +
tl::make_member (&db::MALYReaderOptions::layer_map, "layer-map") +
tl::make_member (&db::MALYReaderOptions::create_other_layers, "create-other-layers")
);
}
};
// NOTE: Because MALY has such a high degree of syntactic freedom, the detection is somewhat
// fuzzy: do MALY at the very end of the detection chain
static tl::RegisteredClass<db::StreamFormatDeclaration> reader_decl (new MALYFormatDeclaration (), 2300, "MALY");
// provide a symbol to force linking against
int force_link_MALY = 0;
}

View File

@ -0,0 +1,288 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2025 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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef HDR_dbMALY
#define HDR_dbMALY
#include "dbPoint.h"
#include "dbTrans.h"
#include "dbBox.h"
#include "dbPluginCommon.h"
#include "tlException.h"
#include "tlInternational.h"
#include "tlString.h"
#include "tlAssert.h"
#include <string>
#include <vector>
namespace db
{
/**
* @brief The diagnostics interface for reporting problems in the reader or writer
*/
class MALYDiagnostics
{
public:
virtual ~MALYDiagnostics ();
/**
* @brief Issue an error with positional information
*/
virtual void error (const std::string &txt) = 0;
/**
* @brief Issue a warning with positional information
*/
virtual void warn (const std::string &txt, int warn_level) = 0;
};
/**
* @brief A class representing a title field on a mask
*/
class DB_PLUGIN_PUBLIC MALYTitle
{
public:
/**
* @brief Default constructor
*/
MALYTitle ()
: width (0.0), height (0.0), pitch (0.0), type (String), font (Standard)
{ }
/**
* @brief The type of the title
*/
enum Type
{
String = 0, // A user-defined string
Date = 1, // The date
Serial = 2 // A serial number
};
/**
* @brief The font to be used
*/
enum Font
{
FontNotSet = 0, // Undef
Standard = 1, // Standard font
Native = 2 // Native tool font
};
/**
* @brief The string for "String" type
*/
std::string string;
/**
* @brief The transformation of the title
*
* The origin of the title is supposed to be in the center of
* the title field.
*/
db::DTrans transformation;
/**
* @brief Optional font parameters: character width
*/
double width;
/**
* @brief Optional font parameters: character height
*/
double height;
/**
* @brief Optional font parameters: character pitch
*/
double pitch;
/**
* @brief The type of the title
*/
Type type;
/**
* @brief The font to be used
*/
Font font;
/**
* @brief Returns a string representing the structure
*/
std::string to_string () const;
};
/**
* @brief A class representing a structure (pattern) on a mask
*/
class DB_PLUGIN_PUBLIC MALYStructure
{
public:
/**
* @brief Default constructor
*/
MALYStructure ()
: nx (1), ny (1), dx (0.0), dy (0.0), layer (-1)
{ }
/**
* @brief The (expanded) path of the pattern file
*/
std::string path;
/**
* @brief The name of the top cell
* If empty, the topcell is determined automatically
*/
std::string topcell;
/**
* @brief The pattern window in the original file
*/
db::DBox size;
/**
* @brief The transformation needed to place the original file
*/
db::DCplxTrans transformation;
/**
* @brief The number of placements in x direction
*/
int nx;
/**
* @brief The number of placements in y direction
*/
int ny;
/**
* @brief The placement pitch in x direction (if nx > 1)
*/
double dx;
/**
* @brief The placement pitch in y direction (if ny > 1)
*/
double dy;
/**
* @brief The design name
*/
std::string dname;
/**
* @brief The name for the mask process
*/
std::string mname;
/**
* @brief The name for the mask tool
*/
std::string ename;
/**
* @brief The layer used from the OASIS file
*
* A value of -1 means "all".
*/
int layer;
/**
* @brief Returns a string representing the structure
*/
std::string to_string () const;
};
/**
* @brief A class representing one mask
*/
class DB_PLUGIN_PUBLIC MALYMask
{
public:
/**
* @brief Default constructor
*/
MALYMask ()
: size_um (0.0)
{ }
/**
* @brief Size of the mask in micrometers
*/
double size_um;
/**
* @brief Name of the mask
*
* This is also the name of the layer generated
*/
std::string name;
/**
* @brief The list of structures
*/
std::list<MALYStructure> structures;
/**
* @brief The list of titles
*/
std::list<MALYTitle> titles;
/**
* @brief Returns a string representing the mask
*/
std::string to_string () const;
};
/**
* @brief A class representing the MALY file
*/
class DB_PLUGIN_PUBLIC MALYData
{
public:
/**
* @brief Default constructor
*/
MALYData ()
{ }
/**
* @brief The masks defined by the file
*/
std::list<MALYMask> masks;
/**
* @brief Returns a string representing the data set
*/
std::string to_string () const;
};
}
#endif

View File

@ -0,0 +1,162 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2025 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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef HDR_dbMALYFormat
#define HDR_dbMALYFormat
#include "dbSaveLayoutOptions.h"
#include "dbLoadLayoutOptions.h"
#include "dbPluginCommon.h"
namespace db
{
/**
* @brief Structure that holds the MALY specific options for the reader
* NOTE: this structure is non-public linkage by intention. This way it's instantiated
* in all compile units and the shared object does not need to be linked.
*/
class DB_PLUGIN_PUBLIC MALYReaderOptions
: public FormatSpecificReaderOptions
{
public:
/**
* @brief The constructor
*/
MALYReaderOptions ()
: dbu (0.001),
create_other_layers (true)
{
// .. nothing yet ..
}
/**
* @brief Specify the database unit to produce
*
* Specify the database unit which the resulting layout will receive.
*/
double dbu;
/**
* @brief Specifies a layer mapping
*
* If a layer mapping is specified, only the given layers are read.
* Otherwise, all layers are read.
* Setting "create_other_layers" to true will make the reader
* create other layers for all layers not given in the layer map.
* Setting an empty layer map and create_other_layers to true effectively
* enables all layers for reading.
*/
db::LayerMap layer_map;
/**
* @brief A flag indicating that a new layers shall be created
*
* If this flag is set to true, layers not listed in the layer map a created
* too.
*/
bool create_other_layers;
/**
* @brief Implementation of FormatSpecificReaderOptions
*/
virtual FormatSpecificReaderOptions *clone () const
{
return new MALYReaderOptions (*this);
}
/**
* @brief Implementation of FormatSpecificReaderOptions
*/
virtual const std::string &format_name () const
{
static const std::string n ("MALY");
return n;
}
};
#if 0 // @@@
/**
* @brief Structure that holds the MALY specific options for the Writer
* NOTE: this structure is non-public linkage by intention. This way it's instantiated
* in all compile units and the shared object does not need to be linked.
*/
class DB_PLUGIN_PUBLIC MALYWriterOptions
: public FormatSpecificWriterOptions
{
public:
/**
* @brief The constructor
*/
MALYWriterOptions ()
: lambda (0.0), write_timestamp (true)
{
// .. nothing yet ..
}
/**
* @brief Specifies the lambda value for writing
*
* The lambda value is the basic scaling parameter.
* If this value is set to 0 or negative, the lambda value stored in the layout
* is used (meta data "lambda").
*/
double lambda;
/**
* @brief Specifies the technology value for writing Magic files
*
* If this value is set an empty string, the technology store in the layout's
* "technology" meta data is used.
*/
std::string tech;
/**
* @brief A value indicating whether the real (true) or fake (false) timestamp is written
*
* A fake, static timestamp is useful for comparing files.
*/
bool write_timestamp;
/**
* @brief Implementation of FormatSpecificWriterOptions
*/
virtual FormatSpecificWriterOptions *clone () const
{
return new MALYWriterOptions (*this);
}
/**
* @brief Implementation of FormatSpecificWriterOptions
*/
virtual const std::string &format_name () const
{
static std::string n ("MALY");
return n;
}
};
#endif
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,258 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2025 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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef HDR_dbMALYReader
#define HDR_dbMALYReader
#include "dbPluginCommon.h"
#include "dbNamedLayerReader.h"
#include "dbLayout.h"
#include "dbMALY.h"
#include "dbMALYFormat.h"
#include "dbStreamLayers.h"
#include "dbPropertiesRepository.h"
#include "tlException.h"
#include "tlInternational.h"
#include "tlProgress.h"
#include "tlString.h"
#include "tlStream.h"
#include <map>
#include <set>
namespace db
{
/**
* @brief Generic base class of MALY reader exceptions
*/
class DB_PLUGIN_PUBLIC MALYReaderException
: public ReaderException
{
public:
MALYReaderException (const std::string &msg, size_t l, const std::string &file)
: ReaderException (tl::sprintf (tl::to_string (tr ("%s (line=%ld, file=%s)")), msg, l, file))
{ }
};
/**
* @brief The MALY format stream reader
*/
class DB_PLUGIN_PUBLIC MALYReader
: public NamedLayerReader,
public MALYDiagnostics
{
public:
typedef std::vector<tl::Variant> property_value_list;
/**
* @brief Construct a stream reader object
*
* @param s The stream delegate from which to read stream data from
*/
MALYReader (tl::InputStream &s);
/**
* @brief Destructor
*/
~MALYReader ();
/**
* @brief Tests, if the stream is a valid MALY file
*
* This method can be used for the format detection
*/
bool test ();
/**
* @brief The basic read method
*
* This method will read the stream data and translate this to
* insert calls into the layout object. This will not do much
* on the layout object beside inserting the objects.
* A set of options can be specified with the LoadLayoutOptions
* object.
* The returned map will contain all layers, the passed
* ones and the newly created ones.
*
* @param layout The layout object to write to
* @param map The LayerMap object
* @param create true, if new layers should be created
* @return The LayerMap object that tells where which layer was loaded
*/
virtual const LayerMap &read (db::Layout &layout, const LoadLayoutOptions &options);
/**
* @brief The basic read method (without mapping)
*
* This method will read the stream data and translate this to
* insert calls into the layout object. This will not do much
* on the layout object beside inserting the objects.
* This version will read all input layers and return a map
* which tells which MALY layer has been read into which logical
* layer.
*
* @param layout The layout object to write to
* @return The LayerMap object
*/
virtual const LayerMap &read (db::Layout &layout);
/**
* @brief Format
*/
virtual const char *format () const { return "MALY"; }
/**
* @brief Issue an error with positional information
*
* Reimplements MALYDiagnostics
*/
virtual void error (const std::string &txt);
/**
* @brief Issue a warning with positional information
*
* Reimplements MALYDiagnostics
*/
virtual void warn (const std::string &txt, int wl = 1);
/**
* @brief Reads the MALY file into a MALYData structure
*
* This method is provided for test purposes mainly.
*/
MALYData read_maly_file ();
private:
struct MALYReaderTitleSpec
{
MALYReaderTitleSpec ()
: given (false), enabled (false), width (1.0), height (1.0), pitch (1.0)
{ }
bool given;
bool enabled;
db::DTrans trans;
double width, height, pitch;
};
struct MALYReaderTitleData
{
MALYReaderTitleData ()
{ }
MALYReaderTitleSpec date_spec;
MALYReaderTitleSpec serial_spec;
std::list<std::pair<std::string, MALYReaderTitleSpec> > string_titles;
};
struct MALYReaderParametersData
{
MALYReaderParametersData ()
: base (BaseNotSet), array_base (BaseNotSet), masksize (0.0), maskmirror (false), font (MALYTitle::FontNotSet)
{ }
enum Base
{
BaseNotSet,
Origin,
Center,
LowerLeft
};
Base base;
Base array_base;
double masksize;
bool maskmirror;
MALYTitle::Font font;
std::list<std::pair<std::string, std::string> > roots;
};
struct MALYReaderStrRefData
{
MALYReaderStrRefData ()
: layer (-1), scale (1.0), nx (1), ny (1), dx (0.0), dy (0.0)
{ }
std::string file;
std::string name;
std::string dname, ename, mname;
int layer;
db::DVector org;
db::DBox size;
double scale;
int nx, ny;
double dx, dy;
};
struct MALYReaderStrGroupData
{
std::string name;
std::list<MALYReaderStrRefData> refs;
};
struct MALYReaderMaskData
{
std::string name;
MALYReaderParametersData parameters;
MALYReaderTitleData title;
std::list<MALYReaderStrGroupData> strgroups;
};
tl::TextInputStream m_stream;
tl::AbsoluteProgress m_progress;
double m_dbu;
unsigned int m_last_record_line;
std::string m_record;
std::string m_record_returned;
std::list<std::string> m_sections;
void import_data (db::Layout &layout, const MALYData &data);
void create_metadata (db::Layout &layout, const MALYData &data);
tl::Extractor read_record ();
void unget_record ();
std::string read_record_internal ();
void do_read_maly_file (MALYData &data);
bool read_maskset (MALYData &data);
void read_mask (MALYReaderMaskData &mask);
void read_title (MALYReaderTitleData &mask);
void read_parameter (MALYReaderParametersData &mask);
void read_strgroup (MALYReaderStrGroupData &mask);
db::DTrans extract_title_trans (tl::Extractor &ex);
void extract_title_trans (tl::Extractor &ex, MALYReaderTitleSpec &spec);
bool begin_section (tl::Extractor &ex, const std::string &name = std::string ());
bool end_section (tl::Extractor &ex);
void skip_section ();
MALYTitle create_title (MALYTitle::Type type, const MALYReaderTitleSpec &data, MALYTitle::Font font, bool maskmirror, const std::string &string);
void create_masks (const MALYReaderMaskData &cmask, const std::list<MALYReaderMaskData> &masks, MALYData &data);
MALYStructure create_structure (const MALYReaderParametersData &mparam, const MALYReaderParametersData &cparam, const MALYReaderStrRefData &data, const std::string &strgroup_name, MALYReaderParametersData::Base base, MALYReaderParametersData::Base array_base);
std::string resolve_path (const MALYReaderParametersData &param, const std::string &path);
static MALYReaderParametersData::Base string_to_base (const std::string &string);
};
}
#endif

View File

@ -0,0 +1,15 @@
TARGET = maly
DESTDIR = $$OUT_PWD/../../../../db_plugins
include($$PWD/../../../db_plugin.pri)
HEADERS = \
dbMALY.h \
dbMALYReader.h \
dbMALYFormat.h \
SOURCES = \
dbMALY.cc \
dbMALYReader.cc \
gsiDeclDbMALY.cc \

View File

@ -0,0 +1,146 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2025 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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "dbMALY.h"
#include "dbMALYReader.h"
#include "dbLoadLayoutOptions.h"
#include "dbSaveLayoutOptions.h"
#include "gsiDecl.h"
namespace gsi
{
// ---------------------------------------------------------------
// gsi Implementation of specific methods
static void set_maly_dbu (db::LoadLayoutOptions *options, double dbu)
{
options->get_options<db::MALYReaderOptions> ().dbu = dbu;
}
static double get_maly_dbu (const db::LoadLayoutOptions *options)
{
return options->get_options<db::MALYReaderOptions> ().dbu;
}
static void set_layer_map (db::LoadLayoutOptions *options, const db::LayerMap &lm, bool f)
{
options->get_options<db::MALYReaderOptions> ().layer_map = lm;
options->get_options<db::MALYReaderOptions> ().create_other_layers = f;
}
static void set_layer_map1 (db::LoadLayoutOptions *options, const db::LayerMap &lm)
{
options->get_options<db::MALYReaderOptions> ().layer_map = lm;
}
static db::LayerMap &get_layer_map (db::LoadLayoutOptions *options)
{
return options->get_options<db::MALYReaderOptions> ().layer_map;
}
static void select_all_layers (db::LoadLayoutOptions *options)
{
options->get_options<db::MALYReaderOptions> ().layer_map = db::LayerMap ();
options->get_options<db::MALYReaderOptions> ().create_other_layers = true;
}
static bool create_other_layers (const db::LoadLayoutOptions *options)
{
return options->get_options<db::MALYReaderOptions> ().create_other_layers;
}
static void set_create_other_layers (db::LoadLayoutOptions *options, bool l)
{
options->get_options<db::MALYReaderOptions> ().create_other_layers = l;
}
// extend lay::LoadLayoutOptions with the MALY options
static
gsi::ClassExt<db::LoadLayoutOptions> maly_reader_options (
gsi::method_ext ("maly_set_layer_map", &set_layer_map, gsi::arg ("map"), gsi::arg ("create_other_layers"),
"@brief Sets the layer map\n"
"This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers, for example to assign layer/datatype numbers to the named layers.\n"
"@param map The layer map to set.\n"
"@param create_other_layers The flag indicating whether other layers will be created as well. Set to false to read only the layers in the layer map.\n"
"\n"
"Layer maps can also be used to map the named MALY mask layers to GDS layer/datatypes.\n"
"\n"
"This method has been added in version 0.30.2."
) +
gsi::method_ext ("maly_layer_map=", &set_layer_map1, gsi::arg ("map"),
"@brief Sets the layer map\n"
"This sets a layer mapping for the reader. Unlike \\maly_set_layer_map, the 'create_other_layers' flag is not changed.\n"
"@param map The layer map to set.\n"
"\n"
"Layer maps can also be used to map the named MALY mask layers to GDS layer/datatypes.\n"
"\n"
"This method has been added in version 0.30.2."
) +
gsi::method_ext ("maly_select_all_layers", &select_all_layers,
"@brief Selects all layers and disables the layer map\n"
"\n"
"This disables any layer map and enables reading of all layers.\n"
"New layers will be created when required.\n"
"\n"
"This method has been added in version 0.30.2."
) +
gsi::method_ext ("maly_layer_map", &get_layer_map,
"@brief Gets the layer map\n"
"@return A reference to the layer map\n"
"\n"
"This method has been added in version 0.30.2."
) +
gsi::method_ext ("maly_create_other_layers?", &create_other_layers,
"@brief Gets a value indicating whether other layers shall be created\n"
"@return True, if other layers will be created.\n"
"This attribute acts together with a layer map (see \\maly_layer_map=). Layers not listed in this map are created as well when "
"\\maly_create_other_layers? is true. Otherwise they are ignored.\n"
"\n"
"This method has been added in version 0.30.2."
) +
gsi::method_ext ("maly_create_other_layers=", &set_create_other_layers, gsi::arg ("create"),
"@brief Specifies whether other layers shall be created\n"
"@param create True, if other layers will be created.\n"
"See \\maly_create_other_layers? for a description of this attribute.\n"
"\n"
"This method has been added in version 0.30.2."
) +
gsi::method_ext ("maly_dbu=", &set_maly_dbu, gsi::arg ("dbu"),
"@brief Specifies the database unit which the reader uses and produces\n"
"The database unit is the final resolution of the produced layout. This physical resolution is usually "
"defined by the layout system - GDS for example typically uses 1nm (maly_dbu=0.001).\n"
"All geometry in the MALY pattern files is brought to the database unit by scaling.\n"
"\n"
"This method has been added in version 0.30.2."
) +
gsi::method_ext ("maly_dbu", &get_maly_dbu,
"@brief Specifies the database unit which the reader uses and produces\n"
"See \\maly_dbu= method for a description of this property.\n"
"\n"
"This method has been added in version 0.30.2."
),
""
);
}

View File

@ -0,0 +1,183 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MALYReaderOptionPage</class>
<widget class="QWidget" name="MALYReaderOptionPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>584</width>
<height>530</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Input Options</string>
</property>
<layout class="QGridLayout">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="1">
<widget class="QLineEdit" name="dbu_le">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Micron</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Database unit </string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QLabel" name="label">
<property name="text">
<string>This is the database unit of the resulting layout. Mask pattern with a different grid are adapted to this database unit through scaling.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="layer_subset_grp">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string/>
</property>
<property name="title">
<string>Layer Subset And Layer Mapping</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="_2">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="read_all_cbx">
<property name="text">
<string>Read all layers (additionally to the ones in the mapping table)</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="0" rowspan="10" colspan="2">
<widget class="lay::LayerMappingWidget" name="layer_map">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>lay::LayerMappingWidget</class>
<extends>QFrame</extends>
<header>layLayerMappingWidget.h</header>
<container>1</container>
<slots>
<signal>enable_all_layers(bool)</signal>
</slots>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>dbu_le</tabstop>
<tabstop>read_all_cbx</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>layer_map</sender>
<signal>enable_all_layers(bool)</signal>
<receiver>read_all_cbx</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>122</x>
<y>186</y>
</hint>
<hint type="destinationlabel">
<x>109</x>
<y>147</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -0,0 +1,110 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2025 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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "dbMALY.h"
#include "dbMALYReader.h"
#include "dbLoadLayoutOptions.h"
#include "layMALYReaderPlugin.h"
#include "ui_MALYReaderOptionPage.h"
#include "gsiDecl.h"
#include <QFrame>
#include <QFileDialog>
namespace lay
{
// ---------------------------------------------------------------
// MALYReaderOptionPage definition and implementation
MALYReaderOptionPage::MALYReaderOptionPage (QWidget *parent)
: StreamReaderOptionsPage (parent)
{
mp_ui = new Ui::MALYReaderOptionPage ();
mp_ui->setupUi (this);
}
MALYReaderOptionPage::~MALYReaderOptionPage ()
{
delete mp_ui;
mp_ui = 0;
}
void
MALYReaderOptionPage::setup (const db::FormatSpecificReaderOptions *o, const db::Technology * /*tech*/)
{
static const db::MALYReaderOptions default_options;
const db::MALYReaderOptions *options = dynamic_cast<const db::MALYReaderOptions *> (o);
if (!options) {
options = &default_options;
}
mp_ui->dbu_le->setText (tl::to_qstring (tl::to_string (options->dbu)));
mp_ui->layer_map->set_layer_map (options->layer_map);
mp_ui->read_all_cbx->setChecked (options->create_other_layers);
}
void
MALYReaderOptionPage::commit (db::FormatSpecificReaderOptions *o, const db::Technology * /*tech*/)
{
db::MALYReaderOptions *options = dynamic_cast<db::MALYReaderOptions *> (o);
if (options) {
tl::from_string_ext (tl::to_string (mp_ui->dbu_le->text ()), options->dbu);
if (options->dbu > 1000.0 || options->dbu < 1e-9) {
throw tl::Exception (tl::to_string (QObject::tr ("Invalid value for database unit")));
}
options->layer_map = mp_ui->layer_map->get_layer_map ();
options->create_other_layers = mp_ui->read_all_cbx->isChecked ();
}
}
// ---------------------------------------------------------------
// MALYReaderPluginDeclaration definition and implementation
class MALYReaderPluginDeclaration
: public StreamReaderPluginDeclaration
{
public:
MALYReaderPluginDeclaration ()
: StreamReaderPluginDeclaration (db::MALYReaderOptions ().format_name ())
{
// .. nothing yet ..
}
StreamReaderOptionsPage *format_specific_options_page (QWidget *parent) const
{
return new MALYReaderOptionPage (parent);
}
db::FormatSpecificReaderOptions *create_specific_options () const
{
return new db::MALYReaderOptions ();
}
};
static tl::RegisteredClass<lay::PluginDeclaration> plugin_decl (new lay::MALYReaderPluginDeclaration (), 10000, "MALYReader");
}

View File

@ -0,0 +1,59 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2025 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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef HDR_layMALYReaderPlugin_h
#define HDR_layMALYReaderPlugin_h
#include "layStream.h"
#include <QObject>
namespace Ui
{
class MALYReaderOptionPage;
}
namespace lay
{
class MALYReaderOptionPage
: public StreamReaderOptionsPage
{
Q_OBJECT
public:
MALYReaderOptionPage (QWidget *parent);
~MALYReaderOptionPage ();
void setup (const db::FormatSpecificReaderOptions *options, const db::Technology *tech);
void commit (db::FormatSpecificReaderOptions *options, const db::Technology *tech);
private:
Ui::MALYReaderOptionPage *mp_ui;
};
}
#endif

View File

@ -0,0 +1,22 @@
TARGET = maly_ui
DESTDIR = $$OUT_PWD/../../../../lay_plugins
include($$PWD/../../../lay_plugin.pri)
INCLUDEPATH += $$PWD/../db_plugin
DEPENDPATH += $$PWD/../db_plugin
LIBS += -L$$DESTDIR/../db_plugins -lmaly
!isEmpty(RPATH) {
QMAKE_RPATHDIR += $$RPATH/db_plugins
}
HEADERS = \
layMALYReaderPlugin.h \
SOURCES = \
layMALYReaderPlugin.cc \
FORMS = \
MALYReaderOptionPage.ui \

View File

@ -0,0 +1,10 @@
TEMPLATE = subdirs
SUBDIRS = db_plugin unit_tests
unit_tests.depends += db_plugin
!equals(HAVE_QT, "0") {
SUBDIRS += lay_plugin
lay_plugin.depends += db_plugin
}

View File

@ -0,0 +1,144 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2025 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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "dbMALYReader.h"
#include "dbLayoutDiff.h"
#include "dbWriter.h"
#include "dbTestSupport.h"
#include "tlUnitTest.h"
#include <stdlib.h>
static void run_test (tl::TestBase *_this, const std::string &base, const char *file, const char *file_au, const char *map = 0, double dbu = 0.001)
{
db::MALYReaderOptions *opt = new db::MALYReaderOptions();
opt->dbu = dbu;
db::LayerMap lm;
if (map) {
unsigned int ln = 0;
tl::Extractor ex (map);
while (! ex.at_end ()) {
std::string n;
int l;
ex.read_word_or_quoted (n);
ex.test (":");
ex.read (l);
ex.test (",");
lm.map (n, ln++, db::LayerProperties (l, 0));
}
opt->layer_map = lm;
opt->create_other_layers = true;
}
db::LoadLayoutOptions options;
options.set_options (opt);
db::Manager m (false);
db::Layout layout (&m);
{
std::string fn (base);
fn += "/maly/";
fn += file;
tl::InputStream stream (fn);
db::Reader reader (stream);
reader.read (layout, options);
}
std::string fn_au (base);
fn_au += "/maly/";
fn_au += file_au;
db::compare_layouts (_this, layout, fn_au, db::WriteOAS);
}
TEST(1_Basic)
{
std::string fn (tl::testdata ());
fn += "/maly/MALY_test1.maly";
tl::InputStream stream (fn);
db::MALYReader reader (stream);
db::MALYData data = reader.read_maly_file ();
EXPECT_EQ (data.to_string (),
"Mask A\n"
" Size 127000\n"
" Title \"<SERIAL>\" m90 0,-50 1,1,1 [Standard]\n"
" Title \"MaskA1\" m90 50,50 1,1,1 [Standard]\n"
" Title \"WITH \"QUOTES\"\" r270 -50,0 1,1,1 [Standard]\n"
" Ref A1.oas{CHIP_A}(1) (0,0;10,10) m90 *1 20,0\n"
" Ref A2.oas{CHIP_A}(2) ename(e001) dname(d001) (0,0;50,50) m90 *0.8 20,0 [2x5,1x2]\n"
" Ref B3.oas{CHIP_A}(2) (0,0;12,12) m90 *1 20,0"
)
}
static std::string run_test_with_error (tl::TestBase * /*_this*/, const std::string &file)
{
std::string fn (tl::testdata ());
fn += "/maly/";
fn += file;
tl::InputStream stream (fn);
db::MALYReader reader (stream);
try {
reader.read_maly_file ();
tl_assert (false);
} catch (tl::Exception &ex) {
tl::error << ex.msg ();
return ex.msg ();
}
}
TEST(2_Errors)
{
EXPECT_EQ (run_test_with_error (_this, "MALY_test2a.maly").find ("Line break inside quoted string (line=17,"), size_t (0));
EXPECT_EQ (run_test_with_error (_this, "MALY_test2b.maly").find ("/*...*/ comment not closed (line=43,"), size_t (0));
EXPECT_EQ (run_test_with_error (_this, "MALY_test2c.maly").find ("Expected value STANDARD or NATIVE for FONT (line=7,"), size_t (0));
EXPECT_EQ (run_test_with_error (_this, "MALY_test2d.maly").find ("Unknown base specification: NOVALIDBASE (line=8,"), size_t (0));
EXPECT_EQ (run_test_with_error (_this, "MALY_test2e.maly").find ("Expected end of text here: NOVALIDKEY .. (line=15,"), size_t (0));
EXPECT_EQ (run_test_with_error (_this, "MALY_test2f.maly").find ("Expected 'Y' or 'NONE' for MIRROR spec (line=15,"), size_t (0));
EXPECT_EQ (run_test_with_error (_this, "MALY_test2g.maly").find ("Expected end of text here: UNEXPECTED (line=20,"), size_t (0));
EXPECT_EQ (run_test_with_error (_this, "MALY_test2h.maly").find ("Expected value Y or NONE for MASKMIRROR (line=23,"), size_t (0));
EXPECT_EQ (run_test_with_error (_this, "MALY_test2i.maly").find ("Expected end of text here: UNEXPECTED (line=29,"), size_t (0));
EXPECT_EQ (run_test_with_error (_this, "MALY_test2j.maly").find ("Expected end of text here: NOVALIDKEY .. (line=30,"), size_t (0));
EXPECT_EQ (run_test_with_error (_this, "MALY_test2k.maly").find ("Expected a real number here: SCALE 0.80 .. (line=31,"), size_t (0));
EXPECT_EQ (run_test_with_error (_this, "MALY_test2l.maly").find ("Expected 'PARAMETER' here: CMASK (line=19,"), size_t (0));
EXPECT_EQ (run_test_with_error (_this, "MALY_test2m.maly").find ("Expected 'CMASK' here: TITLE (line=18,"), size_t (0));
EXPECT_EQ (run_test_with_error (_this, "MALY_test2n.maly").find ("Header expected ('BEGIN MALY') (line=2, "), size_t (0));
}
TEST(10_BasicLayout)
{
run_test (_this, tl::testdata (), "MALY_test10.maly", "maly_test10_au.oas");
run_test (_this, tl::testdata (), "MALY_test10.maly", "maly_test10_lm_au.oas", "A: 10, B: 11, C: 12, D: 13");
}
TEST(11_Titles)
{
run_test (_this, tl::testdata (), "MALY_test11.maly", "maly_test11_au.oas");
}

View File

@ -0,0 +1,19 @@
DESTDIR_UT = $$OUT_PWD/../../../..
TARGET = maly_tests
include($$PWD/../../../../lib_ut.pri)
SOURCES = \
dbMALYReaderTests.cc
INCLUDEPATH += $$LAY_INC $$TL_INC $$DB_INC $$GSI_INC $$PWD/../db_plugin $$PWD/../../../common
DEPENDPATH += $$LAY_INC $$TL_INC $$DB_INC $$GSI_INC $$PWD/../db_plugin $$PWD/../../../common
LIBS += -L$$DESTDIR_UT -lklayout_db -lklayout_tl -lklayout_gsi
PLUGINPATH = $$OUT_PWD/../../../../db_plugins
QMAKE_RPATHDIR += $$PLUGINPATH
LIBS += -L$$PLUGINPATH -lmaly

View File

@ -6,4 +6,3 @@ SUBDIR_LIST = $$files($$PWD/*)
SUBDIR_LIST -= $$PWD/streamers.pro
SUBDIRS = $$SUBDIR_LIST

60
testdata/maly/MALY_test1.maly vendored Normal file
View File

@ -0,0 +1,60 @@
// A comment
/*
A multi-line comment
BEGIN MALY 1.1 -- not seend
*/
BEGIN MALY 1.1 // ignored
BEGIN MASKSET
BEGIN CMASK
AN UNKNOWN MASK RECORD
BEGIN NONSENSE
SOMETHING INSIDE A NONSENSE RECORD
BEGIN MORE
SOMETHING INSIDE ANOTHER NONSENSE RECORD
END MORE
END NONSENSE
BEGIN PARAMETER
MASKSIZE 5
FONT STANDARD
BASE ORIGIN
ARYBASE ORIGIN
ROOT OASIS.MASK /home/MASK
ROOT NATIVE "/home/NATIVE"
REFERENCE TOOL a.para
AN UNKNOWN PARAMETER
END PARAMETER
BEGIN TITLE
AN UNKNOWN TITLE RECORD
DATE 50.0 -50.0 MIRROR Y ROTATE 180
SERIAL 0 -50.0
STRING "WITH \"QUOTES\"" 50.0 0
+SIZE 1.0 1.0 1.0 MIRROR Y ROTATE 90
+// with a continuation line
END TITLE
END CMASK
BEGIN MASK A
BEGIN PARAMETER
ROOT OASIS.MASK /home/mask1
MASKMIRROR Y
END PARAMETER
BEGIN TITLE
DATE OFF
STRING MaskA1 -50.0 50.00
END TITLE
BEGIN STRGROUP G1
SREF A1.oas CHIP_A 1 ORG -20.0 0 SIZE 0.0 0.0 10.0 10.0
AREF A2.oas CHIP_A 2 ORG -20.0 0 SIZE 0.0 0.0 50.0 50.0
+ SCALE 0.800 ITERATION 5 2 2.0 1.0
PROPERTY DNAME d001 ENAME e001
END STRGROUP
BEGIN STRGROUP G2
SREF B3.oas CHIP_A 2 ORG -20.0 0.0 SIZE 0.0 0.0 12.0 12.0
END STRGROUP
END MASK
END MASKSET
END MALY
// A comment at the end

62
testdata/maly/MALY_test10.maly vendored Normal file
View File

@ -0,0 +1,62 @@
BEGIN MALY 1.1
BEGIN MASKSET
BEGIN CMASK
BEGIN PARAMETER
MASKSIZE 7
FONT STANDARD
BASE ORIGIN
ARYBASE ORIGIN
ROOT OASIS.MASK test10_oas
MASKMIRROR NONE
END PARAMETER
END CMASK
BEGIN MASK A
BEGIN STRGROUP G1
SREF pat.oas TOP 1 ORG -2000.0 0 SIZE -250.0 -250.0 1000.0 1000.0 SCALE 0.8
AREF pat.oas TOP 2 ORG 1000 0 SIZE -250.0 -250.0 1000.0 1000.0 SCALE 1.0 ITERATION 2 5 1500 2000
END STRGROUP
BEGIN STRGROUP G2
SREF pat.oas TOP 3 ORG -3000.0 2000 SIZE -250.0 -250.0 1000.0 1000.0 SCALE 2.0
END STRGROUP
END MASK
BEGIN MASK B
BEGIN PARAMETER
MASKMIRROR Y
END PARAMETER
BEGIN STRGROUP G1
SREF pat.oas TOP 1 ORG -2000.0 0 SIZE -250.0 -250.0 1000.0 1000.0 SCALE 0.8
AREF pat.oas TOP 2 ORG 1000 0 SIZE -250.0 -250.0 1000.0 1000.0 SCALE 1.0 ITERATION 2 5 1500 2000
END STRGROUP
BEGIN STRGROUP G2
SREF pat.oas TOP 3 ORG -3000.0 2000 SIZE -250.0 -250.0 1000.0 1000.0 SCALE 2.0
END STRGROUP
END MASK
BEGIN MASK C
BEGIN PARAMETER
ARYBASE LOWERLEFT
BASE LOWERLEFT
END PARAMETER
BEGIN STRGROUP G1
SREF pat.oas TOP 1 ORG -2000.0 0 SIZE -250.0 -250.0 1000.0 1000.0 SCALE 0.8
AREF pat.oas TOP 2 ORG 1000 0 SIZE -250.0 -250.0 1000.0 1000.0 SCALE 1.0 ITERATION 2 5 1500 2000
END STRGROUP
BEGIN STRGROUP G2
SREF pat.oas TOP 3 ORG -3000.0 2000 SIZE -250.0 -250.0 1000.0 1000.0 SCALE 2.0
END STRGROUP
END MASK
BEGIN MASK D
BEGIN PARAMETER
ARYBASE CENTER
BASE CENTER
END PARAMETER
BEGIN STRGROUP G1
SREF pat.oas TOP 1 ORG -2000.0 0 SIZE -250.0 -250.0 1000.0 1000.0 SCALE 0.8
AREF pat.oas TOP 2 ORG 1000 0 SIZE -250.0 -250.0 1000.0 1000.0 SCALE 1.0 ITERATION 2 5 1500 2000
END STRGROUP
BEGIN STRGROUP G2
SREF pat.oas TOP 3 ORG -3000.0 2000 SIZE -250.0 -250.0 1000.0 1000.0 SCALE 2.0
END STRGROUP
END MASK
END MASKSET
END MALY

38
testdata/maly/MALY_test11.maly vendored Normal file
View File

@ -0,0 +1,38 @@
BEGIN MALY 1.1
BEGIN MASKSET
BEGIN CMASK
BEGIN PARAMETER
MASKSIZE 7
FONT STANDARD
BASE ORIGIN
ARYBASE ORIGIN
ROOT OASIS.MASK test10_oas
MASKMIRROR NONE
END PARAMETER
BEGIN TITLE
DATE -50000 -5000 MIRROR Y ROTATE 90
SERIAL -50000 -10000
STRING "A STRING TITLE UPSIDE DOWN" 0 -50000 MIRROR Y ROTATE 180
STRING "A STRING TITLE" 0 -51500
END TITLE
END CMASK
BEGIN MASK A
END MASK
BEGIN MASK B
BEGIN PARAMETER
MASKMIRROR Y
END PARAMETER
BEGIN TITLE
SERIAL OFF
STRING "A STRING TITLE FOR MASK B" 5000 -53000
END TITLE
END MASK
BEGIN MASK C
BEGIN TITLE
DATE OFF
STRING "A STRING TITLE FOR MASK C" 0 -55000 SIZE 1.5 2.0 3.0
END TITLE
END MASK
END MASKSET
END MALY

41
testdata/maly/MALY_test2a.maly vendored Normal file
View File

@ -0,0 +1,41 @@
BEGIN MALY 1.1
BEGIN MASKSET
BEGIN CMASK
BEGIN PARAMETER
MASKSIZE 5
FONT STANDARD
BASE ORIGIN
ARYBASE ORIGIN
ROOT OASIS.MASK /home/MASK
ROOT NATIVE /home/NATIVE
REFERENCE TOOL a.para
END PARAMETER
BEGIN TITLE
DATE 50.0 -50.0 MIRROR Y ROTATE 180
SERIAL 0 -50.0
STRING "TEST\" 50.0 0 SIZE 1.0 1.0 1.0 MIRROR Y ROTATE 90
END TITLE
END CMASK
BEGIN MASK A
BEGIN PARAMETER
ROOT OASIS.MASK /home/mask1
MASKMIRROR Y
END PARAMETER
BEGIN TITLE
DATE OFF
STRING MaskA1 -50.0 50.00
END TITLE
BEGIN STRGROUP G1
SREF A1.oas CHIP_A 1 ORG -20.0 0 SIZE 0.0 0.0 10.0 10.0
AREF A2.oas CHIP_A 2 ORG -20.0 0 SIZE 0.0 0.0 50.0 50.0
+ SCALE 0.800 ITERATION 5 2 2.0 1.0
PROPERTY DNAME d001 ENAME e001
END STRGROUP
BEGIN STRGROUP G2
SREF B3.oas CHIP_A 2 ORG -20.0 0.0 SIZE 0.0 0.0 12.0 12.0
END STRGROUP
END MASK
END MASKSET
END MALY

42
testdata/maly/MALY_test2b.maly vendored Normal file
View File

@ -0,0 +1,42 @@
BEGIN MALY 1.1
BEGIN MASKSET
BEGIN CMASK
BEGIN PARAMETER
MASKSIZE 5
FONT STANDARD
BASE ORIGIN
ARYBASE ORIGIN
ROOT OASIS.MASK /home/MASK
ROOT NATIVE /home/NATIVE
REFERENCE TOOL a.para
END PARAMETER
BEGIN TITLE
DATE 50.0 -50.0 MIRROR Y ROTATE 180
SERIAL 0 -50.0
STRING "TEST" 50.0 0 SIZE 1.0 1.0 1.0 MIRROR Y ROTATE 90
/* not terminated
END TITLE
END CMASK
BEGIN MASK A
BEGIN PARAMETER
ROOT OASIS.MASK /home/mask1
MASKMIRROR Y
END PARAMETER
BEGIN TITLE
DATE OFF
STRING MaskA1 -50.0 50.00
END TITLE
BEGIN STRGROUP G1
SREF A1.oas CHIP_A 1 ORG -20.0 0 SIZE 0.0 0.0 10.0 10.0
AREF A2.oas CHIP_A 2 ORG -20.0 0 SIZE 0.0 0.0 50.0 50.0
+ SCALE 0.800 ITERATION 5 2 2.0 1.0
PROPERTY DNAME d001 ENAME e001
END STRGROUP
BEGIN STRGROUP G2
SREF B3.oas CHIP_A 2 ORG -20.0 0.0 SIZE 0.0 0.0 12.0 12.0
END STRGROUP
END MASK
END MASKSET
END MALY

41
testdata/maly/MALY_test2c.maly vendored Normal file
View File

@ -0,0 +1,41 @@
BEGIN MALY 1.1
BEGIN MASKSET
BEGIN CMASK
BEGIN PARAMETER
MASKSIZE 5
FONT NOVALIDFONT // wrong keyword
BASE ORIGIN
ARYBASE ORIGIN
ROOT OASIS.MASK /home/MASK
ROOT NATIVE /home/NATIVE
REFERENCE TOOL a.para
END PARAMETER
BEGIN TITLE
DATE 50.0 -50.0 MIRROR Y ROTATE 180
SERIAL 0 -50.0
STRING "TEST" 50.0 0 SIZE 1.0 1.0 1.0 MIRROR Y ROTATE 90
END TITLE
END CMASK
BEGIN MASK A
BEGIN PARAMETER
ROOT OASIS.MASK /home/mask1
MASKMIRROR Y
END PARAMETER
BEGIN TITLE
DATE OFF
STRING MaskA1 -50.0 50.00
END TITLE
BEGIN STRGROUP G1
SREF A1.oas CHIP_A 1 ORG -20.0 0 SIZE 0.0 0.0 10.0 10.0
AREF A2.oas CHIP_A 2 ORG -20.0 0 SIZE 0.0 0.0 50.0 50.0
+ SCALE 0.800 ITERATION 5 2 2.0 1.0
PROPERTY DNAME d001 ENAME e001
END STRGROUP
BEGIN STRGROUP G2
SREF B3.oas CHIP_A 2 ORG -20.0 0.0 SIZE 0.0 0.0 12.0 12.0
END STRGROUP
END MASK
END MASKSET
END MALY

41
testdata/maly/MALY_test2d.maly vendored Normal file
View File

@ -0,0 +1,41 @@
BEGIN MALY 1.1
BEGIN MASKSET
BEGIN CMASK
BEGIN PARAMETER
MASKSIZE 5
FONT STANDARD
BASE NOVALIDBASE // not a valid keyword
ARYBASE ORIGIN
ROOT OASIS.MASK /home/MASK
ROOT NATIVE /home/NATIVE
REFERENCE TOOL a.para
END PARAMETER
BEGIN TITLE
DATE 50.0 -50.0 MIRROR Y ROTATE 180
SERIAL 0 -50.0
STRING "TEST" 50.0 0 SIZE 1.0 1.0 1.0 MIRROR Y ROTATE 90
END TITLE
END CMASK
BEGIN MASK A
BEGIN PARAMETER
ROOT OASIS.MASK /home/mask1
MASKMIRROR Y
END PARAMETER
BEGIN TITLE
DATE OFF
STRING MaskA1 -50.0 50.00
END TITLE
BEGIN STRGROUP G1
SREF A1.oas CHIP_A 1 ORG -20.0 0 SIZE 0.0 0.0 10.0 10.0
AREF A2.oas CHIP_A 2 ORG -20.0 0 SIZE 0.0 0.0 50.0 50.0
+ SCALE 0.800 ITERATION 5 2 2.0 1.0
PROPERTY DNAME d001 ENAME e001
END STRGROUP
BEGIN STRGROUP G2
SREF B3.oas CHIP_A 2 ORG -20.0 0.0 SIZE 0.0 0.0 12.0 12.0
END STRGROUP
END MASK
END MASKSET
END MALY

41
testdata/maly/MALY_test2e.maly vendored Normal file
View File

@ -0,0 +1,41 @@
BEGIN MALY 1.1
BEGIN MASKSET
BEGIN CMASK
BEGIN PARAMETER
MASKSIZE 5
FONT STANDARD
BASE ORIGIN
ARYBASE ORIGIN
ROOT OASIS.MASK /home/MASK
ROOT NATIVE /home/NATIVE
REFERENCE TOOL a.para
END PARAMETER
BEGIN TITLE
DATE 50.0 -50.0 MIRROR Y ROTATE 180 NOVALIDKEYWORD
SERIAL 0 -50.0
STRING "TEST" 50.0 0 SIZE 1.0 1.0 1.0 MIRROR Y ROTATE 90
END TITLE
END CMASK
BEGIN MASK A
BEGIN PARAMETER
ROOT OASIS.MASK /home/mask1
MASKMIRROR Y
END PARAMETER
BEGIN TITLE
DATE OFF
STRING MaskA1 -50.0 50.00
END TITLE
BEGIN STRGROUP G1
SREF A1.oas CHIP_A 1 ORG -20.0 0 SIZE 0.0 0.0 10.0 10.0
AREF A2.oas CHIP_A 2 ORG -20.0 0 SIZE 0.0 0.0 50.0 50.0
+ SCALE 0.800 ITERATION 5 2 2.0 1.0
PROPERTY DNAME d001 ENAME e001
END STRGROUP
BEGIN STRGROUP G2
SREF B3.oas CHIP_A 2 ORG -20.0 0.0 SIZE 0.0 0.0 12.0 12.0
END STRGROUP
END MASK
END MASKSET
END MALY

41
testdata/maly/MALY_test2f.maly vendored Normal file
View File

@ -0,0 +1,41 @@
BEGIN MALY 1.1
BEGIN MASKSET
BEGIN CMASK
BEGIN PARAMETER
MASKSIZE 5
FONT STANDARD
BASE ORIGIN
ARYBASE ORIGIN
ROOT OASIS.MASK /home/MASK
ROOT NATIVE /home/NATIVE
REFERENCE TOOL a.para
END PARAMETER
BEGIN TITLE
DATE 50.0 -50.0 MIRROR NOVALIDSPEC ROTATE 180
SERIAL 0 -50.0
STRING "TEST" 50.0 0 SIZE 1.0 1.0 1.0 MIRROR Y ROTATE 90
END TITLE
END CMASK
BEGIN MASK A
BEGIN PARAMETER
ROOT OASIS.MASK /home/mask1
MASKMIRROR Y
END PARAMETER
BEGIN TITLE
DATE OFF
STRING MaskA1 -50.0 50.00
END TITLE
BEGIN STRGROUP G1
SREF A1.oas CHIP_A 1 ORG -20.0 0 SIZE 0.0 0.0 10.0 10.0
AREF A2.oas CHIP_A 2 ORG -20.0 0 SIZE 0.0 0.0 50.0 50.0
+ SCALE 0.800 ITERATION 5 2 2.0 1.0
PROPERTY DNAME d001 ENAME e001
END STRGROUP
BEGIN STRGROUP G2
SREF B3.oas CHIP_A 2 ORG -20.0 0.0 SIZE 0.0 0.0 12.0 12.0
END STRGROUP
END MASK
END MASKSET
END MALY

41
testdata/maly/MALY_test2g.maly vendored Normal file
View File

@ -0,0 +1,41 @@
BEGIN MALY 1.1
BEGIN MASKSET
BEGIN CMASK
BEGIN PARAMETER
MASKSIZE 5
FONT STANDARD
BASE ORIGIN
ARYBASE ORIGIN
ROOT OASIS.MASK /home/MASK
ROOT NATIVE /home/NATIVE
REFERENCE TOOL a.para
END PARAMETER
BEGIN TITLE
DATE 50.0 -50.0 MIRROR Y ROTATE 180
SERIAL 0 -50.0
STRING "TEST" 50.0 0 SIZE 1.0 1.0 1.0 MIRROR Y ROTATE 90
END TITLE
END CMASK
BEGIN MASK A UNEXPECTED
BEGIN PARAMETER
ROOT OASIS.MASK /home/mask1
MASKMIRROR Y
END PARAMETER
BEGIN TITLE
DATE OFF
STRING MaskA1 -50.0 50.00
END TITLE
BEGIN STRGROUP G1
SREF A1.oas CHIP_A 1 ORG -20.0 0 SIZE 0.0 0.0 10.0 10.0
AREF A2.oas CHIP_A 2 ORG -20.0 0 SIZE 0.0 0.0 50.0 50.0
+ SCALE 0.800 ITERATION 5 2 2.0 1.0
PROPERTY DNAME d001 ENAME e001
END STRGROUP
BEGIN STRGROUP G2
SREF B3.oas CHIP_A 2 ORG -20.0 0.0 SIZE 0.0 0.0 12.0 12.0
END STRGROUP
END MASK
END MASKSET
END MALY

41
testdata/maly/MALY_test2h.maly vendored Normal file
View File

@ -0,0 +1,41 @@
BEGIN MALY 1.1
BEGIN MASKSET
BEGIN CMASK
BEGIN PARAMETER
MASKSIZE 5
FONT STANDARD
BASE ORIGIN
ARYBASE ORIGIN
ROOT OASIS.MASK /home/MASK
ROOT NATIVE /home/NATIVE
REFERENCE TOOL a.para
END PARAMETER
BEGIN TITLE
DATE 50.0 -50.0 MIRROR Y ROTATE 180
SERIAL 0 -50.0
STRING "TEST" 50.0 0 SIZE 1.0 1.0 1.0 MIRROR Y ROTATE 90
END TITLE
END CMASK
BEGIN MASK A
BEGIN PARAMETER
ROOT OASIS.MASK /home/mask1
MASKMIRROR NOVALIDKEYWORD
END PARAMETER
BEGIN TITLE
DATE OFF
STRING MaskA1 -50.0 50.00
END TITLE
BEGIN STRGROUP G1
SREF A1.oas CHIP_A 1 ORG -20.0 0 SIZE 0.0 0.0 10.0 10.0
AREF A2.oas CHIP_A 2 ORG -20.0 0 SIZE 0.0 0.0 50.0 50.0
+ SCALE 0.800 ITERATION 5 2 2.0 1.0
PROPERTY DNAME d001 ENAME e001
END STRGROUP
BEGIN STRGROUP G2
SREF B3.oas CHIP_A 2 ORG -20.0 0.0 SIZE 0.0 0.0 12.0 12.0
END STRGROUP
END MASK
END MASKSET
END MALY

41
testdata/maly/MALY_test2i.maly vendored Normal file
View File

@ -0,0 +1,41 @@
BEGIN MALY 1.1
BEGIN MASKSET
BEGIN CMASK
BEGIN PARAMETER
MASKSIZE 5
FONT STANDARD
BASE ORIGIN
ARYBASE ORIGIN
ROOT OASIS.MASK /home/MASK
ROOT NATIVE /home/NATIVE
REFERENCE TOOL a.para
END PARAMETER
BEGIN TITLE
DATE 50.0 -50.0 MIRROR Y ROTATE 180
SERIAL 0 -50.0
STRING "TEST" 50.0 0 SIZE 1.0 1.0 1.0 MIRROR Y ROTATE 90
END TITLE
END CMASK
BEGIN MASK A
BEGIN PARAMETER
ROOT OASIS.MASK /home/mask1
MASKMIRROR Y
END PARAMETER
BEGIN TITLE
DATE OFF
STRING MaskA1 -50.0 50.00
END TITLE
BEGIN STRGROUP G1 UNEXPECTED
SREF A1.oas CHIP_A 1 ORG -20.0 0 SIZE 0.0 0.0 10.0 10.0
AREF A2.oas CHIP_A 2 ORG -20.0 0 SIZE 0.0 0.0 50.0 50.0
+ SCALE 0.800 ITERATION 5 2 2.0 1.0
PROPERTY DNAME d001 ENAME e001
END STRGROUP
BEGIN STRGROUP G2
SREF B3.oas CHIP_A 2 ORG -20.0 0.0 SIZE 0.0 0.0 12.0 12.0
END STRGROUP
END MASK
END MASKSET
END MALY

41
testdata/maly/MALY_test2j.maly vendored Normal file
View File

@ -0,0 +1,41 @@
BEGIN MALY 1.1
BEGIN MASKSET
BEGIN CMASK
BEGIN PARAMETER
MASKSIZE 5
FONT STANDARD
BASE ORIGIN
ARYBASE ORIGIN
ROOT OASIS.MASK /home/MASK
ROOT NATIVE /home/NATIVE
REFERENCE TOOL a.para
END PARAMETER
BEGIN TITLE
DATE 50.0 -50.0 MIRROR Y ROTATE 180
SERIAL 0 -50.0
STRING "TEST" 50.0 0 SIZE 1.0 1.0 1.0 MIRROR Y ROTATE 90
END TITLE
END CMASK
BEGIN MASK A
BEGIN PARAMETER
ROOT OASIS.MASK /home/mask1
MASKMIRROR Y
END PARAMETER
BEGIN TITLE
DATE OFF
STRING MaskA1 -50.0 50.00
END TITLE
BEGIN STRGROUP G1
SREF A1.oas CHIP_A 1 ORG -20.0 0 SIZE 0.0 0.0 10.0 10.0 NOVALIDKEYWORD
AREF A2.oas CHIP_A 2 ORG -20.0 0 SIZE 0.0 0.0 50.0 50.0
+ SCALE 0.800 ITERATION 5 2 2.0 1.0
PROPERTY DNAME d001 ENAME e001
END STRGROUP
BEGIN STRGROUP G2
SREF B3.oas CHIP_A 2 ORG -20.0 0.0 SIZE 0.0 0.0 12.0 12.0
END STRGROUP
END MASK
END MASKSET
END MALY

41
testdata/maly/MALY_test2k.maly vendored Normal file
View File

@ -0,0 +1,41 @@
BEGIN MALY 1.1
BEGIN MASKSET
BEGIN CMASK
BEGIN PARAMETER
MASKSIZE 5
FONT STANDARD
BASE ORIGIN
ARYBASE ORIGIN
ROOT OASIS.MASK /home/MASK
ROOT NATIVE /home/NATIVE
REFERENCE TOOL a.para
END PARAMETER
BEGIN TITLE
DATE 50.0 -50.0 MIRROR Y ROTATE 180
SERIAL 0 -50.0
STRING "TEST" 50.0 0 SIZE 1.0 1.0 1.0 MIRROR Y ROTATE 90
END TITLE
END CMASK
BEGIN MASK A
BEGIN PARAMETER
ROOT OASIS.MASK /home/mask1
MASKMIRROR Y
END PARAMETER
BEGIN TITLE
DATE OFF
STRING MaskA1 -50.0 50.00
END TITLE
BEGIN STRGROUP G1
SREF A1.oas CHIP_A 1 ORG -20.0 0 SIZE 0.0 0.0 10.0 10.0
AREF A2.oas CHIP_A 2 ORG -20.0 0 SIZE 0.0 0.0 50.0 // missing argument
+ SCALE 0.800 ITERATION 5 2 2.0 1.0
PROPERTY DNAME d001 ENAME e001
END STRGROUP
BEGIN STRGROUP G2
SREF B3.oas CHIP_A 2 ORG -20.0 0.0 SIZE 0.0 0.0 12.0 12.0
END STRGROUP
END MASK
END MASKSET
END MALY

41
testdata/maly/MALY_test2l.maly vendored Normal file
View File

@ -0,0 +1,41 @@
BEGIN MALY 1.1
BEGIN MASKSET
BEGIN CMASK
BEGIN PARAMETER
MASKSIZE 5
FONT STANDARD
BASE ORIGIN
ARYBASE ORIGIN
ROOT OASIS.MASK /home/MASK
ROOT NATIVE /home/NATIVE
REFERENCE TOOL a.para
// missing closing section END PARAMETER
BEGIN TITLE
DATE 50.0 -50.0 MIRROR Y ROTATE 180
SERIAL 0 -50.0
STRING "TEST" 50.0 0 SIZE 1.0 1.0 1.0 MIRROR Y ROTATE 90
END TITLE
END CMASK
BEGIN MASK A
BEGIN PARAMETER
ROOT OASIS.MASK /home/mask1
MASKMIRROR Y
END PARAMETER
BEGIN TITLE
DATE OFF
STRING MaskA1 -50.0 50.00
END TITLE
BEGIN STRGROUP G1
SREF A1.oas CHIP_A 1 ORG -20.0 0 SIZE 0.0 0.0 10.0 10.0
AREF A2.oas CHIP_A 2 ORG -20.0 0 SIZE 0.0 0.0 50.0 50.0
+ SCALE 0.800 ITERATION 5 2 2.0 1.0
PROPERTY DNAME d001 ENAME e001
END STRGROUP
BEGIN STRGROUP G2
SREF B3.oas CHIP_A 2 ORG -20.0 0.0 SIZE 0.0 0.0 12.0 12.0
END STRGROUP
END MASK
END MASKSET
END MALY

41
testdata/maly/MALY_test2m.maly vendored Normal file
View File

@ -0,0 +1,41 @@
BEGIN MALY 1.1
BEGIN MASKSET
BEGIN CMASK
BEGIN PARAMETER
MASKSIZE 5
FONT STANDARD
BASE ORIGIN
ARYBASE ORIGIN
ROOT OASIS.MASK /home/MASK
ROOT NATIVE /home/NATIVE
REFERENCE TOOL a.para
END PARAMETER
// missing opening BEGIN TITLE
DATE 50.0 -50.0 MIRROR Y ROTATE 180
SERIAL 0 -50.0
STRING "TEST" 50.0 0 SIZE 1.0 1.0 1.0 MIRROR Y ROTATE 90
END TITLE
END CMASK
BEGIN MASK A
BEGIN PARAMETER
ROOT OASIS.MASK /home/mask1
MASKMIRROR Y
END PARAMETER
BEGIN TITLE
DATE OFF
STRING MaskA1 -50.0 50.00
END TITLE
BEGIN STRGROUP G1
SREF A1.oas CHIP_A 1 ORG -20.0 0 SIZE 0.0 0.0 10.0 10.0
AREF A2.oas CHIP_A 2 ORG -20.0 0 SIZE 0.0 0.0 50.0 50.0
+ SCALE 0.800 ITERATION 5 2 2.0 1.0
PROPERTY DNAME d001 ENAME e001
END STRGROUP
BEGIN STRGROUP G2
SREF B3.oas CHIP_A 2 ORG -20.0 0.0 SIZE 0.0 0.0 12.0 12.0
END STRGROUP
END MASK
END MASKSET
END MALY

41
testdata/maly/MALY_test2n.maly vendored Normal file
View File

@ -0,0 +1,41 @@
BEGIN WRONG 1.1
BEGIN MASKSET
BEGIN CMASK
BEGIN PARAMETER
MASKSIZE 5
FONT STANDARD
BASE ORIGIN
ARYBASE ORIGIN
ROOT OASIS.MASK /home/MASK
ROOT NATIVE /home/NATIVE
REFERENCE TOOL a.para
END PARAMETER
BEGIN TITLE
DATE 50.0 -50.0 MIRROR Y ROTATE 180
SERIAL 0 -50.0
STRING "TEST" 50.0 0 SIZE 1.0 1.0 1.0 MIRROR Y ROTATE 90
END TITLE
END CMASK
BEGIN MASK A
BEGIN PARAMETER
ROOT OASIS.MASK /home/mask1
MASKMIRROR Y
END PARAMETER
BEGIN TITLE
DATE OFF
STRING MaskA1 -50.0 50.00
END TITLE
BEGIN STRGROUP G1
SREF A1.oas CHIP_A 1 ORG -20.0 0 SIZE 0.0 0.0 10.0 10.0
AREF A2.oas CHIP_A 2 ORG -20.0 0 SIZE 0.0 0.0 50.0 50.0
+ SCALE 0.800 ITERATION 5 2 2.0 1.0
PROPERTY DNAME d001 ENAME e001
END STRGROUP
BEGIN STRGROUP G2
SREF B3.oas CHIP_A 2 ORG -20.0 0.0 SIZE 0.0 0.0 12.0 12.0
END STRGROUP
END MASK
END MASKSET
END MALY

BIN
testdata/maly/maly_test10_au.oas vendored Normal file

Binary file not shown.

BIN
testdata/maly/maly_test10_lm_au.oas vendored Normal file

Binary file not shown.

BIN
testdata/maly/maly_test11_au.oas vendored Normal file

Binary file not shown.

BIN
testdata/maly/test10_oas/pat.oas vendored Normal file

Binary file not shown.