Generate VHDL for no-op statements

This commit is contained in:
Nick Gasson 2008-06-05 13:16:35 +01:00
parent e258058cf1
commit d36bbec5b5
3 changed files with 23 additions and 0 deletions

View File

@ -117,6 +117,16 @@ static int draw_block(vhdl_process *proc, ivl_statement_t stmt)
return 0;
}
/*
* A no-op statement. This corresponds to a `null' statement in
* VHDL.
*/
static int draw_noop(vhdl_process *proc, ivl_statement_t stmt)
{
proc->add_stmt(new vhdl_null_stmt());
return 0;
}
/*
* Generate VHDL statements for the given Verilog statement and
* add them to the given VHDL process.
@ -128,6 +138,8 @@ int draw_stmt(vhdl_process *proc, ivl_statement_t stmt)
return draw_stask(proc, stmt);
case IVL_ST_BLOCK:
return draw_block(proc, stmt);
case IVL_ST_NOOP:
return draw_noop(proc, stmt);
default:
error("No VHDL translation for statement at %s:%d (type = %d)",
ivl_stmt_file(stmt), ivl_stmt_lineno(stmt),

View File

@ -363,3 +363,8 @@ void vhdl_const_string::emit(std::ofstream &of, int level) const
// isn't always strictly necessary)
of << "String'(\"" << value_ << "\")";
}
void vhdl_null_stmt::emit(std::ofstream &of, int level) const
{
of << "null;";
}

View File

@ -142,6 +142,12 @@ public:
};
class vhdl_null_stmt : public vhdl_seq_stmt {
public:
void emit(std::ofstream &of, int level) const;
};
/*
* A procedure call. Which is a statement, unlike a function
* call which is an expression.