Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for LEF58_TYPE all types. #1895

Merged
merged 5 commits into from
May 24, 2022
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
17 changes: 15 additions & 2 deletions src/odb/include/odb/db.h
Original file line number Diff line number Diff line change
Expand Up @@ -6897,7 +6897,18 @@ class dbTechLayer : public dbObject
DIFFUSION,
TRIMPOLY,
MIMCAP,
STACKEDMIMCAP
STACKEDMIMCAP,
TSVMETAL,
TSV,
PASSIVATION,
HIGHR,
TRIMMETAL,
REGION,
MEOL,
WELLDISTANCE,
CPODE,
PADMETAL,
POLYROUTING
};
// User Code Begin dbTechLayerEnums
// User Code End dbTechLayerEnums
Expand Down Expand Up @@ -9117,7 +9128,9 @@ class dbAccessPoint : public dbObject

void addBlockVia(int num_cuts, dbVia* via);

void addSegment(const Rect& segment, const bool& begin_style_trunc, const bool& end_style_trunc);
void addSegment(const Rect& segment,
const bool& begin_style_trunc,
const bool& end_style_trunc);

const std::vector<std::tuple<Rect, bool, bool>>& getSegments() const;

Expand Down
15 changes: 13 additions & 2 deletions src/odb/src/codeGenerator/dbTechLayer.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
{
"type": "uint",
"name": "lef58_type_",
"bits": 3,
"bits": 5,
"flags": [
"no-set",
"no-get"
Expand All @@ -144,7 +144,18 @@
"DIFFUSION",
"TRIMPOLY",
"MIMCAP",
"STACKEDMIMCAP"
"STACKEDMIMCAP",
"TSVMETAL",
"TSV",
"PASSIVATION",
"HIGHR",
"TRIMMETAL",
"REGION",
"MEOL",
"WELLDISTANCE",
"CPODE",
"PADMETAL",
"POLYROUTING"
],
"public": true
}
Expand Down
58 changes: 40 additions & 18 deletions src/odb/src/db/dbTechLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1121,24 +1121,46 @@ dbTechLayer::LEF58_TYPE dbTechLayer::getLef58Type() const
std::string dbTechLayer::getLef58TypeString() const
{
switch (getLef58Type()) {
case NONE:
return "NONE";
case NWELL:
return "NWELL";
case PWELL:
return "PWELL";
case ABOVEDIEEDGE:
return "ABOVEDIEEDGE";
case BELOWDIEEDGE:
return "BELOWDIEEDGE";
case DIFFUSION:
return "DIFFUSION";
case TRIMPOLY:
return "TRIMPOLY";
case MIMCAP:
return "MIMCAP";
case STACKEDMIMCAP:
return "STACKEDMIMCAP";
case NONE:
return "NONE";
case NWELL:
return "NWELL";
case PWELL:
return "PWELL";
case ABOVEDIEEDGE:
return "ABOVEDIEEDGE";
case BELOWDIEEDGE:
return "BELOWDIEEDGE";
case DIFFUSION:
return "DIFFUSION";
case TRIMPOLY:
return "TRIMPOLY";
case MIMCAP:
return "MIMCAP";
case STACKEDMIMCAP:
return "STACKEDMIMCAP";
case TSV:
return "TSV";
case PASSIVATION:
return "PASSIVATION";
case HIGHR:
return "HIGHR";
case TRIMMETAL:
return "TRIMMETAL";
case REGION:
return "REGION";
case MEOL:
return "MEOL";
case WELLDISTANCE:
return "WELLDISTANCE";
case CPODE:
return "CPODE";
case TSVMETAL:
return "TSVMETAL";
case PADMETAL:
return "PADMETAL";
case POLYROUTING:
return "POLYROUTING";
}

return "Unknown";
Expand Down
4 changes: 2 additions & 2 deletions src/odb/src/db/dbTechLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ struct dbTechLayerFlags
bool right_way_on_grid_only_ : 1;
bool right_way_on_grid_only_check_mask_ : 1;
bool rect_only_except_non_core_pins_ : 1;
uint lef58_type_ : 3;
uint spare_bits_ : 6;
uint lef58_type_ : 5;
uint spare_bits_ : 4;
};
// User Code Begin Structs
// User Code End Structs
Expand Down
35 changes: 34 additions & 1 deletion src/odb/src/lefin/lefTechLayerTypeParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,40 @@ bool parse(Iterator first,
odb::dbTechLayer::LEF58_TYPE::MIMCAP)]
| lit("STACKEDMIMCAP")[boost::bind(&odb::dbTechLayer::setLef58Type,
layer,
odb::dbTechLayer::LEF58_TYPE::STACKEDMIMCAP)])
odb::dbTechLayer::LEF58_TYPE::STACKEDMIMCAP)]
| lit("TSVMETAL")[boost::bind(&odb::dbTechLayer::setLef58Type,
layer,
odb::dbTechLayer::LEF58_TYPE::TSVMETAL)]
| lit("PASSIVATION")[boost::bind(&odb::dbTechLayer::setLef58Type,
layer,
odb::dbTechLayer::LEF58_TYPE::PASSIVATION)]
| lit("HIGHR")[boost::bind(&odb::dbTechLayer::setLef58Type,
layer,
odb::dbTechLayer::LEF58_TYPE::HIGHR)]
| lit("TRIMMETAL")[boost::bind(&odb::dbTechLayer::setLef58Type,
layer,
odb::dbTechLayer::LEF58_TYPE::TRIMMETAL)]
| lit("REGION")[boost::bind(&odb::dbTechLayer::setLef58Type,
layer,
odb::dbTechLayer::LEF58_TYPE::REGION)]
| lit("MEOL")[boost::bind(&odb::dbTechLayer::setLef58Type,
layer,
odb::dbTechLayer::LEF58_TYPE::MEOL)]
| lit("WELLDISTANCE")[boost::bind(&odb::dbTechLayer::setLef58Type,
layer,
odb::dbTechLayer::LEF58_TYPE::WELLDISTANCE)]
| lit("CPODE")[boost::bind(&odb::dbTechLayer::setLef58Type,
layer,
odb::dbTechLayer::LEF58_TYPE::CPODE)]
| lit("TSV")[boost::bind(&odb::dbTechLayer::setLef58Type,
layer,
odb::dbTechLayer::LEF58_TYPE::TSV)]
| lit("PADMETAL")[boost::bind(&odb::dbTechLayer::setLef58Type,
layer,
odb::dbTechLayer::LEF58_TYPE::PADMETAL)]
| lit("POLYROUTING")[boost::bind(&odb::dbTechLayer::setLef58Type,
layer,
odb::dbTechLayer::LEF58_TYPE::POLYROUTING)])
>> lit(";"));

bool valid = qi::phrase_parse(first, last, TypeRule, space);
Expand Down
79 changes: 78 additions & 1 deletion src/odb/src/swig/tcl/dbenums.i
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,39 @@
case odb::dbTechLayer::STACKEDMIMCAP:
obj = Tcl_NewStringObj("STACKEDMIMCAP", -1);
break;
case odb::dbTechLayer::TSVMETAL:
obj = Tcl_NewStringObj("TSVMETAL", -1);
break;
case odb::dbTechLayer::TSV:
obj = Tcl_NewStringObj("TSV", -1);
break;
case odb::dbTechLayer::PASSIVATION:
obj = Tcl_NewStringObj("PASSIVATION", -1);
break;
case odb::dbTechLayer::HIGHR:
obj = Tcl_NewStringObj("HIGHR", -1);
break;
case odb::dbTechLayer::TRIMMETAL:
obj = Tcl_NewStringObj("TRIMMETAL", -1);
break;
case odb::dbTechLayer::REGION:
obj = Tcl_NewStringObj("REGION", -1);
break;
case odb::dbTechLayer::MEOL:
obj = Tcl_NewStringObj("MEOL", -1);
break;
case odb::dbTechLayer::WELLDISTANCE:
obj = Tcl_NewStringObj("WELLDISTANCE", -1);
break;
case odb::dbTechLayer::CPODE:
obj = Tcl_NewStringObj("CPODE", -1);
break;
case odb::dbTechLayer::PADMETAL:
obj = Tcl_NewStringObj("PADMETAL", -1);
break;
case odb::dbTechLayer::POLYROUTING:
obj = Tcl_NewStringObj("POLYROUTING", -1);
break;
case odb::dbTechLayer::NONE:
obj = Tcl_NewStringObj("NONE", -1);
break;
Expand Down Expand Up @@ -637,6 +670,28 @@
$1 = odb::dbTechLayer::LEF58_TYPE::MIMCAP;
} else if (strcasecmp(str, "STACKEDMIMCAP") == 0) {
$1 = odb::dbTechLayer::LEF58_TYPE::STACKEDMIMCAP;
} else if (strcasecmp(str, "TSVMETAL") == 0) {
$1 = odb::dbTechLayer::LEF58_TYPE::TSVMETAL;
} else if (strcasecmp(str, "TSV") == 0) {
$1 = odb::dbTechLayer::LEF58_TYPE::TSV;
} else if (strcasecmp(str, "PASSIVATION") == 0) {
$1 = odb::dbTechLayer::LEF58_TYPE::PASSIVATION;
} else if (strcasecmp(str, "HIGHR") == 0) {
$1 = odb::dbTechLayer::LEF58_TYPE::HIGHR;
} else if (strcasecmp(str, "TRIMMETAL") == 0) {
$1 = odb::dbTechLayer::LEF58_TYPE::TRIMMETAL;
} else if (strcasecmp(str, "REGION") == 0) {
$1 = odb::dbTechLayer::LEF58_TYPE::REGION;
} else if (strcasecmp(str, "MEOL") == 0) {
$1 = odb::dbTechLayer::LEF58_TYPE::MEOL;
} else if (strcasecmp(str, "WELLDISTANCE") == 0) {
$1 = odb::dbTechLayer::LEF58_TYPE::WELLDISTANCE;
} else if (strcasecmp(str, "CPODE") == 0) {
$1 = odb::dbTechLayer::LEF58_TYPE::CPODE;
} else if (strcasecmp(str, "PADMETAL") == 0) {
$1 = odb::dbTechLayer::LEF58_TYPE::PADMETAL;
} else if (strcasecmp(str, "POLYROUTING") == 0) {
$1 = odb::dbTechLayer::LEF58_TYPE::POLYROUTING;
}
}
%typemap(typecheck) odb::dbTechLayerType, dbTechLayerType {
Expand Down Expand Up @@ -683,7 +738,29 @@
found = true;
} else if (strcasecmp(str, "STACKEDMIMCAP") == 0) {
found = true;
} else if (strcasecmp(str, "NONE") == 0) {
} else if (strcasecmp(str, "TSVMETAL") == 0) {
found = true;
} else if (strcasecmp(str, "TSV") == 0) {
found = true;
} else if (strcasecmp(str, "PASSIVATION") == 0) {
found = true;
} else if (strcasecmp(str, "HIGHR") == 0) {
found = true;
} else if (strcasecmp(str, "TRIMMETAL") == 0) {
found = true;
} else if (strcasecmp(str, "REGION") == 0) {
found = true;
} else if (strcasecmp(str, "MEOL") == 0) {
found = true;
} else if (strcasecmp(str, "WELLDISTANCE") == 0) {
found = true;
} else if (strcasecmp(str, "CPODE") == 0) {
found = true;
} else if (strcasecmp(str, "PADMETAL") == 0) {
found = true;
} else if (strcasecmp(str, "POLYROUTING") == 0) {
found = true;
} else if (strcasecmp(str, "NONE") == 0) {
found = true;
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/odb/test/cpp/TestLef58Properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@ BOOST_AUTO_TEST_CASE(test_default)
auto array_spacing_map = aspRule->getCutsArraySpacing();
BOOST_TEST(array_spacing_map.size() == 1);
BOOST_TEST(array_spacing_map[3] == 0.30 * distFactor);

layer = dbTech->findLayer("contact");
BOOST_TEST(layer->getLef58Type() == odb::dbTechLayer::LEF58_TYPE::HIGHR);
layer = dbTech->findLayer("metal2");
BOOST_TEST(layer->getLef58Type() == odb::dbTechLayer::LEF58_TYPE::TSVMETAL);
}

BOOST_AUTO_TEST_SUITE_END()
2 changes: 2 additions & 0 deletions src/odb/test/data/gscl45nm.lef
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ LAYER contact
TYPE CUT ;
SPACING 0.075 ;
PROPERTY contactResistance 10.5 ;
PROPERTY LEF58_TYPE "TYPE HIGHR ;" ;
END contact

LAYER metal1
Expand Down Expand Up @@ -102,6 +103,7 @@ LAYER metal2
WIDTH 0.07 ;
SPACING 0.075 ;
RESISTANCE RPERSQ 0.25 ;
PROPERTY LEF58_TYPE "TYPE TSVMETAL ;" ;
END metal2

LAYER via2
Expand Down