GSI binding for tech specific grids

This commit is contained in:
Matthias Koefferlein 2024-02-16 15:19:32 +01:00
parent 1094fd2dd8
commit 4ed64fdfa1
2 changed files with 33 additions and 0 deletions

View File

@ -135,6 +135,19 @@ gsi::Class<db::TechnologyComponent> technology_component_decl ("db", "Technology
DB_PUBLIC gsi::Class<db::TechnologyComponent> &decl_dbTechnologyComponent () { return technology_component_decl; }
static void
set_default_grid_list (db::Technology *tech, const std::vector<double> &grids)
{
std::string r;
for (auto g = grids.begin (); g != grids.end (); ++g) {
if (! r.empty ()) {
r += ",";
}
r += tl::micron_to_string (*g);
}
tech->set_default_grids (r);
}
gsi::Class<db::Technology> technology_decl ("db", "Technology",
gsi::method ("name", &db::Technology::name,
"@brief Gets the name of the technology"
@ -218,6 +231,19 @@ gsi::Class<db::Technology> technology_decl ("db", "Technology",
gsi::method ("dbu=", &db::Technology::set_dbu, gsi::arg ("dbu"),
"@brief Sets the default database unit\n"
) +
gsi::method ("default_grids", &db::Technology::default_grid_list,
"@brief Gets the default grids\n"
"\n"
"See \\default_grids for details.\n"
"\n"
"This property has been introduced in version 0.28.17."
) +
gsi::method_ext ("default_grids=", &set_default_grid_list, gsi::arg ("grids"),
"@brief Sets the default grids\n"
"If not empty, this list replaces the global grid list for this technology.\n"
"\n"
"This property has been introduced in version 0.28.17."
) +
gsi::method ("layer_properties_file", &db::Technology::layer_properties_file,
"@brief Gets the path of the layer properties file\n"
"\n"

View File

@ -103,6 +103,13 @@ END
tech.dbu = 5.0
assert_equal(tech.dbu, 5.0)
tech.default_grids = []
assert_equal(tech.default_grids.collect { |g| "%.12g" % g }.join(","), "")
tech.default_grids = [0.001, 0.01, 0.2]
assert_equal(tech.default_grids.collect { |g| "%.12g" % g }.join(","), "0.001,0.01,0.2")
tech.default_grids = [1]
assert_equal(tech.default_grids.collect { |g| "%.12g" % g }.join(","), "1")
tech.default_base_path = "/default/path"
assert_equal(tech.default_base_path, "/default/path")
assert_equal(tech.base_path, "/default/path")