diff --git a/src/db/db/gsiDeclDbTechnologies.cc b/src/db/db/gsiDeclDbTechnologies.cc index 2a7fa7167..de670fa4f 100644 --- a/src/db/db/gsiDeclDbTechnologies.cc +++ b/src/db/db/gsiDeclDbTechnologies.cc @@ -135,6 +135,19 @@ gsi::Class technology_component_decl ("db", "Technology DB_PUBLIC gsi::Class &decl_dbTechnologyComponent () { return technology_component_decl; } +static void +set_default_grid_list (db::Technology *tech, const std::vector &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 technology_decl ("db", "Technology", gsi::method ("name", &db::Technology::name, "@brief Gets the name of the technology" @@ -218,6 +231,19 @@ gsi::Class 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" diff --git a/testdata/ruby/dbTechnologies.rb b/testdata/ruby/dbTechnologies.rb index 23b932291..d1dc9cf93 100644 --- a/testdata/ruby/dbTechnologies.rb +++ b/testdata/ruby/dbTechnologies.rb @@ -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")