mirror of
https://github.com/The-OpenROAD-Project/OpenSTA.git
synced 2026-09-07 11:51:47 +02:00
fix to exclude bias pins from timing graph
Signed-off-by: dsengupta0628 <[email protected]>
This commit is contained in:
@@ -35,6 +35,7 @@ PortDirection *PortDirection::bidirect_;
|
||||
PortDirection *PortDirection::internal_;
|
||||
PortDirection *PortDirection::ground_;
|
||||
PortDirection *PortDirection::power_;
|
||||
PortDirection *PortDirection::bias_;
|
||||
PortDirection *PortDirection::unknown_;
|
||||
|
||||
void
|
||||
@@ -47,7 +48,8 @@ PortDirection::init()
|
||||
internal_ = new PortDirection("internal", 4);
|
||||
ground_ = new PortDirection("ground", 5);
|
||||
power_ = new PortDirection("power", 6);
|
||||
unknown_ = new PortDirection("unknown", 7);
|
||||
bias_ = new PortDirection("bias", 7);
|
||||
unknown_ = new PortDirection("unknown", 8);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -67,6 +69,8 @@ PortDirection::destroy()
|
||||
ground_ = nullptr;
|
||||
delete power_;
|
||||
power_ = nullptr;
|
||||
delete bias_;
|
||||
bias_ = nullptr;
|
||||
delete unknown_;
|
||||
unknown_ = nullptr;
|
||||
}
|
||||
@@ -95,6 +99,8 @@ PortDirection::find(const char *dir_name)
|
||||
return ground_;
|
||||
else if (stringEqual(dir_name, "power"))
|
||||
return power_;
|
||||
else if (stringEqual(dir_name, "bias"))
|
||||
return bias_;
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
@@ -124,8 +130,7 @@ PortDirection::isAnyTristate() const
|
||||
bool
|
||||
PortDirection::isPowerGround() const
|
||||
{
|
||||
return this == ground_
|
||||
|| this == power_;
|
||||
return this == ground_ || this == power_ || this == bias_;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -161,11 +161,20 @@ TEST_F(PortDirectionTest, PowerSingleton) {
|
||||
EXPECT_TRUE(dir->isPower());
|
||||
}
|
||||
|
||||
TEST_F(PortDirectionTest, BiasSingleton)
|
||||
{
|
||||
PortDirection *dir = PortDirection::bias();
|
||||
EXPECT_NE(dir, nullptr);
|
||||
EXPECT_EQ(dir->name(), "bias");
|
||||
EXPECT_EQ(dir->index(), 7);
|
||||
EXPECT_TRUE(dir->isBias());
|
||||
}
|
||||
|
||||
TEST_F(PortDirectionTest, UnknownSingleton) {
|
||||
PortDirection *dir = PortDirection::unknown();
|
||||
EXPECT_NE(dir, nullptr);
|
||||
EXPECT_EQ(dir->name(), "unknown");
|
||||
EXPECT_EQ(dir->index(), 7);
|
||||
EXPECT_EQ(dir->index(), 8);
|
||||
EXPECT_TRUE(dir->isUnknown());
|
||||
}
|
||||
|
||||
@@ -177,6 +186,7 @@ TEST_F(PortDirectionTest, FindByName) {
|
||||
EXPECT_EQ(PortDirection::find("internal"), PortDirection::internal());
|
||||
EXPECT_EQ(PortDirection::find("ground"), PortDirection::ground());
|
||||
EXPECT_EQ(PortDirection::find("power"), PortDirection::power());
|
||||
EXPECT_EQ(PortDirection::find("bias"), PortDirection::bias());
|
||||
EXPECT_EQ(PortDirection::find("nonexistent"), nullptr);
|
||||
}
|
||||
|
||||
@@ -188,6 +198,7 @@ TEST_F(PortDirectionTest, IsAnyInput) {
|
||||
EXPECT_FALSE(PortDirection::internal()->isAnyInput());
|
||||
EXPECT_FALSE(PortDirection::ground()->isAnyInput());
|
||||
EXPECT_FALSE(PortDirection::power()->isAnyInput());
|
||||
EXPECT_FALSE(PortDirection::bias()->isAnyInput());
|
||||
EXPECT_FALSE(PortDirection::unknown()->isAnyInput());
|
||||
}
|
||||
|
||||
@@ -199,6 +210,7 @@ TEST_F(PortDirectionTest, IsAnyOutput) {
|
||||
EXPECT_FALSE(PortDirection::internal()->isAnyOutput());
|
||||
EXPECT_FALSE(PortDirection::ground()->isAnyOutput());
|
||||
EXPECT_FALSE(PortDirection::power()->isAnyOutput());
|
||||
EXPECT_FALSE(PortDirection::bias()->isAnyOutput());
|
||||
EXPECT_FALSE(PortDirection::unknown()->isAnyOutput());
|
||||
}
|
||||
|
||||
@@ -210,12 +222,14 @@ TEST_F(PortDirectionTest, IsAnyTristate) {
|
||||
EXPECT_FALSE(PortDirection::internal()->isAnyTristate());
|
||||
EXPECT_FALSE(PortDirection::ground()->isAnyTristate());
|
||||
EXPECT_FALSE(PortDirection::power()->isAnyTristate());
|
||||
EXPECT_FALSE(PortDirection::bias()->isAnyTristate());
|
||||
EXPECT_FALSE(PortDirection::unknown()->isAnyTristate());
|
||||
}
|
||||
|
||||
TEST_F(PortDirectionTest, IsPowerGround) {
|
||||
EXPECT_TRUE(PortDirection::power()->isPowerGround());
|
||||
EXPECT_TRUE(PortDirection::ground()->isPowerGround());
|
||||
EXPECT_TRUE(PortDirection::bias()->isPowerGround());
|
||||
EXPECT_FALSE(PortDirection::input()->isPowerGround());
|
||||
EXPECT_FALSE(PortDirection::output()->isPowerGround());
|
||||
EXPECT_FALSE(PortDirection::tristate()->isPowerGround());
|
||||
@@ -851,6 +865,7 @@ TEST(PortDirectionExtraTest, AllDirections) {
|
||||
EXPECT_NE(PortDirection::internal(), nullptr);
|
||||
EXPECT_NE(PortDirection::ground(), nullptr);
|
||||
EXPECT_NE(PortDirection::power(), nullptr);
|
||||
EXPECT_NE(PortDirection::bias(), nullptr);
|
||||
EXPECT_NE(PortDirection::unknown(), nullptr);
|
||||
}
|
||||
|
||||
@@ -873,6 +888,7 @@ TEST(PortDirectionExtraTest, DirectionProperties) {
|
||||
|
||||
EXPECT_TRUE(PortDirection::ground()->isPowerGround());
|
||||
EXPECT_TRUE(PortDirection::power()->isPowerGround());
|
||||
EXPECT_TRUE(PortDirection::bias()->isPowerGround());
|
||||
}
|
||||
|
||||
TEST(PortDirectionExtraTest, DirectionNames) {
|
||||
@@ -886,6 +902,7 @@ TEST(PortDirectionExtraTest, DirectionNames) {
|
||||
EXPECT_EQ(PortDirection::internal()->name(), "internal");
|
||||
EXPECT_EQ(PortDirection::ground()->name(), "ground");
|
||||
EXPECT_EQ(PortDirection::power()->name(), "power");
|
||||
EXPECT_EQ(PortDirection::bias()->name(), "bias");
|
||||
EXPECT_EQ(PortDirection::unknown()->name(), "unknown");
|
||||
}
|
||||
|
||||
@@ -900,6 +917,7 @@ TEST(PortDirectionExtraTest, FindAllByName) {
|
||||
EXPECT_EQ(PortDirection::find("internal"), PortDirection::internal());
|
||||
EXPECT_EQ(PortDirection::find("ground"), PortDirection::ground());
|
||||
EXPECT_EQ(PortDirection::find("power"), PortDirection::power());
|
||||
EXPECT_EQ(PortDirection::find("bias"), PortDirection::bias());
|
||||
// "unknown" is not findable by name, returns nullptr
|
||||
EXPECT_EQ(PortDirection::find("nonexistent"), nullptr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user