diff --git a/tgt-vhdl/stmt.cc b/tgt-vhdl/stmt.cc index 47ab005f1..e7619b205 100644 --- a/tgt-vhdl/stmt.cc +++ b/tgt-vhdl/stmt.cc @@ -405,7 +405,8 @@ static int draw_case(vhdl_process *proc, stmt_container *container, return 1; vhdl_case_branch *branch = new vhdl_case_branch(when); - + vhdlcase->add_branch(branch); + draw_stmt(proc, branch->get_container(), ivl_stmt_case_stmt(stmt, i)); } diff --git a/tgt-vhdl/vhdl_syntax.cc b/tgt-vhdl/vhdl_syntax.cc index 004a8e8b5..314ee5ee0 100644 --- a/tgt-vhdl/vhdl_syntax.cc +++ b/tgt-vhdl/vhdl_syntax.cc @@ -781,7 +781,6 @@ void vhdl_case_branch::emit(std::ofstream &of, int level) const of << "when "; when_->emit(of, level); of << " =>"; - newline(of, indent(level)); stmts_.emit(of, indent(level)); } @@ -795,7 +794,12 @@ void vhdl_case_stmt::emit(std::ofstream &of, int level) const of << "case "; test_->emit(of, level); of << " is"; - emit_children(of, branches_, level); + newline(of, indent(level)); + + case_branch_list_t::const_iterator it; + for (it = branches_.begin(); it != branches_.end(); ++it) + (*it)->emit(of, level); + of << "end case;"; }