3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-02-24 17:21:26 +00:00

libparse: parse expressions in filterlib

This commit is contained in:
Emil J. Tywoniak 2025-11-05 12:12:30 +01:00
parent 66d8fc5c28
commit 547e254a9b
3 changed files with 79 additions and 55 deletions

View file

@ -127,7 +127,7 @@ static bool parse_next_state(const LibertyAst *cell, const LibertyAst *attr, std
return false;
}
auto pin_names = pool<std::string>{};
auto pin_names = std::unordered_set<std::string>{};
tree.get_pin_names(pin_names);
// from the `ff` block, we know the flop output signal name for loopback.
@ -156,7 +156,7 @@ static bool parse_next_state(const LibertyAst *cell, const LibertyAst *attr, std
auto pins = std::vector<std::string>(pin_names.begin(), pin_names.end());
int lut = 0;
for (int n = 0; n < 8; n++) {
auto values = dict<std::string, bool>{};
auto values = std::unordered_map<std::string, bool>{};
values.insert(std::make_pair(pins[0], (n & 1) == 1));
values.insert(std::make_pair(pins[1], (n & 2) == 2));
values.insert(std::make_pair(ff_output, (n & 4) == 4));