3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-09-29 20:59:03 +00:00

Const::decode_string() doesn't need to call bitvectorize

This commit is contained in:
Robert O'Callahan 2025-08-29 04:42:52 +00:00
parent cb1186aac5
commit caaf9a4400
2 changed files with 26 additions and 1 deletions

View file

@ -131,6 +131,32 @@ namespace RTLIL {
EXPECT_EQ(c.as_string(), "00000010");
EXPECT_TRUE(c.is_str());
}
{
Const c(" ");
EXPECT_TRUE(c.is_str());
EXPECT_EQ(c.decode_string(), " ");
EXPECT_TRUE(c.is_str());
}
{
Const c(" ");
EXPECT_TRUE(c.is_str());
EXPECT_EQ(c.decode_string(), " ");
EXPECT_TRUE(c.is_str());
}
{
std::vector<State> v = {S0, S0, S0, S0, S0, S1, S0, S0};
Const c(v);
EXPECT_EQ(c.decode_string(), " ");
}
{
std::vector<State> v = {S0, S0, S0, S0, S0, S1, S0, Sx};
Const c(v);
EXPECT_EQ(c.decode_string(), " ");
}
}
TEST_F(KernelRtlilTest, ConstConstIteratorWorks) {