VHDL AST element for `wait on' statement

This commit is contained in:
Nick Gasson 2008-07-17 17:23:21 +01:00
parent 7677b59650
commit 1f9ed2c5ec
3 changed files with 14 additions and 2 deletions

View File

@ -435,8 +435,8 @@ static int draw_wait(vhdl_procedural *_proc, stmt_container *container,
}
}
draw_stmt(proc, container, ivl_stmt_sub_stmt(stmt));
container->add_stmt(new vhdl_wait_stmt(VHDL_WAIT_UNTIL, test));
draw_stmt(proc, container, ivl_stmt_sub_stmt(stmt));
return 0;
}

View File

@ -305,6 +305,16 @@ void vhdl_wait_stmt::emit(std::ostream &of, int level) const
of << " until ";
expr_->emit(of, level);
break;
case VHDL_WAIT_ON:
{
string_list_t::const_iterator it = sensitivity_.begin();
while (it != sensitivity_.end()) {
of << *it;
if (++it != sensitivity_.end())
of << ", ";
}
}
break;
}
of << ";";

View File

@ -307,7 +307,8 @@ public:
enum vhdl_wait_type_t {
VHDL_WAIT_INDEF, // Suspend indefinitely
VHDL_WAIT_FOR, // Wait for a constant amount of time
VHDL_WAIT_UNTIL, // Wait on a sensitivity list
VHDL_WAIT_UNTIL, // Wait on an expression
VHDL_WAIT_ON, // Wait on a sensitivity list
};
/*
@ -325,6 +326,7 @@ public:
private:
vhdl_wait_type_t type_;
vhdl_expr *expr_;
string_list_t sensitivity_;
};