aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/ast/ast.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2019-03-21 22:20:16 +0100
committerClifford Wolf <clifford@clifford.at>2019-03-21 22:20:16 +0100
commitda42f10765bafe89892aebdf8eeb672282d7ee34 (patch)
treebbe5b6bf42c639c9f58f09743267f0a542ce6df4 /frontends/ast/ast.cc
parent9b0e7af6d7c84d9b252acbe0fbbf596c75fc1498 (diff)
downloadyosys-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.cc9
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, "");