diff options
author | Marcelina KoĆcielnicka <mwk@0x04.net> | 2021-01-28 00:31:50 +0100 |
---|---|---|
committer | Marcelina KoĆcielnicka <mwk@0x04.net> | 2021-01-29 16:28:15 +0100 |
commit | a4c04d1b909285789cbb3b7f9d39e9020701f741 (patch) | |
tree | 2b34e203e00ec68e4fc4f4473caa04cf6c028275 /frontends/ast | |
parent | 708eb327a1e88f726b8d426dba35abc29339a634 (diff) | |
download | yosys-a4c04d1b909285789cbb3b7f9d39e9020701f741.tar.gz yosys-a4c04d1b909285789cbb3b7f9d39e9020701f741.tar.bz2 yosys-a4c04d1b909285789cbb3b7f9d39e9020701f741.zip |
ast: fix dump_vlog display of casex/casez
The first child of AST_CASE is the case expression, it's subsequent
childrean that are AST_COND* and can be used to discriminate the type of
the case.
Diffstat (limited to 'frontends/ast')
-rw-r--r-- | frontends/ast/ast.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/frontends/ast/ast.cc b/frontends/ast/ast.cc index 1c0a8b34d..dc47420af 100644 --- a/frontends/ast/ast.cc +++ b/frontends/ast/ast.cc @@ -548,9 +548,9 @@ void AstNode::dumpVlog(FILE *f, std::string indent) const break; case AST_CASE: - if (!children.empty() && children[0]->type == AST_CONDX) + if (children.size() > 1 && children[1]->type == AST_CONDX) fprintf(f, "%s" "casex (", indent.c_str()); - else if (!children.empty() && children[0]->type == AST_CONDZ) + else if (children.size() > 1 && children[1]->type == AST_CONDZ) fprintf(f, "%s" "casez (", indent.c_str()); else fprintf(f, "%s" "case (", indent.c_str()); |