3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-23 04:38:55 +00:00

libparse: support space ANDs

This commit is contained in:
Emil J. Tywoniak 2025-07-11 23:09:30 +02:00
parent 4b1a8a3b66
commit c6e1d461fa
3 changed files with 32 additions and 19 deletions

View file

@ -92,9 +92,6 @@ static bool parse_next_state(const LibertyAst *cell, const LibertyAst *attr, std
auto expr = attr->value;
auto cell_name = cell->args[0];
for (size_t pos = expr.find_first_of("\" \t"); pos != std::string::npos; pos = expr.find_first_of("\" \t"))
expr.erase(pos, 1);
// if this isn't an enable flop, the next_state variable is usually just the input pin name.
if (expr[expr.size()-1] == '\'') {
data_name = expr.substr(0, expr.size()-1);
@ -117,7 +114,7 @@ static bool parse_next_state(const LibertyAst *cell, const LibertyAst *attr, std
// the next_state variable isn't just a pin name; perhaps this is an enable?
auto helper = LibertyExpression::Lexer(expr);
auto tree = LibertyExpression::parse(helper);
log_debug("liberty expression:\n%s\n", tree.str().c_str());
// log_debug("liberty expression:\n%s\n", tree.str().c_str());
if (tree.kind == LibertyExpression::Kind::EMPTY) {
if (!warned_cells.count(cell_name)) {