From: Clifford Wolf Date: Thu, 21 Mar 2019 21:20:16 +0000 (+0100) Subject: Improve "read_verilog -dump_vlog[12]" handling of upto ranges X-Git-Tag: yosys-0.9~229 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=da42f10765bafe89892aebdf8eeb672282d7ee34;p=yosys.git Improve "read_verilog -dump_vlog[12]" handling of upto ranges Signed-off-by: Clifford Wolf --- diff --git a/frontends/ast/ast.cc b/frontends/ast/ast.cc index 0442ea0db..d48996167 100644 --- a/frontends/ast/ast.cc +++ b/frontends/ast/ast.cc @@ -431,9 +431,12 @@ void AstNode::dumpVlog(FILE *f, std::string indent) const break; case AST_RANGE: - if (range_valid) - fprintf(f, "[%d:%d]", range_left, range_right); - else { + if (range_valid) { + if (range_swapped) + fprintf(f, "[%d:%d]", range_right, range_left); + else + fprintf(f, "[%d:%d]", range_left, range_right); + } else { for (auto child : children) { fprintf(f, "%c", first ? '[' : ':'); child->dumpVlog(f, "");