VHDL AST element for non-blocking assignment

This commit is contained in:
Nick Gasson 2008-06-07 14:31:33 +01:00
parent 12e2237131
commit 39228f3495
3 changed files with 22 additions and 1 deletions

View File

@ -65,7 +65,6 @@ static int draw_stask_display(vhdl_process *proc, ivl_statement_t stmt)
if (NULL == base) if (NULL == base)
return 1; return 1;
// Need to add a call to Type'Image for types not // Need to add a call to Type'Image for types not
// supported by std.textio // supported by std.textio
if (base->get_type()->get_name() != "String") { if (base->get_type()->get_name() != "String") {

View File

@ -451,3 +451,10 @@ void vhdl_fcall::emit(std::ofstream &of, int level) const
exprs_.emit(of, level); exprs_.emit(of, level);
} }
void vhdl_nbassign_stmt::emit(std::ofstream &of, int level) const
{
lhs_->emit(of, level);
of << " <= ";
rhs_->emit(of, level);
of << ";";
}

View File

@ -170,6 +170,21 @@ public:
typedef std::list<vhdl_seq_stmt*> seq_stmt_list_t; typedef std::list<vhdl_seq_stmt*> seq_stmt_list_t;
/*
* Similar to Verilog non-blocking assignment, except the LHS
* must be a signal not a variable.
*/
class vhdl_nbassign_stmt : public vhdl_seq_stmt {
public:
vhdl_nbassign_stmt(vhdl_var_ref *lhs, vhdl_expr *rhs)
: lhs_(lhs), rhs_(rhs) {}
void emit(std::ofstream &of, int level);
private:
vhdl_var_ref *lhs_;
vhdl_expr *rhs_;
};
/* /*
* Delay simulation indefinitely, until an event, or for a * Delay simulation indefinitely, until an event, or for a
* specified time. * specified time.