diff options
author | Clifford Wolf <clifford@clifford.at> | 2019-03-21 22:20:16 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2019-03-21 22:20:16 +0100 |
commit | da42f10765bafe89892aebdf8eeb672282d7ee34 (patch) | |
tree | bbe5b6bf42c639c9f58f09743267f0a542ce6df4 /frontends/ast/ast.cc | |
parent | 9b0e7af6d7c84d9b252acbe0fbbf596c75fc1498 (diff) | |
download | yosys-da42f10765bafe89892aebdf8eeb672282d7ee34.tar.gz yosys-da42f10765bafe89892aebdf8eeb672282d7ee34.tar.bz2 yosys-da42f10765bafe89892aebdf8eeb672282d7ee34.zip |
Improve "read_verilog -dump_vlog[12]" handling of upto ranges
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'frontends/ast/ast.cc')
-rw-r--r-- | frontends/ast/ast.cc | 9 |
1 files changed, 6 insertions, 3 deletions
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, ""); |